// Code generated by smithy-go-codegen DO NOT EDIT. package imagebuilder import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/imagebuilder/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 awsRestjson1_deserializeOpCancelImageCreation struct { } func (*awsRestjson1_deserializeOpCancelImageCreation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelImageCreation) 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, awsRestjson1_deserializeOpErrorCancelImageCreation(response, &metadata) } output := &CancelImageCreationOutput{} 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 = awsRestjson1_deserializeOpDocumentCancelImageCreationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelImageCreation(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCancelImageCreationOutput(v **CancelImageCreationOutput, 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 *CancelImageCreationOutput if *v == nil { sv = &CancelImageCreationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateComponent struct { } func (*awsRestjson1_deserializeOpCreateComponent) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateComponent) 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, awsRestjson1_deserializeOpErrorCreateComponent(response, &metadata) } output := &CreateComponentOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateComponent(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidParameterCombinationException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("InvalidVersionNumberException", errorCode): return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateComponentOutput(v **CreateComponentOutput, 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 *CreateComponentOutput if *v == nil { sv = &CreateComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "componentBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } sv.ComponentBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateContainerRecipe struct { } func (*awsRestjson1_deserializeOpCreateContainerRecipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateContainerRecipe) 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, awsRestjson1_deserializeOpErrorCreateContainerRecipe(response, &metadata) } output := &CreateContainerRecipeOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateContainerRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateContainerRecipe(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("InvalidVersionNumberException", errorCode): return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateContainerRecipeOutput(v **CreateContainerRecipeOutput, 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 *CreateContainerRecipeOutput if *v == nil { sv = &CreateContainerRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "containerRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) } sv.ContainerRecipeArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDistributionConfiguration struct { } func (*awsRestjson1_deserializeOpCreateDistributionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDistributionConfiguration) 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, awsRestjson1_deserializeOpErrorCreateDistributionConfiguration(response, &metadata) } output := &CreateDistributionConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateDistributionConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidParameterCombinationException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateDistributionConfigurationOutput(v **CreateDistributionConfigurationOutput, 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 *CreateDistributionConfigurationOutput if *v == nil { sv = &CreateDistributionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "distributionConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) } sv.DistributionConfigurationArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateImage struct { } func (*awsRestjson1_deserializeOpCreateImage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateImage) 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, awsRestjson1_deserializeOpErrorCreateImage(response, &metadata) } output := &CreateImageOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateImage(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateImageOutput(v **CreateImageOutput, 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 *CreateImageOutput if *v == nil { sv = &CreateImageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateImagePipeline struct { } func (*awsRestjson1_deserializeOpCreateImagePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateImagePipeline) 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, awsRestjson1_deserializeOpErrorCreateImagePipeline(response, &metadata) } output := &CreateImagePipelineOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateImagePipeline(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateImagePipelineOutput(v **CreateImagePipelineOutput, 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 *CreateImagePipelineOutput if *v == nil { sv = &CreateImagePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } sv.ImagePipelineArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateImageRecipe struct { } func (*awsRestjson1_deserializeOpCreateImageRecipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateImageRecipe) 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, awsRestjson1_deserializeOpErrorCreateImageRecipe(response, &metadata) } output := &CreateImageRecipeOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateImageRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateImageRecipe(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("InvalidVersionNumberException", errorCode): return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateImageRecipeOutput(v **CreateImageRecipeOutput, 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 *CreateImageRecipeOutput if *v == nil { sv = &CreateImageRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) } sv.ImageRecipeArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateInfrastructureConfiguration struct { } func (*awsRestjson1_deserializeOpCreateInfrastructureConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateInfrastructureConfiguration) 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, awsRestjson1_deserializeOpErrorCreateInfrastructureConfiguration(response, &metadata) } output := &CreateInfrastructureConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentCreateInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateInfrastructureConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateInfrastructureConfigurationOutput(v **CreateInfrastructureConfigurationOutput, 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 *CreateInfrastructureConfigurationOutput if *v == nil { sv = &CreateInfrastructureConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "infrastructureConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) } sv.InfrastructureConfigurationArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteComponent struct { } func (*awsRestjson1_deserializeOpDeleteComponent) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteComponent) 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, awsRestjson1_deserializeOpErrorDeleteComponent(response, &metadata) } output := &DeleteComponentOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteComponent(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteComponentOutput(v **DeleteComponentOutput, 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 *DeleteComponentOutput if *v == nil { sv = &DeleteComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "componentBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } sv.ComponentBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteContainerRecipe struct { } func (*awsRestjson1_deserializeOpDeleteContainerRecipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteContainerRecipe) 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, awsRestjson1_deserializeOpErrorDeleteContainerRecipe(response, &metadata) } output := &DeleteContainerRecipeOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteContainerRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteContainerRecipe(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteContainerRecipeOutput(v **DeleteContainerRecipeOutput, 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 *DeleteContainerRecipeOutput if *v == nil { sv = &DeleteContainerRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "containerRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) } sv.ContainerRecipeArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteDistributionConfiguration struct { } func (*awsRestjson1_deserializeOpDeleteDistributionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) 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, awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(response, &metadata) } output := &DeleteDistributionConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(v **DeleteDistributionConfigurationOutput, 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 *DeleteDistributionConfigurationOutput if *v == nil { sv = &DeleteDistributionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "distributionConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) } sv.DistributionConfigurationArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteImage struct { } func (*awsRestjson1_deserializeOpDeleteImage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteImage) 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, awsRestjson1_deserializeOpErrorDeleteImage(response, &metadata) } output := &DeleteImageOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteImage(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteImageOutput(v **DeleteImageOutput, 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 *DeleteImageOutput if *v == nil { sv = &DeleteImageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteImagePipeline struct { } func (*awsRestjson1_deserializeOpDeleteImagePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteImagePipeline) 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, awsRestjson1_deserializeOpErrorDeleteImagePipeline(response, &metadata) } output := &DeleteImagePipelineOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteImagePipeline(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(v **DeleteImagePipelineOutput, 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 *DeleteImagePipelineOutput if *v == nil { sv = &DeleteImagePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } sv.ImagePipelineArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteImageRecipe struct { } func (*awsRestjson1_deserializeOpDeleteImageRecipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteImageRecipe) 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, awsRestjson1_deserializeOpErrorDeleteImageRecipe(response, &metadata) } output := &DeleteImageRecipeOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteImageRecipe(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(v **DeleteImageRecipeOutput, 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 *DeleteImageRecipeOutput if *v == nil { sv = &DeleteImageRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) } sv.ImageRecipeArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteInfrastructureConfiguration struct { } func (*awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) 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, awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(response, &metadata) } output := &DeleteInfrastructureConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceDependencyException", errorCode): return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(v **DeleteInfrastructureConfigurationOutput, 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 *DeleteInfrastructureConfigurationOutput if *v == nil { sv = &DeleteInfrastructureConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "infrastructureConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) } sv.InfrastructureConfigurationArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetComponent struct { } func (*awsRestjson1_deserializeOpGetComponent) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetComponent) 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, awsRestjson1_deserializeOpErrorGetComponent(response, &metadata) } output := &GetComponentOutput{} 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 = awsRestjson1_deserializeOpDocumentGetComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetComponent(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput, 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 *GetComponentOutput if *v == nil { sv = &GetComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "component": if err := awsRestjson1_deserializeDocumentComponent(&sv.Component, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetComponentPolicy struct { } func (*awsRestjson1_deserializeOpGetComponentPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetComponentPolicy) 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, awsRestjson1_deserializeOpErrorGetComponentPolicy(response, &metadata) } output := &GetComponentPolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetComponentPolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(v **GetComponentPolicyOutput, 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 *GetComponentPolicyOutput if *v == nil { sv = &GetComponentPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetContainerRecipe struct { } func (*awsRestjson1_deserializeOpGetContainerRecipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetContainerRecipe) 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, awsRestjson1_deserializeOpErrorGetContainerRecipe(response, &metadata) } output := &GetContainerRecipeOutput{} 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 = awsRestjson1_deserializeOpDocumentGetContainerRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetContainerRecipe(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetContainerRecipeOutput(v **GetContainerRecipeOutput, 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 *GetContainerRecipeOutput if *v == nil { sv = &GetContainerRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "containerRecipe": if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetContainerRecipePolicy struct { } func (*awsRestjson1_deserializeOpGetContainerRecipePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetContainerRecipePolicy) 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, awsRestjson1_deserializeOpErrorGetContainerRecipePolicy(response, &metadata) } output := &GetContainerRecipePolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentGetContainerRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetContainerRecipePolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetContainerRecipePolicyOutput(v **GetContainerRecipePolicyOutput, 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 *GetContainerRecipePolicyOutput if *v == nil { sv = &GetContainerRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetDistributionConfiguration struct { } func (*awsRestjson1_deserializeOpGetDistributionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) 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, awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response, &metadata) } output := &GetDistributionConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetDistributionConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(v **GetDistributionConfigurationOutput, 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 *GetDistributionConfigurationOutput if *v == nil { sv = &GetDistributionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "distributionConfiguration": if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetImage struct { } func (*awsRestjson1_deserializeOpGetImage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetImage) 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, awsRestjson1_deserializeOpErrorGetImage(response, &metadata) } output := &GetImageOutput{} 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 = awsRestjson1_deserializeOpDocumentGetImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetImage(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetImageOutput(v **GetImageOutput, 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 *GetImageOutput if *v == nil { sv = &GetImageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "image": if err := awsRestjson1_deserializeDocumentImage(&sv.Image, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetImagePipeline struct { } func (*awsRestjson1_deserializeOpGetImagePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetImagePipeline) 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, awsRestjson1_deserializeOpErrorGetImagePipeline(response, &metadata) } output := &GetImagePipelineOutput{} 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 = awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetImagePipeline(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(v **GetImagePipelineOutput, 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 *GetImagePipelineOutput if *v == nil { sv = &GetImagePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imagePipeline": if err := awsRestjson1_deserializeDocumentImagePipeline(&sv.ImagePipeline, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetImagePolicy struct { } func (*awsRestjson1_deserializeOpGetImagePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetImagePolicy) 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, awsRestjson1_deserializeOpErrorGetImagePolicy(response, &metadata) } output := &GetImagePolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetImagePolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(v **GetImagePolicyOutput, 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 *GetImagePolicyOutput if *v == nil { sv = &GetImagePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetImageRecipe struct { } func (*awsRestjson1_deserializeOpGetImageRecipe) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetImageRecipe) 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, awsRestjson1_deserializeOpErrorGetImageRecipe(response, &metadata) } output := &GetImageRecipeOutput{} 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 = awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetImageRecipe(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(v **GetImageRecipeOutput, 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 *GetImageRecipeOutput if *v == nil { sv = &GetImageRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageRecipe": if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetImageRecipePolicy struct { } func (*awsRestjson1_deserializeOpGetImageRecipePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) 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, awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response, &metadata) } output := &GetImageRecipePolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetImageRecipePolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(v **GetImageRecipePolicyOutput, 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 *GetImageRecipePolicyOutput if *v == nil { sv = &GetImageRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetInfrastructureConfiguration struct { } func (*awsRestjson1_deserializeOpGetInfrastructureConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) 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, awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response, &metadata) } output := &GetInfrastructureConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v **GetInfrastructureConfigurationOutput, 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 *GetInfrastructureConfigurationOutput if *v == nil { sv = &GetInfrastructureConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "infrastructureConfiguration": if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil { return err } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetWorkflowExecution struct { } func (*awsRestjson1_deserializeOpGetWorkflowExecution) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetWorkflowExecution) 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, awsRestjson1_deserializeOpErrorGetWorkflowExecution(response, &metadata) } output := &GetWorkflowExecutionOutput{} 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 = awsRestjson1_deserializeOpDocumentGetWorkflowExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetWorkflowExecution(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetWorkflowExecutionOutput(v **GetWorkflowExecutionOutput, 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 *GetWorkflowExecutionOutput if *v == nil { sv = &GetWorkflowExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "endTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.EndTime = ptr.String(jtv) } case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "startTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.StartTime = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.WorkflowExecutionStatus(jtv) } case "totalStepCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepCount = int32(i64) } case "totalStepsFailed": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepsFailed = int32(i64) } case "totalStepsSkipped": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepsSkipped = int32(i64) } case "totalStepsSucceeded": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepsSucceeded = int32(i64) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowType to be of type string, got %T instead", value) } sv.Type = types.WorkflowType(jtv) } case "workflowBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) } sv.WorkflowBuildVersionArn = ptr.String(jtv) } case "workflowExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) } sv.WorkflowExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetWorkflowStepExecution struct { } func (*awsRestjson1_deserializeOpGetWorkflowStepExecution) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetWorkflowStepExecution) 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, awsRestjson1_deserializeOpErrorGetWorkflowStepExecution(response, &metadata) } output := &GetWorkflowStepExecutionOutput{} 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 = awsRestjson1_deserializeOpDocumentGetWorkflowStepExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetWorkflowStepExecution(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetWorkflowStepExecutionOutput(v **GetWorkflowStepExecutionOutput, 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 *GetWorkflowStepExecutionOutput if *v == nil { sv = &GetWorkflowStepExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "action": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepAction to be of type string, got %T instead", value) } sv.Action = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "endTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.EndTime = ptr.String(jtv) } case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "inputs": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepInputs to be of type string, got %T instead", value) } sv.Inputs = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "onFailure": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.OnFailure = ptr.String(jtv) } case "outputs": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepOutputs to be of type string, got %T instead", value) } sv.Outputs = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "rollbackStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepExecutionRollbackStatus to be of type string, got %T instead", value) } sv.RollbackStatus = types.WorkflowStepExecutionRollbackStatus(jtv) } case "startTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.StartTime = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.WorkflowStepExecutionStatus(jtv) } case "stepExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepExecutionId to be of type string, got %T instead", value) } sv.StepExecutionId = ptr.String(jtv) } case "timeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepTimeoutSecondsInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutSeconds = ptr.Int32(int32(i64)) } case "workflowBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) } sv.WorkflowBuildVersionArn = ptr.String(jtv) } case "workflowExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) } sv.WorkflowExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpImportComponent struct { } func (*awsRestjson1_deserializeOpImportComponent) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpImportComponent) 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, awsRestjson1_deserializeOpErrorImportComponent(response, &metadata) } output := &ImportComponentOutput{} 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 = awsRestjson1_deserializeOpDocumentImportComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorImportComponent(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidParameterCombinationException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("InvalidVersionNumberException", errorCode): return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponentOutput, 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 *ImportComponentOutput if *v == nil { sv = &ImportComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "componentBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } sv.ComponentBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpImportVmImage struct { } func (*awsRestjson1_deserializeOpImportVmImage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpImportVmImage) 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, awsRestjson1_deserializeOpErrorImportVmImage(response, &metadata) } output := &ImportVmImageOutput{} 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 = awsRestjson1_deserializeOpDocumentImportVmImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorImportVmImage(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentImportVmImageOutput(v **ImportVmImageOutput, 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 *ImportVmImageOutput if *v == nil { sv = &ImportVmImageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imageArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ImageArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListComponentBuildVersions struct { } func (*awsRestjson1_deserializeOpListComponentBuildVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListComponentBuildVersions) 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, awsRestjson1_deserializeOpErrorListComponentBuildVersions(response, &metadata) } output := &ListComponentBuildVersionsOutput{} 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 = awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListComponentBuildVersions(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **ListComponentBuildVersionsOutput, 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 *ListComponentBuildVersionsOutput if *v == nil { sv = &ListComponentBuildVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "componentSummaryList": if err := awsRestjson1_deserializeDocumentComponentSummaryList(&sv.ComponentSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListComponents struct { } func (*awsRestjson1_deserializeOpListComponents) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListComponents) 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, awsRestjson1_deserializeOpErrorListComponents(response, &metadata) } output := &ListComponentsOutput{} 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 = awsRestjson1_deserializeOpDocumentListComponentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListComponents(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, 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 *ListComponentsOutput if *v == nil { sv = &ListComponentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "componentVersionList": if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersionList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListContainerRecipes struct { } func (*awsRestjson1_deserializeOpListContainerRecipes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListContainerRecipes) 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, awsRestjson1_deserializeOpErrorListContainerRecipes(response, &metadata) } output := &ListContainerRecipesOutput{} 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 = awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListContainerRecipes(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContainerRecipesOutput, 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 *ListContainerRecipesOutput if *v == nil { sv = &ListContainerRecipesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "containerRecipeSummaryList": if err := awsRestjson1_deserializeDocumentContainerRecipeSummaryList(&sv.ContainerRecipeSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDistributionConfigurations struct { } func (*awsRestjson1_deserializeOpListDistributionConfigurations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDistributionConfigurations) 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, awsRestjson1_deserializeOpErrorListDistributionConfigurations(response, &metadata) } output := &ListDistributionConfigurationsOutput{} 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 = awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListDistributionConfigurations(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v **ListDistributionConfigurationsOutput, 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 *ListDistributionConfigurationsOutput if *v == nil { sv = &ListDistributionConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "distributionConfigurationSummaryList": if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(&sv.DistributionConfigurationSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImageBuildVersions struct { } func (*awsRestjson1_deserializeOpListImageBuildVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImageBuildVersions) 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, awsRestjson1_deserializeOpErrorListImageBuildVersions(response, &metadata) } output := &ListImageBuildVersionsOutput{} 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 = awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImageBuildVersions(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImageBuildVersionsOutput, 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 *ListImageBuildVersionsOutput if *v == nil { sv = &ListImageBuildVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageSummaryList": if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImagePackages struct { } func (*awsRestjson1_deserializeOpListImagePackages) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImagePackages) 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, awsRestjson1_deserializeOpErrorListImagePackages(response, &metadata) } output := &ListImagePackagesOutput{} 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 = awsRestjson1_deserializeOpDocumentListImagePackagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImagePackages(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImagePackagesOutput(v **ListImagePackagesOutput, 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 *ListImagePackagesOutput if *v == nil { sv = &ListImagePackagesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imagePackageList": if err := awsRestjson1_deserializeDocumentImagePackageList(&sv.ImagePackageList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImagePipelineImages struct { } func (*awsRestjson1_deserializeOpListImagePipelineImages) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImagePipelineImages) 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, awsRestjson1_deserializeOpErrorListImagePipelineImages(response, &metadata) } output := &ListImagePipelineImagesOutput{} 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 = awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImagePipelineImages(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListImagePipelineImagesOutput, 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 *ListImagePipelineImagesOutput if *v == nil { sv = &ListImagePipelineImagesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageSummaryList": if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImagePipelines struct { } func (*awsRestjson1_deserializeOpListImagePipelines) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImagePipelines) 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, awsRestjson1_deserializeOpErrorListImagePipelines(response, &metadata) } output := &ListImagePipelinesOutput{} 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 = awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImagePipelines(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePipelinesOutput, 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 *ListImagePipelinesOutput if *v == nil { sv = &ListImagePipelinesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imagePipelineList": if err := awsRestjson1_deserializeDocumentImagePipelineList(&sv.ImagePipelineList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImageRecipes struct { } func (*awsRestjson1_deserializeOpListImageRecipes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImageRecipes) 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, awsRestjson1_deserializeOpErrorListImageRecipes(response, &metadata) } output := &ListImageRecipesOutput{} 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 = awsRestjson1_deserializeOpDocumentListImageRecipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImageRecipes(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecipesOutput, 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 *ListImageRecipesOutput if *v == nil { sv = &ListImageRecipesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageRecipeSummaryList": if err := awsRestjson1_deserializeDocumentImageRecipeSummaryList(&sv.ImageRecipeSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImages struct { } func (*awsRestjson1_deserializeOpListImages) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_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, awsRestjson1_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 = awsRestjson1_deserializeOpDocumentListImagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_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 "imageVersionList": if err := awsRestjson1_deserializeDocumentImageVersionList(&sv.ImageVersionList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImageScanFindingAggregations struct { } func (*awsRestjson1_deserializeOpListImageScanFindingAggregations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImageScanFindingAggregations) 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, awsRestjson1_deserializeOpErrorListImageScanFindingAggregations(response, &metadata) } output := &ListImageScanFindingAggregationsOutput{} 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 = awsRestjson1_deserializeOpDocumentListImageScanFindingAggregationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImageScanFindingAggregations(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImageScanFindingAggregationsOutput(v **ListImageScanFindingAggregationsOutput, 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 *ListImageScanFindingAggregationsOutput if *v == nil { sv = &ListImageScanFindingAggregationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "aggregationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AggregationType = ptr.String(jtv) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "responses": if err := awsRestjson1_deserializeDocumentImageScanFindingAggregationsList(&sv.Responses, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListImageScanFindings struct { } func (*awsRestjson1_deserializeOpListImageScanFindings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListImageScanFindings) 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, awsRestjson1_deserializeOpErrorListImageScanFindings(response, &metadata) } output := &ListImageScanFindingsOutput{} 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 = awsRestjson1_deserializeOpDocumentListImageScanFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListImageScanFindings(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListImageScanFindingsOutput(v **ListImageScanFindingsOutput, 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 *ListImageScanFindingsOutput if *v == nil { sv = &ListImageScanFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "findings": if err := awsRestjson1_deserializeDocumentImageScanFindingsList(&sv.Findings, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListInfrastructureConfigurations struct { } func (*awsRestjson1_deserializeOpListInfrastructureConfigurations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) 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, awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response, &metadata) } output := &ListInfrastructureConfigurationsOutput{} 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 = awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v **ListInfrastructureConfigurationsOutput, 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 *ListInfrastructureConfigurationsOutput if *v == nil { sv = &ListInfrastructureConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "infrastructureConfigurationSummaryList": if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(&sv.InfrastructureConfigurationSummaryList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_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, awsRestjson1_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 = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_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 := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWorkflowExecutions struct { } func (*awsRestjson1_deserializeOpListWorkflowExecutions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorkflowExecutions) 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, awsRestjson1_deserializeOpErrorListWorkflowExecutions(response, &metadata) } output := &ListWorkflowExecutionsOutput{} 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 = awsRestjson1_deserializeOpDocumentListWorkflowExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListWorkflowExecutions(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorkflowExecutionsOutput(v **ListWorkflowExecutionsOutput, 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 *ListWorkflowExecutionsOutput if *v == nil { sv = &ListWorkflowExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "workflowExecutions": if err := awsRestjson1_deserializeDocumentWorkflowExecutionsList(&sv.WorkflowExecutions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWorkflowStepExecutions struct { } func (*awsRestjson1_deserializeOpListWorkflowStepExecutions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorkflowStepExecutions) 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, awsRestjson1_deserializeOpErrorListWorkflowStepExecutions(response, &metadata) } output := &ListWorkflowStepExecutionsOutput{} 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 = awsRestjson1_deserializeOpDocumentListWorkflowStepExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListWorkflowStepExecutions(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidPaginationTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorkflowStepExecutionsOutput(v **ListWorkflowStepExecutionsOutput, 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 *ListWorkflowStepExecutionsOutput if *v == nil { sv = &ListWorkflowStepExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "steps": if err := awsRestjson1_deserializeDocumentWorkflowStepExecutionsList(&sv.Steps, value); err != nil { return err } case "workflowBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) } sv.WorkflowBuildVersionArn = ptr.String(jtv) } case "workflowExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) } sv.WorkflowExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutComponentPolicy struct { } func (*awsRestjson1_deserializeOpPutComponentPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutComponentPolicy) 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, awsRestjson1_deserializeOpErrorPutComponentPolicy(response, &metadata) } output := &PutComponentPolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPutComponentPolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponentPolicyOutput, 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 *PutComponentPolicyOutput if *v == nil { sv = &PutComponentPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "componentArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } sv.ComponentArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutContainerRecipePolicy struct { } func (*awsRestjson1_deserializeOpPutContainerRecipePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) 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, awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response, &metadata) } output := &PutContainerRecipePolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutContainerRecipePolicyOutput, 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 *PutContainerRecipePolicyOutput if *v == nil { sv = &PutContainerRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "containerRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) } sv.ContainerRecipeArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutImagePolicy struct { } func (*awsRestjson1_deserializeOpPutImagePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutImagePolicy) 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, awsRestjson1_deserializeOpErrorPutImagePolicy(response, &metadata) } output := &PutImagePolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPutImagePolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOutput, 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 *PutImagePolicyOutput if *v == nil { sv = &PutImagePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutImageRecipePolicy struct { } func (*awsRestjson1_deserializeOpPutImageRecipePolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) 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, awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response, &metadata) } output := &PutImageRecipePolicyOutput{} 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 = awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRecipePolicyOutput, 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 *PutImageRecipePolicyOutput if *v == nil { sv = &PutImageRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) } sv.ImageRecipeArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartImagePipelineExecution struct { } func (*awsRestjson1_deserializeOpStartImagePipelineExecution) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) 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, awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response, &metadata) } output := &StartImagePipelineExecutionOutput{} 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 = awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **StartImagePipelineExecutionOutput, 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 *StartImagePipelineExecutionOutput if *v == nil { sv = &StartImagePipelineExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_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, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_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, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateDistributionConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateDistributionConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) 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, awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response, &metadata) } output := &UpdateDistributionConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidParameterCombinationException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v **UpdateDistributionConfigurationOutput, 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 *UpdateDistributionConfigurationOutput if *v == nil { sv = &UpdateDistributionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "distributionConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) } sv.DistributionConfigurationArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateImagePipeline struct { } func (*awsRestjson1_deserializeOpUpdateImagePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateImagePipeline) 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, awsRestjson1_deserializeOpErrorUpdateImagePipeline(response, &metadata) } output := &UpdateImagePipelineOutput{} 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 = awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateImagePipeline(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImagePipelineOutput, 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 *UpdateImagePipelineOutput if *v == nil { sv = &UpdateImagePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } sv.ImagePipelineArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateInfrastructureConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) 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, awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response, &metadata) } output := &UpdateInfrastructureConfigurationOutput{} 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 = awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(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") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(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 len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v **UpdateInfrastructureConfigurationOutput, 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 *UpdateInfrastructureConfigurationOutput if *v == nil { sv = &UpdateInfrastructureConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) } sv.ClientToken = ptr.String(jtv) } case "infrastructureConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) } sv.InfrastructureConfigurationArn = ptr.String(jtv) } case "requestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorCallRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.CallRateLimitExceededException{} 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 } err := awsRestjson1_deserializeDocumentCallRateLimitExceededException(&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 awsRestjson1_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ClientException{} 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 } err := awsRestjson1_deserializeDocumentClientException(&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 awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ForbiddenException{} 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 } err := awsRestjson1_deserializeDocumentForbiddenException(&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 awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.IdempotentParameterMismatchException{} 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 } err := awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(&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 awsRestjson1_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidPaginationTokenException{} 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 } err := awsRestjson1_deserializeDocumentInvalidPaginationTokenException(&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 awsRestjson1_deserializeErrorInvalidParameterCombinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidParameterCombinationException{} 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 } err := awsRestjson1_deserializeDocumentInvalidParameterCombinationException(&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 awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidParameterException{} 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 } err := awsRestjson1_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 awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidParameterValueException{} 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 } err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&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 awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidRequestException{} 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 } err := awsRestjson1_deserializeDocumentInvalidRequestException(&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 awsRestjson1_deserializeErrorInvalidVersionNumberException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidVersionNumberException{} 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 } err := awsRestjson1_deserializeDocumentInvalidVersionNumberException(&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 awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceAlreadyExistsException{} 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 } err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&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 awsRestjson1_deserializeErrorResourceDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceDependencyException{} 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 } err := awsRestjson1_deserializeDocumentResourceDependencyException(&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 awsRestjson1_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceInUseException{} 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 } err := awsRestjson1_deserializeDocumentResourceInUseException(&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 awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} 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 } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&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 awsRestjson1_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceException{} 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 } err := awsRestjson1_deserializeDocumentServiceException(&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 awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} 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 } err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&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 awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} 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 } err := awsRestjson1_deserializeDocumentServiceUnavailableException(&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 awsRestjson1_deserializeDocumentAccountAggregation(v **types.AccountAggregation, 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.AccountAggregation if *v == nil { sv = &types.AccountAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountList(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 AccountId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(v **types.AdditionalInstanceConfiguration, 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.AdditionalInstanceConfiguration if *v == nil { sv = &types.AdditionalInstanceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "systemsManagerAgent": if err := awsRestjson1_deserializeDocumentSystemsManagerAgent(&sv.SystemsManagerAgent, value); err != nil { return err } case "userDataOverride": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserDataOverride to be of type string, got %T instead", value) } sv.UserDataOverride = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAmi(v **types.Ami, 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.Ami if *v == nil { sv = &types.Ami{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "image": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Image = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } case "state": if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiDistributionConfiguration, 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.AmiDistributionConfiguration if *v == nil { sv = &types.AmiDistributionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "amiTags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.AmiTags, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "launchPermission": if err := awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(&sv.LaunchPermission, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmiNameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "targetAccountIds": if err := awsRestjson1_deserializeDocumentAccountList(&sv.TargetAccountIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, 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.Ami if *v == nil { cv = []types.Ami{} } else { cv = *v } for _, value := range shape { var col types.Ami destAddr := &col if err := awsRestjson1_deserializeDocumentAmi(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.CallRateLimitExceededException, 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.CallRateLimitExceededException if *v == nil { sv = &types.CallRateLimitExceededException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, 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.ClientException if *v == nil { sv = &types.ClientException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponent(v **types.Component, 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.Component if *v == nil { sv = &types.Component{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "changeDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ChangeDescription = ptr.String(jtv) } case "data": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentData to be of type string, got %T instead", value) } sv.Data = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "obfuscate": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Obfuscate = jtv } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "parameters": if err := awsRestjson1_deserializeDocumentComponentParameterDetailList(&sv.Parameters, 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 = types.Platform(jtv) } case "publisher": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Publisher = ptr.String(jtv) } case "state": if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil { return err } case "supportedOsVersions": if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) } sv.Type = types.ComponentType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentConfiguration, 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.ComponentConfiguration if *v == nil { sv = &types.ComponentConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "componentArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentVersionArnOrBuildVersionArn to be of type string, got %T instead", value) } sv.ComponentArn = ptr.String(jtv) } case "parameters": if err := awsRestjson1_deserializeDocumentComponentParameterList(&sv.Parameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.ComponentConfiguration, 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.ComponentConfiguration if *v == nil { cv = []types.ComponentConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ComponentConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentComponentConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentComponentParameter(v **types.ComponentParameter, 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.ComponentParameter if *v == nil { sv = &types.ComponentParameter{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "value": if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentParameterDetail(v **types.ComponentParameterDetail, 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.ComponentParameterDetail if *v == nil { sv = &types.ComponentParameterDetail{} } else { sv = *v } for key, value := range shape { switch key { case "defaultValue": if err := awsRestjson1_deserializeDocumentComponentParameterValueList(&sv.DefaultValue, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentParameterDescription 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 ComponentParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentParameterType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentParameterDetailList(v *[]types.ComponentParameterDetail, 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.ComponentParameterDetail if *v == nil { cv = []types.ComponentParameterDetail{} } else { cv = *v } for _, value := range shape { var col types.ComponentParameterDetail destAddr := &col if err := awsRestjson1_deserializeDocumentComponentParameterDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentComponentParameterList(v *[]types.ComponentParameter, 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.ComponentParameter if *v == nil { cv = []types.ComponentParameter{} } else { cv = *v } for _, value := range shape { var col types.ComponentParameter destAddr := &col if err := awsRestjson1_deserializeDocumentComponentParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentComponentParameterValueList(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 ComponentParameterValue to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentComponentState(v **types.ComponentState, 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.ComponentState if *v == nil { sv = &types.ComponentState{} } else { sv = *v } for key, value := range shape { switch key { case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentStatus to be of type string, got %T instead", value) } sv.Status = types.ComponentStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, 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.ComponentSummary if *v == nil { sv = &types.ComponentSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "changeDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ChangeDescription = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "obfuscate": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Obfuscate = jtv } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } 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 = types.Platform(jtv) } case "publisher": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Publisher = ptr.String(jtv) } case "state": if err := awsRestjson1_deserializeDocumentComponentState(&sv.State, value); err != nil { return err } case "supportedOsVersions": if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) } sv.Type = types.ComponentType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSummary, 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.ComponentSummary if *v == nil { cv = []types.ComponentSummary{} } else { cv = *v } for _, value := range shape { var col types.ComponentSummary destAddr := &col if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion, 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.ComponentVersion if *v == nil { sv = &types.ComponentVersion{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } 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 = types.Platform(jtv) } case "supportedOsVersions": if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) } sv.Type = types.ComponentType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersion, 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.ComponentVersion if *v == nil { cv = []types.ComponentVersion{} } else { cv = *v } for _, value := range shape { var col types.ComponentVersion destAddr := &col if err := awsRestjson1_deserializeDocumentComponentVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentContainer(v **types.Container, 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.Container if *v == nil { sv = &types.Container{} } else { sv = *v } for key, value := range shape { switch key { case "imageUris": if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageUris, value); err != nil { return err } case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **types.ContainerDistributionConfiguration, 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.ContainerDistributionConfiguration if *v == nil { sv = &types.ContainerDistributionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "containerTags": if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "targetRepository": if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, 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.Container if *v == nil { cv = []types.Container{} } else { cv = *v } for _, value := range shape { var col types.Container destAddr := &col if err := awsRestjson1_deserializeDocumentContainer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, 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.ContainerRecipe if *v == nil { sv = &types.ContainerRecipe{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "components": if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { return err } case "containerType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) } sv.ContainerType = types.ContainerType(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "dockerfileTemplateData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DockerFileTemplate to be of type string, got %T instead", value) } sv.DockerfileTemplateData = ptr.String(jtv) } case "encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "instanceConfiguration": if err := awsRestjson1_deserializeDocumentInstanceConfiguration(&sv.InstanceConfiguration, value); err != nil { return err } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParentImage = ptr.String(jtv) } 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 = types.Platform(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "targetRepository": if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { return err } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } case "workingDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WorkingDirectory = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerRecipeSummary, 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.ContainerRecipeSummary if *v == nil { sv = &types.ContainerRecipeSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "containerType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) } sv.ContainerType = types.ContainerType(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParentImage = ptr.String(jtv) } 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 = types.Platform(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.ContainerRecipeSummary, 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.ContainerRecipeSummary if *v == nil { cv = []types.ContainerRecipeSummary{} } else { cv = *v } for _, value := range shape { var col types.ContainerRecipeSummary destAddr := &col if err := awsRestjson1_deserializeDocumentContainerRecipeSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_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 = ptr.Float64(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 = ptr.Float64(f64) default: return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value) } } case "scoringVector": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 := awsRestjson1_deserializeDocumentCvssScoreAdjustment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_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 := awsRestjson1_deserializeDocumentCvssScoreAdjustmentList(&sv.Adjustments, value); err != nil { return err } case "cvssSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CvssSource = ptr.String(jtv) } case "score": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Score = ptr.Float64(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 = ptr.Float64(f64) default: return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value) } } case "scoreSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 := awsRestjson1_deserializeDocumentCvssScore(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDistribution(v **types.Distribution, 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.Distribution if *v == nil { sv = &types.Distribution{} } else { sv = *v } for key, value := range shape { switch key { case "amiDistributionConfiguration": if err := awsRestjson1_deserializeDocumentAmiDistributionConfiguration(&sv.AmiDistributionConfiguration, value); err != nil { return err } case "containerDistributionConfiguration": if err := awsRestjson1_deserializeDocumentContainerDistributionConfiguration(&sv.ContainerDistributionConfiguration, value); err != nil { return err } case "fastLaunchConfigurations": if err := awsRestjson1_deserializeDocumentFastLaunchConfigurationList(&sv.FastLaunchConfigurations, value); err != nil { return err } case "launchTemplateConfigurations": if err := awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(&sv.LaunchTemplateConfigurations, value); err != nil { return err } case "licenseConfigurationArns": if err := awsRestjson1_deserializeDocumentLicenseConfigurationArnList(&sv.LicenseConfigurationArns, value); err != nil { return err } case "region": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Region = ptr.String(jtv) } case "s3ExportConfiguration": if err := awsRestjson1_deserializeDocumentS3ExportConfiguration(&sv.S3ExportConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDistributionConfiguration(v **types.DistributionConfiguration, 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.DistributionConfiguration if *v == nil { sv = &types.DistributionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateUpdated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "distributions": if err := awsRestjson1_deserializeDocumentDistributionList(&sv.Distributions, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "timeoutMinutes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected DistributionTimeoutMinutes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutMinutes = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types.DistributionConfigurationSummary, 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.DistributionConfigurationSummary if *v == nil { sv = &types.DistributionConfigurationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateUpdated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "regions": if err := awsRestjson1_deserializeDocumentRegionList(&sv.Regions, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(v *[]types.DistributionConfigurationSummary, 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.DistributionConfigurationSummary if *v == nil { cv = []types.DistributionConfigurationSummary{} } else { cv = *v } for _, value := range shape { var col types.DistributionConfigurationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDistributionList(v *[]types.Distribution, 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.Distribution if *v == nil { cv = []types.Distribution{} } else { cv = *v } for _, value := range shape { var col types.Distribution destAddr := &col if err := awsRestjson1_deserializeDocumentDistribution(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(v **types.EbsInstanceBlockDeviceSpecification, 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.EbsInstanceBlockDeviceSpecification if *v == nil { sv = &types.EbsInstanceBlockDeviceSpecification{} } else { sv = *v } for key, value := range shape { switch key { case "deleteOnTermination": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.DeleteOnTermination = ptr.Bool(jtv) } case "encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "iops": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EbsIopsInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Iops = ptr.Int32(int32(i64)) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "snapshotId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnapshotId = ptr.String(jtv) } case "throughput": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EbsVolumeThroughput to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Throughput = ptr.Int32(int32(i64)) } case "volumeSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected EbsVolumeSizeInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VolumeSize = ptr.Int32(int32(i64)) } case "volumeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EbsVolumeType to be of type string, got %T instead", value) } sv.VolumeType = types.EbsVolumeType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEcrConfiguration(v **types.EcrConfiguration, 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.EcrConfiguration if *v == nil { sv = &types.EcrConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "containerTags": if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil { return err } case "repositoryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RepositoryName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFastLaunchConfiguration(v **types.FastLaunchConfiguration, 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.FastLaunchConfiguration if *v == nil { sv = &types.FastLaunchConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "launchTemplate": if err := awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(&sv.LaunchTemplate, value); err != nil { return err } case "maxParallelLaunches": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxParallelLaunches to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxParallelLaunches = ptr.Int32(int32(i64)) } case "snapshotConfiguration": if err := awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(&sv.SnapshotConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFastLaunchConfigurationList(v *[]types.FastLaunchConfiguration, 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.FastLaunchConfiguration if *v == nil { cv = []types.FastLaunchConfiguration{} } else { cv = *v } for _, value := range shape { var col types.FastLaunchConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentFastLaunchConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFastLaunchLaunchTemplateSpecification(v **types.FastLaunchLaunchTemplateSpecification, 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.FastLaunchLaunchTemplateSpecification if *v == nil { sv = &types.FastLaunchLaunchTemplateSpecification{} } else { sv = *v } for key, value := range shape { switch key { case "launchTemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value) } sv.LaunchTemplateId = ptr.String(jtv) } case "launchTemplateName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateName = ptr.String(jtv) } case "launchTemplateVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.LaunchTemplateVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFastLaunchSnapshotConfiguration(v **types.FastLaunchSnapshotConfiguration, 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.FastLaunchSnapshotConfiguration if *v == nil { sv = &types.FastLaunchSnapshotConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "targetResourceCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TargetResourceCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TargetResourceCount = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, 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.ForbiddenException if *v == nil { sv = &types.ForbiddenException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, 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.IdempotentParameterMismatchException if *v == nil { sv = &types.IdempotentParameterMismatchException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "buildType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) } sv.BuildType = types.BuildType(jtv) } case "containerRecipe": if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil { return err } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "distributionConfiguration": if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil { return err } case "enhancedImageMetadataEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv) } case "imageRecipe": if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil { return err } case "imageScanningConfiguration": if err := awsRestjson1_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil { return err } case "imageSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) } sv.ImageSource = types.ImageSource(jtv) } case "imageTestsConfiguration": if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil { return err } case "infrastructureConfiguration": if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "osVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) } sv.OsVersion = ptr.String(jtv) } case "outputResources": if err := awsRestjson1_deserializeDocumentOutputResources(&sv.OutputResources, 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 = types.Platform(jtv) } case "scanState": if err := awsRestjson1_deserializeDocumentImageScanState(&sv.ScanState, value); err != nil { return err } case "sourcePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.SourcePipelineArn = ptr.String(jtv) } case "sourcePipelineName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.SourcePipelineName = ptr.String(jtv) } case "state": if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } sv.Type = types.ImageType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageAggregation(v **types.ImageAggregation, 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.ImageAggregation if *v == nil { sv = &types.ImageAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImagePackage(v **types.ImagePackage, 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.ImagePackage if *v == nil { sv = &types.ImagePackage{} } else { sv = *v } for key, value := range shape { switch key { case "packageName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PackageName = ptr.String(jtv) } case "packageVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.PackageVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImagePackageList(v *[]types.ImagePackage, 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.ImagePackage if *v == nil { cv = []types.ImagePackage{} } else { cv = *v } for _, value := range shape { var col types.ImagePackage destAddr := &col if err := awsRestjson1_deserializeDocumentImagePackage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, 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.ImagePipeline if *v == nil { sv = &types.ImagePipeline{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "containerRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ContainerRecipeArn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "dateLastRun": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateLastRun = ptr.String(jtv) } case "dateNextRun": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateNextRun = ptr.String(jtv) } case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateUpdated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "distributionConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DistributionConfigurationArn = ptr.String(jtv) } case "enhancedImageMetadataEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.EnhancedImageMetadataEnabled = ptr.Bool(jtv) } case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ImageRecipeArn = ptr.String(jtv) } case "imageScanningConfiguration": if err := awsRestjson1_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil { return err } case "imageTestsConfiguration": if err := awsRestjson1_deserializeDocumentImageTestsConfiguration(&sv.ImageTestsConfiguration, value); err != nil { return err } case "infrastructureConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.InfrastructureConfigurationArn = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } 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 = types.Platform(jtv) } case "schedule": if err := awsRestjson1_deserializeDocumentSchedule(&sv.Schedule, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipelineStatus to be of type string, got %T instead", value) } sv.Status = types.PipelineStatus(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImagePipelineAggregation(v **types.ImagePipelineAggregation, 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.ImagePipelineAggregation if *v == nil { sv = &types.ImagePipelineAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } sv.ImagePipelineArn = ptr.String(jtv) } case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImagePipelineList(v *[]types.ImagePipeline, 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.ImagePipeline if *v == nil { cv = []types.ImagePipeline{} } else { cv = *v } for _, value := range shape { var col types.ImagePipeline destAddr := &col if err := awsRestjson1_deserializeDocumentImagePipeline(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, 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.ImageRecipe if *v == nil { sv = &types.ImageRecipe{} } else { sv = *v } for key, value := range shape { switch key { case "additionalInstanceConfiguration": if err := awsRestjson1_deserializeDocumentAdditionalInstanceConfiguration(&sv.AdditionalInstanceConfiguration, value); err != nil { return err } case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "blockDeviceMappings": if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil { return err } case "components": if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { return err } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParentImage = ptr.String(jtv) } 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 = types.Platform(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } sv.Type = types.ImageType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } case "workingDirectory": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.WorkingDirectory = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageRecipeSummary(v **types.ImageRecipeSummary, 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.ImageRecipeSummary if *v == nil { sv = &types.ImageRecipeSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ParentImage = ptr.String(jtv) } 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 = types.Platform(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageRecipeSummaryList(v *[]types.ImageRecipeSummary, 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.ImageRecipeSummary if *v == nil { cv = []types.ImageRecipeSummary{} } else { cv = *v } for _, value := range shape { var col types.ImageRecipeSummary destAddr := &col if err := awsRestjson1_deserializeDocumentImageRecipeSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_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 "awsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Description = 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 DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "fixAvailable": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FixAvailable = ptr.String(jtv) } case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } sv.ImageBuildVersionArn = ptr.String(jtv) } case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } sv.ImagePipelineArn = ptr.String(jtv) } case "inspectorScore": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.InspectorScore = ptr.Float64(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.InspectorScore = ptr.Float64(f64) default: return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value) } } case "inspectorScoreDetails": if err := awsRestjson1_deserializeDocumentInspectorScoreDetails(&sv.InspectorScoreDetails, value); err != nil { return err } case "packageVulnerabilityDetails": if err := awsRestjson1_deserializeDocumentPackageVulnerabilityDetails(&sv.PackageVulnerabilityDetails, value); err != nil { return err } case "remediation": if err := awsRestjson1_deserializeDocumentRemediation(&sv.Remediation, value); err != nil { return err } case "severity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Severity = ptr.String(jtv) } case "title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString 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 DateTimeTimestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageScanFindingAggregation(v **types.ImageScanFindingAggregation, 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.ImageScanFindingAggregation if *v == nil { sv = &types.ImageScanFindingAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "accountAggregation": if err := awsRestjson1_deserializeDocumentAccountAggregation(&sv.AccountAggregation, value); err != nil { return err } case "imageAggregation": if err := awsRestjson1_deserializeDocumentImageAggregation(&sv.ImageAggregation, value); err != nil { return err } case "imagePipelineAggregation": if err := awsRestjson1_deserializeDocumentImagePipelineAggregation(&sv.ImagePipelineAggregation, value); err != nil { return err } case "vulnerabilityIdAggregation": if err := awsRestjson1_deserializeDocumentVulnerabilityIdAggregation(&sv.VulnerabilityIdAggregation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageScanFindingAggregationsList(v *[]types.ImageScanFindingAggregation, 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.ImageScanFindingAggregation if *v == nil { cv = []types.ImageScanFindingAggregation{} } else { cv = *v } for _, value := range shape { var col types.ImageScanFindingAggregation destAddr := &col if err := awsRestjson1_deserializeDocumentImageScanFindingAggregation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImageScanFindingsList(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 := awsRestjson1_deserializeDocumentImageScanFinding(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_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 "ecrConfiguration": if err := awsRestjson1_deserializeDocumentEcrConfiguration(&sv.EcrConfiguration, value); err != nil { return err } case "imageScanningEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.ImageScanningEnabled = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageScanState(v **types.ImageScanState, 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.ImageScanState if *v == nil { sv = &types.ImageScanState{} } else { sv = *v } for key, value := range shape { switch key { case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageScanStatus to be of type string, got %T instead", value) } sv.Status = types.ImageScanStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageState(v **types.ImageState, 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.ImageState if *v == nil { sv = &types.ImageState{} } else { sv = *v } for key, value := range shape { switch key { case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageStatus to be of type string, got %T instead", value) } sv.Status = types.ImageStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, 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.ImageSummary if *v == nil { sv = &types.ImageSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "buildType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) } sv.BuildType = types.BuildType(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "imageSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) } sv.ImageSource = types.ImageSource(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "osVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) } sv.OsVersion = ptr.String(jtv) } case "outputResources": if err := awsRestjson1_deserializeDocumentOutputResources(&sv.OutputResources, value); err != nil { return err } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } 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 = types.Platform(jtv) } case "state": if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } sv.Type = types.ImageType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageSummaryList(v *[]types.ImageSummary, 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.ImageSummary if *v == nil { cv = []types.ImageSummary{} } else { cv = *v } for _, value := range shape { var col types.ImageSummary destAddr := &col if err := awsRestjson1_deserializeDocumentImageSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentImageTestsConfiguration(v **types.ImageTestsConfiguration, 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.ImageTestsConfiguration if *v == nil { sv = &types.ImageTestsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "imageTestsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.ImageTestsEnabled = ptr.Bool(jtv) } case "timeoutMinutes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ImageTestsTimeoutMinutes to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimeoutMinutes = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, 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.ImageVersion if *v == nil { sv = &types.ImageVersion{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "buildType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BuildType to be of type string, got %T instead", value) } sv.BuildType = types.BuildType(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "imageSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageSource to be of type string, got %T instead", value) } sv.ImageSource = types.ImageSource(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "osVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OsVersion to be of type string, got %T instead", value) } sv.OsVersion = ptr.String(jtv) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } 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 = types.Platform(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) } sv.Type = types.ImageType(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentImageVersionList(v *[]types.ImageVersion, 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.ImageVersion if *v == nil { cv = []types.ImageVersion{} } else { cv = *v } for _, value := range shape { var col types.ImageVersion destAddr := &col if err := awsRestjson1_deserializeDocumentImageVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInfrastructureConfiguration(v **types.InfrastructureConfiguration, 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.InfrastructureConfiguration if *v == nil { sv = &types.InfrastructureConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateUpdated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "instanceMetadataOptions": if err := awsRestjson1_deserializeDocumentInstanceMetadataOptions(&sv.InstanceMetadataOptions, value); err != nil { return err } case "instanceProfileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value) } sv.InstanceProfileName = ptr.String(jtv) } case "instanceTypes": if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil { return err } case "keyPair": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.KeyPair = ptr.String(jtv) } case "logging": if err := awsRestjson1_deserializeDocumentLogging(&sv.Logging, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "resourceTags": if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil { return err } case "securityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { return err } case "snsTopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SnsTopicArn = ptr.String(jtv) } case "subnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.SubnetId = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "terminateInstanceOnFailure": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.TerminateInstanceOnFailure = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(v **types.InfrastructureConfigurationSummary, 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.InfrastructureConfigurationSummary if *v == nil { sv = &types.InfrastructureConfigurationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateCreated = ptr.String(jtv) } case "dateUpdated": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.DateUpdated = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "instanceProfileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceProfileNameType to be of type string, got %T instead", value) } sv.InstanceProfileName = ptr.String(jtv) } case "instanceTypes": if err := awsRestjson1_deserializeDocumentInstanceTypeList(&sv.InstanceTypes, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "resourceTags": if err := awsRestjson1_deserializeDocumentResourceTagMap(&sv.ResourceTags, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(v *[]types.InfrastructureConfigurationSummary, 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.InfrastructureConfigurationSummary if *v == nil { cv = []types.InfrastructureConfigurationSummary{} } else { cv = *v } for _, value := range shape { var col types.InfrastructureConfigurationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInspectorScoreDetails(v **types.InspectorScoreDetails, 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.InspectorScoreDetails if *v == nil { sv = &types.InspectorScoreDetails{} } else { sv = *v } for key, value := range shape { switch key { case "adjustedCvss": if err := awsRestjson1_deserializeDocumentCvssScoreDetails(&sv.AdjustedCvss, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(v **types.InstanceBlockDeviceMapping, 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.InstanceBlockDeviceMapping if *v == nil { sv = &types.InstanceBlockDeviceMapping{} } else { sv = *v } for key, value := range shape { switch key { case "deviceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.DeviceName = ptr.String(jtv) } case "ebs": if err := awsRestjson1_deserializeDocumentEbsInstanceBlockDeviceSpecification(&sv.Ebs, value); err != nil { return err } case "noDevice": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EmptyString to be of type string, got %T instead", value) } sv.NoDevice = ptr.String(jtv) } case "virtualName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VirtualName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(v *[]types.InstanceBlockDeviceMapping, 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.InstanceBlockDeviceMapping if *v == nil { cv = []types.InstanceBlockDeviceMapping{} } else { cv = *v } for _, value := range shape { var col types.InstanceBlockDeviceMapping destAddr := &col if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMapping(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInstanceConfiguration(v **types.InstanceConfiguration, 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.InstanceConfiguration if *v == nil { sv = &types.InstanceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "blockDeviceMappings": if err := awsRestjson1_deserializeDocumentInstanceBlockDeviceMappings(&sv.BlockDeviceMappings, value); err != nil { return err } case "image": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Image = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceMetadataOptions(v **types.InstanceMetadataOptions, 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.InstanceMetadataOptions if *v == nil { sv = &types.InstanceMetadataOptions{} } else { sv = *v } for key, value := range shape { switch key { case "httpPutResponseHopLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected HttpPutResponseHopLimit to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.HttpPutResponseHopLimit = ptr.Int32(int32(i64)) } case "httpTokens": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HttpTokens to be of type string, got %T instead", value) } sv.HttpTokens = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInstanceTypeList(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 InstanceType to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, 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.InvalidPaginationTokenException if *v == nil { sv = &types.InvalidPaginationTokenException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidParameterCombinationException(v **types.InvalidParameterCombinationException, 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.InvalidParameterCombinationException if *v == nil { sv = &types.InvalidParameterCombinationException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, 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.InvalidParameterValueException if *v == nil { sv = &types.InvalidParameterValueException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, 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.InvalidRequestException if *v == nil { sv = &types.InvalidRequestException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidVersionNumberException(v **types.InvalidVersionNumberException, 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.InvalidVersionNumberException if *v == nil { sv = &types.InvalidVersionNumberException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(v **types.LaunchPermissionConfiguration, 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.LaunchPermissionConfiguration if *v == nil { sv = &types.LaunchPermissionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "organizationalUnitArns": if err := awsRestjson1_deserializeDocumentOrganizationalUnitArnList(&sv.OrganizationalUnitArns, value); err != nil { return err } case "organizationArns": if err := awsRestjson1_deserializeDocumentOrganizationArnList(&sv.OrganizationArns, value); err != nil { return err } case "userGroups": if err := awsRestjson1_deserializeDocumentStringList(&sv.UserGroups, value); err != nil { return err } case "userIds": if err := awsRestjson1_deserializeDocumentAccountList(&sv.UserIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(v **types.LaunchTemplateConfiguration, 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.LaunchTemplateConfiguration if *v == nil { sv = &types.LaunchTemplateConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "accountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) } sv.AccountId = ptr.String(jtv) } case "launchTemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LaunchTemplateId to be of type string, got %T instead", value) } sv.LaunchTemplateId = ptr.String(jtv) } case "setDefaultVersion": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.SetDefaultVersion = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchTemplateConfigurationList(v *[]types.LaunchTemplateConfiguration, 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.LaunchTemplateConfiguration if *v == nil { cv = []types.LaunchTemplateConfiguration{} } else { cv = *v } for _, value := range shape { var col types.LaunchTemplateConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentLaunchTemplateConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLicenseConfigurationArnList(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 LicenseConfigurationArn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLogging(v **types.Logging, 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.Logging if *v == nil { sv = &types.Logging{} } else { sv = *v } for key, value := range shape { switch key { case "s3Logs": if err := awsRestjson1_deserializeDocumentS3Logs(&sv.S3Logs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNonEmptyStringList(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOrganizationalUnitArnList(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 OrganizationalUnitArn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOrganizationArnList(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 OrganizationArn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOsVersionList(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 OsVersion to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, 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.OutputResources if *v == nil { sv = &types.OutputResources{} } else { sv = *v } for key, value := range shape { switch key { case "amis": if err := awsRestjson1_deserializeDocumentAmiList(&sv.Amis, value); err != nil { return err } case "containers": if err := awsRestjson1_deserializeDocumentContainerList(&sv.Containers, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_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 := awsRestjson1_deserializeDocumentCvssScoreList(&sv.Cvss, value); err != nil { return err } case "referenceUrls": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ReferenceUrls, value); err != nil { return err } case "relatedVulnerabilities": if err := awsRestjson1_deserializeDocumentVulnerabilityIdList(&sv.RelatedVulnerabilities, value); err != nil { return err } case "source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString 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 DateTimeTimestamp to be a JSON Number, got %T instead", value) } } case "vendorSeverity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 DateTimeTimestamp 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 := awsRestjson1_deserializeDocumentVulnerablePackageList(&sv.VulnerablePackages, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRegionList(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_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 := awsRestjson1_deserializeDocumentRemediationRecommendation(&sv.Recommendation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRemediationRecommendation(v **types.RemediationRecommendation, 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.RemediationRecommendation if *v == nil { sv = &types.RemediationRecommendation{} } 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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, 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.ResourceAlreadyExistsException if *v == nil { sv = &types.ResourceAlreadyExistsException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceDependencyException(v **types.ResourceDependencyException, 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.ResourceDependencyException if *v == nil { sv = &types.ResourceDependencyException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, 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.ResourceInUseException if *v == nil { sv = &types.ResourceInUseException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, 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.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceTagMap(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 awsRestjson1_deserializeDocumentS3ExportConfiguration(v **types.S3ExportConfiguration, 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.S3ExportConfiguration if *v == nil { sv = &types.S3ExportConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "diskImageFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DiskImageFormat to be of type string, got %T instead", value) } sv.DiskImageFormat = types.DiskImageFormat(jtv) } case "roleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "s3Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3Bucket = ptr.String(jtv) } case "s3Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3Logs(v **types.S3Logs, 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.S3Logs if *v == nil { sv = &types.S3Logs{} } else { sv = *v } for key, value := range shape { switch key { case "s3BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3BucketName = ptr.String(jtv) } case "s3KeyPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.S3KeyPrefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, 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.Schedule if *v == nil { sv = &types.Schedule{} } else { sv = *v } for key, value := range shape { switch key { case "pipelineExecutionStartCondition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PipelineExecutionStartCondition to be of type string, got %T instead", value) } sv.PipelineExecutionStartCondition = types.PipelineExecutionStartCondition(jtv) } case "scheduleExpression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.ScheduleExpression = ptr.String(jtv) } case "timezone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Timezone to be of type string, got %T instead", value) } sv.Timezone = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroupIds(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException, 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.ServiceException if *v == nil { sv = &types.ServiceException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } 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 ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSeverityCounts(v **types.SeverityCounts, 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.SeverityCounts if *v == nil { sv = &types.SeverityCounts{} } else { sv = *v } for key, value := range shape { switch key { case "all": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.All = ptr.Int64(i64) } case "critical": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Critical = ptr.Int64(i64) } case "high": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.High = ptr.Int64(i64) } case "medium": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SeverityCountNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Medium = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringList(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSystemsManagerAgent(v **types.SystemsManagerAgent, 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.SystemsManagerAgent if *v == nil { sv = &types.SystemsManagerAgent{} } else { sv = *v } for key, value := range shape { switch key { case "uninstallAfterBuild": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.UninstallAfterBuild = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagMap(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 awsRestjson1_deserializeDocumentTargetContainerRepository(v **types.TargetContainerRepository, 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.TargetContainerRepository if *v == nil { sv = &types.TargetContainerRepository{} } else { sv = *v } for key, value := range shape { switch key { case "repositoryName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RepositoryName = ptr.String(jtv) } case "service": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContainerRepositoryService to be of type string, got %T instead", value) } sv.Service = types.ContainerRepositoryService(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVulnerabilityIdAggregation(v **types.VulnerabilityIdAggregation, 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.VulnerabilityIdAggregation if *v == nil { sv = &types.VulnerabilityIdAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "severityCounts": if err := awsRestjson1_deserializeDocumentSeverityCounts(&sv.SeverityCounts, value); err != nil { return err } case "vulnerabilityId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.VulnerabilityId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVulnerabilityIdList(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 VulnerabilityId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_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 PackageArchitecture 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 PackageEpoch 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 NonEmptyString to be of type string, got %T instead", value) } sv.FilePath = ptr.String(jtv) } case "fixedInVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.FixedInVersion = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString 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 NonEmptyString 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 NonEmptyString to be of type string, got %T instead", value) } sv.Release = ptr.String(jtv) } case "remediation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Remediation = 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 NonEmptyString to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVulnerablePackageList(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 := awsRestjson1_deserializeDocumentVulnerablePackage(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorkflowExecutionMetadata(v **types.WorkflowExecutionMetadata, 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.WorkflowExecutionMetadata if *v == nil { sv = &types.WorkflowExecutionMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "endTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.EndTime = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "startTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.StartTime = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.WorkflowExecutionStatus(jtv) } case "totalStepCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepCount = int32(i64) } case "totalStepsFailed": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepsFailed = int32(i64) } case "totalStepsSkipped": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepsSkipped = int32(i64) } case "totalStepsSucceeded": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WorkflowStepCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalStepsSucceeded = int32(i64) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowType to be of type string, got %T instead", value) } sv.Type = types.WorkflowType(jtv) } case "workflowBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowBuildVersionArn to be of type string, got %T instead", value) } sv.WorkflowBuildVersionArn = ptr.String(jtv) } case "workflowExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowExecutionId to be of type string, got %T instead", value) } sv.WorkflowExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkflowExecutionsList(v *[]types.WorkflowExecutionMetadata, 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.WorkflowExecutionMetadata if *v == nil { cv = []types.WorkflowExecutionMetadata{} } else { cv = *v } for _, value := range shape { var col types.WorkflowExecutionMetadata destAddr := &col if err := awsRestjson1_deserializeDocumentWorkflowExecutionMetadata(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorkflowStepExecutionsList(v *[]types.WorkflowStepMetadata, 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.WorkflowStepMetadata if *v == nil { cv = []types.WorkflowStepMetadata{} } else { cv = *v } for _, value := range shape { var col types.WorkflowStepMetadata destAddr := &col if err := awsRestjson1_deserializeDocumentWorkflowStepMetadata(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWorkflowStepMetadata(v **types.WorkflowStepMetadata, 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.WorkflowStepMetadata if *v == nil { sv = &types.WorkflowStepMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "action": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepAction to be of type string, got %T instead", value) } sv.Action = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "endTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.EndTime = ptr.String(jtv) } case "inputs": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepInputs to be of type string, got %T instead", value) } sv.Inputs = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "outputs": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepOutputs to be of type string, got %T instead", value) } sv.Outputs = ptr.String(jtv) } case "rollbackStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepExecutionRollbackStatus to be of type string, got %T instead", value) } sv.RollbackStatus = types.WorkflowStepExecutionRollbackStatus(jtv) } case "startTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } sv.StartTime = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.WorkflowStepExecutionStatus(jtv) } case "stepExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkflowStepExecutionId to be of type string, got %T instead", value) } sv.StepExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }