// Code generated by smithy-go-codegen DO NOT EDIT. package serverlessapplicationrepository import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/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" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strings" ) type awsRestjson1_deserializeOpCreateApplication struct { } func (*awsRestjson1_deserializeOpCreateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateApplication) 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_deserializeOpErrorCreateApplication(response, &metadata) } output := &CreateApplicationOutput{} 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_deserializeOpDocumentCreateApplicationOutput(&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_deserializeOpErrorCreateApplication(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateApplicationOutput if *v == nil { sv = &CreateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "author": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Author = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "homePageUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HomePageUrl = ptr.String(jtv) } case "isVerifiedAuthor": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.IsVerifiedAuthor = jtv } case "labels": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil { return err } case "licenseUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.LicenseUrl = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "readmeUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ReadmeUrl = ptr.String(jtv) } case "spdxLicenseId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SpdxLicenseId = ptr.String(jtv) } case "verifiedAuthorUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VerifiedAuthorUrl = ptr.String(jtv) } case "version": if err := awsRestjson1_deserializeDocumentVersion(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateApplicationVersion struct { } func (*awsRestjson1_deserializeOpCreateApplicationVersion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateApplicationVersion) 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_deserializeOpErrorCreateApplicationVersion(response, &metadata) } output := &CreateApplicationVersionOutput{} 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_deserializeOpDocumentCreateApplicationVersionOutput(&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_deserializeOpErrorCreateApplicationVersion(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateApplicationVersionOutput(v **CreateApplicationVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateApplicationVersionOutput if *v == nil { sv = &CreateApplicationVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "parameterDefinitions": if err := awsRestjson1_deserializeDocument__listOfParameterDefinition(&sv.ParameterDefinitions, value); err != nil { return err } case "requiredCapabilities": if err := awsRestjson1_deserializeDocument__listOfCapability(&sv.RequiredCapabilities, value); err != nil { return err } case "resourcesSupported": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.ResourcesSupported = jtv } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } case "sourceCodeArchiveUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SourceCodeArchiveUrl = ptr.String(jtv) } case "sourceCodeUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SourceCodeUrl = ptr.String(jtv) } case "templateUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TemplateUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateCloudFormationChangeSet struct { } func (*awsRestjson1_deserializeOpCreateCloudFormationChangeSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCloudFormationChangeSet) 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_deserializeOpErrorCreateCloudFormationChangeSet(response, &metadata) } output := &CreateCloudFormationChangeSetOutput{} 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_deserializeOpDocumentCreateCloudFormationChangeSetOutput(&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_deserializeOpErrorCreateCloudFormationChangeSet(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateCloudFormationChangeSetOutput(v **CreateCloudFormationChangeSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateCloudFormationChangeSetOutput if *v == nil { sv = &CreateCloudFormationChangeSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "changeSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ChangeSetId = ptr.String(jtv) } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } case "stackId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.StackId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateCloudFormationTemplate struct { } func (*awsRestjson1_deserializeOpCreateCloudFormationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCloudFormationTemplate) 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_deserializeOpErrorCreateCloudFormationTemplate(response, &metadata) } output := &CreateCloudFormationTemplateOutput{} 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_deserializeOpDocumentCreateCloudFormationTemplateOutput(&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_deserializeOpErrorCreateCloudFormationTemplate(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateCloudFormationTemplateOutput(v **CreateCloudFormationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateCloudFormationTemplateOutput if *v == nil { sv = &CreateCloudFormationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "expirationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ExpirationTime = ptr.String(jtv) } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } case "templateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } case "templateUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TemplateUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteApplication struct { } func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteApplication) 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_deserializeOpErrorDeleteApplication(response, &metadata) } output := &DeleteApplicationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteApplication(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpGetApplication struct { } func (*awsRestjson1_deserializeOpGetApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetApplication) 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_deserializeOpErrorGetApplication(response, &metadata) } output := &GetApplicationOutput{} 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_deserializeOpDocumentGetApplicationOutput(&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_deserializeOpErrorGetApplication(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetApplicationOutput if *v == nil { sv = &GetApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "author": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Author = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "homePageUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HomePageUrl = ptr.String(jtv) } case "isVerifiedAuthor": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.IsVerifiedAuthor = jtv } case "labels": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil { return err } case "licenseUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.LicenseUrl = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "readmeUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ReadmeUrl = ptr.String(jtv) } case "spdxLicenseId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SpdxLicenseId = ptr.String(jtv) } case "verifiedAuthorUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VerifiedAuthorUrl = ptr.String(jtv) } case "version": if err := awsRestjson1_deserializeDocumentVersion(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetApplicationPolicy struct { } func (*awsRestjson1_deserializeOpGetApplicationPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetApplicationPolicy) 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_deserializeOpErrorGetApplicationPolicy(response, &metadata) } output := &GetApplicationPolicyOutput{} 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_deserializeOpDocumentGetApplicationPolicyOutput(&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_deserializeOpErrorGetApplicationPolicy(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetApplicationPolicyOutput(v **GetApplicationPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetApplicationPolicyOutput if *v == nil { sv = &GetApplicationPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "statements": if err := awsRestjson1_deserializeDocument__listOfApplicationPolicyStatement(&sv.Statements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetCloudFormationTemplate struct { } func (*awsRestjson1_deserializeOpGetCloudFormationTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetCloudFormationTemplate) 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_deserializeOpErrorGetCloudFormationTemplate(response, &metadata) } output := &GetCloudFormationTemplateOutput{} 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_deserializeOpDocumentGetCloudFormationTemplateOutput(&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_deserializeOpErrorGetCloudFormationTemplate(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetCloudFormationTemplateOutput(v **GetCloudFormationTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetCloudFormationTemplateOutput if *v == nil { sv = &GetCloudFormationTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "expirationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ExpirationTime = ptr.String(jtv) } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Status to be of type string, got %T instead", value) } sv.Status = types.Status(jtv) } case "templateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } case "templateUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TemplateUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListApplicationDependencies struct { } func (*awsRestjson1_deserializeOpListApplicationDependencies) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplicationDependencies) 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_deserializeOpErrorListApplicationDependencies(response, &metadata) } output := &ListApplicationDependenciesOutput{} 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_deserializeOpDocumentListApplicationDependenciesOutput(&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_deserializeOpErrorListApplicationDependencies(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationDependenciesOutput(v **ListApplicationDependenciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListApplicationDependenciesOutput if *v == nil { sv = &ListApplicationDependenciesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "dependencies": if err := awsRestjson1_deserializeDocument__listOfApplicationDependencySummary(&sv.Dependencies, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListApplications struct { } func (*awsRestjson1_deserializeOpListApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplications) 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_deserializeOpErrorListApplications(response, &metadata) } output := &ListApplicationsOutput{} 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_deserializeOpDocumentListApplicationsOutput(&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_deserializeOpErrorListApplications(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListApplicationsOutput if *v == nil { sv = &ListApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applications": if err := awsRestjson1_deserializeDocument__listOfApplicationSummary(&sv.Applications, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListApplicationVersions struct { } func (*awsRestjson1_deserializeOpListApplicationVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplicationVersions) 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_deserializeOpErrorListApplicationVersions(response, &metadata) } output := &ListApplicationVersionsOutput{} 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_deserializeOpDocumentListApplicationVersionsOutput(&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_deserializeOpErrorListApplicationVersions(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationVersionsOutput(v **ListApplicationVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListApplicationVersionsOutput if *v == nil { sv = &ListApplicationVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "versions": if err := awsRestjson1_deserializeDocument__listOfVersionSummary(&sv.Versions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutApplicationPolicy struct { } func (*awsRestjson1_deserializeOpPutApplicationPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutApplicationPolicy) 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_deserializeOpErrorPutApplicationPolicy(response, &metadata) } output := &PutApplicationPolicyOutput{} 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_deserializeOpDocumentPutApplicationPolicyOutput(&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_deserializeOpErrorPutApplicationPolicy(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutApplicationPolicyOutput(v **PutApplicationPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutApplicationPolicyOutput if *v == nil { sv = &PutApplicationPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "statements": if err := awsRestjson1_deserializeDocument__listOfApplicationPolicyStatement(&sv.Statements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUnshareApplication struct { } func (*awsRestjson1_deserializeOpUnshareApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUnshareApplication) 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_deserializeOpErrorUnshareApplication(response, &metadata) } output := &UnshareApplicationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUnshareApplication(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateApplication struct { } func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateApplication) 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_deserializeOpErrorUpdateApplication(response, &metadata) } output := &UpdateApplicationOutput{} 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_deserializeOpDocumentUpdateApplicationOutput(&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_deserializeOpErrorUpdateApplication(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateApplicationOutput if *v == nil { sv = &UpdateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "author": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Author = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "homePageUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HomePageUrl = ptr.String(jtv) } case "isVerifiedAuthor": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.IsVerifiedAuthor = jtv } case "labels": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil { return err } case "licenseUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.LicenseUrl = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "readmeUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ReadmeUrl = ptr.String(jtv) } case "spdxLicenseId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SpdxLicenseId = ptr.String(jtv) } case "verifiedAuthorUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VerifiedAuthorUrl = ptr.String(jtv) } case "version": if err := awsRestjson1_deserializeDocumentVersion(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} 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_deserializeDocumentBadRequestException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} 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_deserializeDocumentConflictException(&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_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerErrorException{} 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_deserializeDocumentInternalServerErrorException(&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_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} 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_deserializeDocumentNotFoundException(&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_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyRequestsException{} 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_deserializeDocumentTooManyRequestsException(&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_deserializeDocument__listOf__string(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 __string to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfApplicationDependencySummary(v *[]types.ApplicationDependencySummary, 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.ApplicationDependencySummary if *v == nil { cv = []types.ApplicationDependencySummary{} } else { cv = *v } for _, value := range shape { var col types.ApplicationDependencySummary destAddr := &col if err := awsRestjson1_deserializeDocumentApplicationDependencySummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfApplicationPolicyStatement(v *[]types.ApplicationPolicyStatement, 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.ApplicationPolicyStatement if *v == nil { cv = []types.ApplicationPolicyStatement{} } else { cv = *v } for _, value := range shape { var col types.ApplicationPolicyStatement destAddr := &col if err := awsRestjson1_deserializeDocumentApplicationPolicyStatement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfApplicationSummary(v *[]types.ApplicationSummary, 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.ApplicationSummary if *v == nil { cv = []types.ApplicationSummary{} } else { cv = *v } for _, value := range shape { var col types.ApplicationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentApplicationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfCapability(v *[]types.Capability, 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.Capability if *v == nil { cv = []types.Capability{} } else { cv = *v } for _, value := range shape { var col types.Capability if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Capability to be of type string, got %T instead", value) } col = types.Capability(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfParameterDefinition(v *[]types.ParameterDefinition, 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.ParameterDefinition if *v == nil { cv = []types.ParameterDefinition{} } else { cv = *v } for _, value := range shape { var col types.ParameterDefinition destAddr := &col if err := awsRestjson1_deserializeDocumentParameterDefinition(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfVersionSummary(v *[]types.VersionSummary, 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.VersionSummary if *v == nil { cv = []types.VersionSummary{} } else { cv = *v } for _, value := range shape { var col types.VersionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentVersionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentApplicationDependencySummary(v **types.ApplicationDependencySummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ApplicationDependencySummary if *v == nil { sv = &types.ApplicationDependencySummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationPolicyStatement(v **types.ApplicationPolicyStatement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ApplicationPolicyStatement if *v == nil { sv = &types.ApplicationPolicyStatement{} } else { sv = *v } for key, value := range shape { switch key { case "actions": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Actions, value); err != nil { return err } case "principalOrgIDs": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.PrincipalOrgIDs, value); err != nil { return err } case "principals": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Principals, value); err != nil { return err } case "statementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.StatementId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ApplicationSummary if *v == nil { sv = &types.ApplicationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "author": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Author = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "homePageUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.HomePageUrl = ptr.String(jtv) } case "labels": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "spdxLicenseId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SpdxLicenseId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } 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 "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerErrorException(v **types.InternalServerErrorException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InternalServerErrorException if *v == nil { sv = &types.InternalServerErrorException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NotFoundException if *v == nil { sv = &types.NotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterDefinition(v **types.ParameterDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterDefinition if *v == nil { sv = &types.ParameterDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "allowedPattern": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.AllowedPattern = ptr.String(jtv) } case "allowedValues": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.AllowedValues, value); err != nil { return err } case "constraintDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConstraintDescription = ptr.String(jtv) } case "defaultValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.DefaultValue = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "maxLength": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxLength = int32(i64) } case "maxValue": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxValue = int32(i64) } case "minLength": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MinLength = int32(i64) } case "minValue": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MinValue = int32(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "noEcho": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.NoEcho = jtv } case "referencedByResources": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.ReferencedByResources, value); err != nil { return err } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TooManyRequestsException if *v == nil { sv = &types.TooManyRequestsException{} } else { sv = *v } for key, value := range shape { switch key { case "errorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorCode_ = ptr.String(jtv) } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVersion(v **types.Version, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Version if *v == nil { sv = &types.Version{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "parameterDefinitions": if err := awsRestjson1_deserializeDocument__listOfParameterDefinition(&sv.ParameterDefinitions, value); err != nil { return err } case "requiredCapabilities": if err := awsRestjson1_deserializeDocument__listOfCapability(&sv.RequiredCapabilities, value); err != nil { return err } case "resourcesSupported": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.ResourcesSupported = jtv } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } case "sourceCodeArchiveUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SourceCodeArchiveUrl = ptr.String(jtv) } case "sourceCodeUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SourceCodeUrl = ptr.String(jtv) } case "templateUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TemplateUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVersionSummary(v **types.VersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VersionSummary if *v == nil { sv = &types.VersionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CreationTime = ptr.String(jtv) } case "semanticVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SemanticVersion = ptr.String(jtv) } case "sourceCodeUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SourceCodeUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }