// Code generated by smithy-go-codegen DO NOT EDIT. package quicksight import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/quicksight/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" "strings" "time" ) type awsRestjson1_deserializeOpCancelIngestion struct { } func (*awsRestjson1_deserializeOpCancelIngestion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelIngestion) 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_deserializeOpErrorCancelIngestion(response, &metadata) } output := &CancelIngestionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCancelIngestionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCancelIngestionOutput(&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_deserializeOpErrorCancelIngestion(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCancelIngestionOutput(v *CancelIngestionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCancelIngestionOutput(v **CancelIngestionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CancelIngestionOutput if *v == nil { sv = &CancelIngestionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "IngestionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionId to be of type string, got %T instead", value) } sv.IngestionId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateAccountCustomization struct { } func (*awsRestjson1_deserializeOpCreateAccountCustomization) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateAccountCustomization) 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_deserializeOpErrorCreateAccountCustomization(response, &metadata) } output := &CreateAccountCustomizationOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateAccountCustomizationOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateAccountCustomizationOutput(&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_deserializeOpErrorCreateAccountCustomization(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateAccountCustomizationOutput(v *CreateAccountCustomizationOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateAccountCustomizationOutput(v **CreateAccountCustomizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAccountCustomizationOutput if *v == nil { sv = &CreateAccountCustomizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccountCustomization": if err := awsRestjson1_deserializeDocumentAccountCustomization(&sv.AccountCustomization, value); err != nil { return err } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateAccountSubscription struct { } func (*awsRestjson1_deserializeOpCreateAccountSubscription) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateAccountSubscription) 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_deserializeOpErrorCreateAccountSubscription(response, &metadata) } output := &CreateAccountSubscriptionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateAccountSubscriptionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateAccountSubscriptionOutput(&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_deserializeOpErrorCreateAccountSubscription(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateAccountSubscriptionOutput(v *CreateAccountSubscriptionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateAccountSubscriptionOutput(v **CreateAccountSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAccountSubscriptionOutput if *v == nil { sv = &CreateAccountSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "SignupResponse": if err := awsRestjson1_deserializeDocumentSignupResponse(&sv.SignupResponse, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateAnalysis struct { } func (*awsRestjson1_deserializeOpCreateAnalysis) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateAnalysis) 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_deserializeOpErrorCreateAnalysis(response, &metadata) } output := &CreateAnalysisOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateAnalysisOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateAnalysisOutput(&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_deserializeOpErrorCreateAnalysis(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateAnalysisOutput(v *CreateAnalysisOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateAnalysisOutput(v **CreateAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAnalysisOutput if *v == nil { sv = &CreateAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDashboard struct { } func (*awsRestjson1_deserializeOpCreateDashboard) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDashboard) 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_deserializeOpErrorCreateDashboard(response, &metadata) } output := &CreateDashboardOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateDashboardOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateDashboardOutput(&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_deserializeOpErrorCreateDashboard(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateDashboardOutput(v *CreateDashboardOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateDashboardOutput(v **CreateDashboardOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDashboardOutput if *v == nil { sv = &CreateDashboardOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "VersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VersionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDataSet struct { } func (*awsRestjson1_deserializeOpCreateDataSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDataSet) 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_deserializeOpErrorCreateDataSet(response, &metadata) } output := &CreateDataSetOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateDataSetOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateDataSetOutput(&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_deserializeOpErrorCreateDataSet(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateDataSetOutput(v *CreateDataSetOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateDataSetOutput(v **CreateDataSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDataSetOutput if *v == nil { sv = &CreateDataSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "IngestionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.IngestionArn = ptr.String(jtv) } case "IngestionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.IngestionId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDataSource struct { } func (*awsRestjson1_deserializeOpCreateDataSource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDataSource) 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_deserializeOpErrorCreateDataSource(response, &metadata) } output := &CreateDataSourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateDataSourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateDataSourceOutput(&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_deserializeOpErrorCreateDataSource(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateDataSourceOutput(v *CreateDataSourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateDataSourceOutput(v **CreateDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDataSourceOutput if *v == nil { sv = &CreateDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateFolder struct { } func (*awsRestjson1_deserializeOpCreateFolder) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateFolder) 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_deserializeOpErrorCreateFolder(response, &metadata) } output := &CreateFolderOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateFolderOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateFolderOutput(&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_deserializeOpErrorCreateFolder(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateFolderOutput(v *CreateFolderOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateFolderOutput(v **CreateFolderOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateFolderOutput if *v == nil { sv = &CreateFolderOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateFolderMembership struct { } func (*awsRestjson1_deserializeOpCreateFolderMembership) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateFolderMembership) 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_deserializeOpErrorCreateFolderMembership(response, &metadata) } output := &CreateFolderMembershipOutput{} 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_deserializeOpDocumentCreateFolderMembershipOutput(&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_deserializeOpErrorCreateFolderMembership(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateFolderMembershipOutput(v **CreateFolderMembershipOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateFolderMembershipOutput if *v == nil { sv = &CreateFolderMembershipOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FolderMember": if err := awsRestjson1_deserializeDocumentFolderMember(&sv.FolderMember, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Status = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateGroup struct { } func (*awsRestjson1_deserializeOpCreateGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateGroup) 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_deserializeOpErrorCreateGroup(response, &metadata) } output := &CreateGroupOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateGroupOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateGroupOutput(&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_deserializeOpErrorCreateGroup(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateGroupOutput(v *CreateGroupOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateGroupOutput if *v == nil { sv = &CreateGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Group": if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateGroupMembership struct { } func (*awsRestjson1_deserializeOpCreateGroupMembership) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateGroupMembership) 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_deserializeOpErrorCreateGroupMembership(response, &metadata) } output := &CreateGroupMembershipOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateGroupMembershipOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateGroupMembershipOutput(&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_deserializeOpErrorCreateGroupMembership(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateGroupMembershipOutput(v *CreateGroupMembershipOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateGroupMembershipOutput(v **CreateGroupMembershipOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateGroupMembershipOutput if *v == nil { sv = &CreateGroupMembershipOutput{} } else { sv = *v } for key, value := range shape { switch key { case "GroupMember": if err := awsRestjson1_deserializeDocumentGroupMember(&sv.GroupMember, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateIAMPolicyAssignment struct { } func (*awsRestjson1_deserializeOpCreateIAMPolicyAssignment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateIAMPolicyAssignment) 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_deserializeOpErrorCreateIAMPolicyAssignment(response, &metadata) } output := &CreateIAMPolicyAssignmentOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateIAMPolicyAssignmentOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateIAMPolicyAssignmentOutput(&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_deserializeOpErrorCreateIAMPolicyAssignment(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentUpdatingException", errorCode): return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateIAMPolicyAssignmentOutput(v *CreateIAMPolicyAssignmentOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateIAMPolicyAssignmentOutput(v **CreateIAMPolicyAssignmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateIAMPolicyAssignmentOutput if *v == nil { sv = &CreateIAMPolicyAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AssignmentId = ptr.String(jtv) } case "AssignmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) } sv.AssignmentName = ptr.String(jtv) } case "AssignmentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) } sv.AssignmentStatus = types.AssignmentStatus(jtv) } case "Identities": if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil { return err } case "PolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.PolicyArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateIngestion struct { } func (*awsRestjson1_deserializeOpCreateIngestion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateIngestion) 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_deserializeOpErrorCreateIngestion(response, &metadata) } output := &CreateIngestionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateIngestionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateIngestionOutput(&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_deserializeOpErrorCreateIngestion(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateIngestionOutput(v *CreateIngestionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateIngestionOutput(v **CreateIngestionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateIngestionOutput if *v == nil { sv = &CreateIngestionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "IngestionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionId to be of type string, got %T instead", value) } sv.IngestionId = ptr.String(jtv) } case "IngestionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionStatus to be of type string, got %T instead", value) } sv.IngestionStatus = types.IngestionStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateNamespace struct { } func (*awsRestjson1_deserializeOpCreateNamespace) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateNamespace) 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_deserializeOpErrorCreateNamespace(response, &metadata) } output := &CreateNamespaceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateNamespaceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateNamespaceOutput(&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_deserializeOpErrorCreateNamespace(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateNamespaceOutput(v *CreateNamespaceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateNamespaceOutput(v **CreateNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateNamespaceOutput if *v == nil { sv = &CreateNamespaceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CapacityRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CapacityRegion = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamespaceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.NamespaceStatus(jtv) } case "IdentityStore": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IdentityStore to be of type string, got %T instead", value) } sv.IdentityStore = types.IdentityStore(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateRefreshSchedule struct { } func (*awsRestjson1_deserializeOpCreateRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateRefreshSchedule) 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_deserializeOpErrorCreateRefreshSchedule(response, &metadata) } output := &CreateRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateRefreshScheduleOutput(&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_deserializeOpErrorCreateRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateRefreshScheduleOutput(v *CreateRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateRefreshScheduleOutput(v **CreateRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateRefreshScheduleOutput if *v == nil { sv = &CreateRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ScheduleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScheduleId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTemplate struct { } func (*awsRestjson1_deserializeOpCreateTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTemplate) 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_deserializeOpErrorCreateTemplate(response, &metadata) } output := &CreateTemplateOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateTemplateOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateTemplateOutput(&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_deserializeOpErrorCreateTemplate(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateTemplateOutput(v *CreateTemplateOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateTemplateOutput(v **CreateTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateTemplateOutput if *v == nil { sv = &CreateTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } case "VersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VersionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTemplateAlias struct { } func (*awsRestjson1_deserializeOpCreateTemplateAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTemplateAlias) 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_deserializeOpErrorCreateTemplateAlias(response, &metadata) } output := &CreateTemplateAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateTemplateAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateTemplateAliasOutput(&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_deserializeOpErrorCreateTemplateAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateTemplateAliasOutput(v *CreateTemplateAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateTemplateAliasOutput(v **CreateTemplateAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateTemplateAliasOutput if *v == nil { sv = &CreateTemplateAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateAlias": if err := awsRestjson1_deserializeDocumentTemplateAlias(&sv.TemplateAlias, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTheme struct { } func (*awsRestjson1_deserializeOpCreateTheme) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTheme) 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_deserializeOpErrorCreateTheme(response, &metadata) } output := &CreateThemeOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateThemeOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateThemeOutput(&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_deserializeOpErrorCreateTheme(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateThemeOutput(v *CreateThemeOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateThemeOutput(v **CreateThemeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateThemeOutput if *v == nil { sv = &CreateThemeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } case "VersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VersionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateThemeAlias struct { } func (*awsRestjson1_deserializeOpCreateThemeAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateThemeAlias) 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_deserializeOpErrorCreateThemeAlias(response, &metadata) } output := &CreateThemeAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateThemeAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateThemeAliasOutput(&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_deserializeOpErrorCreateThemeAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateThemeAliasOutput(v *CreateThemeAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateThemeAliasOutput(v **CreateThemeAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateThemeAliasOutput if *v == nil { sv = &CreateThemeAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeAlias": if err := awsRestjson1_deserializeDocumentThemeAlias(&sv.ThemeAlias, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTopic struct { } func (*awsRestjson1_deserializeOpCreateTopic) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTopic) 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_deserializeOpErrorCreateTopic(response, &metadata) } output := &CreateTopicOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateTopicOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateTopicOutput(&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_deserializeOpErrorCreateTopic(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateTopicOutput(v *CreateTopicOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateTopicOutput(v **CreateTopicOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateTopicOutput if *v == nil { sv = &CreateTopicOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RefreshArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RefreshArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateTopicRefreshSchedule struct { } func (*awsRestjson1_deserializeOpCreateTopicRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateTopicRefreshSchedule) 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_deserializeOpErrorCreateTopicRefreshSchedule(response, &metadata) } output := &CreateTopicRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateTopicRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateTopicRefreshScheduleOutput(&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_deserializeOpErrorCreateTopicRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateTopicRefreshScheduleOutput(v *CreateTopicRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateTopicRefreshScheduleOutput(v **CreateTopicRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateTopicRefreshScheduleOutput if *v == nil { sv = &CreateTopicRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DatasetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DatasetArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateVPCConnection struct { } func (*awsRestjson1_deserializeOpCreateVPCConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateVPCConnection) 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_deserializeOpErrorCreateVPCConnection(response, &metadata) } output := &CreateVPCConnectionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsCreateVPCConnectionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentCreateVPCConnectionOutput(&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_deserializeOpErrorCreateVPCConnection(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsCreateVPCConnectionOutput(v *CreateVPCConnectionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentCreateVPCConnectionOutput(v **CreateVPCConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateVPCConnectionOutput if *v == nil { sv = &CreateVPCConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionAvailabilityStatus to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.VPCConnectionAvailabilityStatus(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.VPCConnectionResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "VPCConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceIdRestricted to be of type string, got %T instead", value) } sv.VPCConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteAccountCustomization struct { } func (*awsRestjson1_deserializeOpDeleteAccountCustomization) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteAccountCustomization) 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_deserializeOpErrorDeleteAccountCustomization(response, &metadata) } output := &DeleteAccountCustomizationOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteAccountCustomizationOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteAccountCustomizationOutput(&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_deserializeOpErrorDeleteAccountCustomization(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteAccountCustomizationOutput(v *DeleteAccountCustomizationOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteAccountCustomizationOutput(v **DeleteAccountCustomizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAccountCustomizationOutput if *v == nil { sv = &DeleteAccountCustomizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteAccountSubscription struct { } func (*awsRestjson1_deserializeOpDeleteAccountSubscription) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteAccountSubscription) 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_deserializeOpErrorDeleteAccountSubscription(response, &metadata) } output := &DeleteAccountSubscriptionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteAccountSubscriptionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteAccountSubscriptionOutput(&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_deserializeOpErrorDeleteAccountSubscription(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteAccountSubscriptionOutput(v *DeleteAccountSubscriptionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteAccountSubscriptionOutput(v **DeleteAccountSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAccountSubscriptionOutput if *v == nil { sv = &DeleteAccountSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteAnalysis struct { } func (*awsRestjson1_deserializeOpDeleteAnalysis) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteAnalysis) 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_deserializeOpErrorDeleteAnalysis(response, &metadata) } output := &DeleteAnalysisOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteAnalysisOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteAnalysisOutput(&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_deserializeOpErrorDeleteAnalysis(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteAnalysisOutput(v *DeleteAnalysisOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteAnalysisOutput(v **DeleteAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAnalysisOutput if *v == nil { sv = &DeleteAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DeletionTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DeletionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteDashboard struct { } func (*awsRestjson1_deserializeOpDeleteDashboard) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteDashboard) 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_deserializeOpErrorDeleteDashboard(response, &metadata) } output := &DeleteDashboardOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteDashboardOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteDashboardOutput(&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_deserializeOpErrorDeleteDashboard(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteDashboardOutput(v *DeleteDashboardOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteDashboardOutput(v **DeleteDashboardOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDashboardOutput if *v == nil { sv = &DeleteDashboardOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteDataSet struct { } func (*awsRestjson1_deserializeOpDeleteDataSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteDataSet) 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_deserializeOpErrorDeleteDataSet(response, &metadata) } output := &DeleteDataSetOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteDataSetOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteDataSetOutput(&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_deserializeOpErrorDeleteDataSet(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteDataSetOutput(v *DeleteDataSetOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteDataSetOutput(v **DeleteDataSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDataSetOutput if *v == nil { sv = &DeleteDataSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteDataSetRefreshProperties struct { } func (*awsRestjson1_deserializeOpDeleteDataSetRefreshProperties) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteDataSetRefreshProperties) 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_deserializeOpErrorDeleteDataSetRefreshProperties(response, &metadata) } output := &DeleteDataSetRefreshPropertiesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteDataSetRefreshPropertiesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteDataSetRefreshPropertiesOutput(&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_deserializeOpErrorDeleteDataSetRefreshProperties(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteDataSetRefreshPropertiesOutput(v *DeleteDataSetRefreshPropertiesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteDataSetRefreshPropertiesOutput(v **DeleteDataSetRefreshPropertiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDataSetRefreshPropertiesOutput if *v == nil { sv = &DeleteDataSetRefreshPropertiesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteDataSource struct { } func (*awsRestjson1_deserializeOpDeleteDataSource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteDataSource) 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_deserializeOpErrorDeleteDataSource(response, &metadata) } output := &DeleteDataSourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteDataSourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteDataSourceOutput(&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_deserializeOpErrorDeleteDataSource(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteDataSourceOutput(v *DeleteDataSourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDataSourceOutput if *v == nil { sv = &DeleteDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteFolder struct { } func (*awsRestjson1_deserializeOpDeleteFolder) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteFolder) 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_deserializeOpErrorDeleteFolder(response, &metadata) } output := &DeleteFolderOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteFolderOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteFolderOutput(&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_deserializeOpErrorDeleteFolder(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteFolderOutput(v *DeleteFolderOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteFolderOutput(v **DeleteFolderOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteFolderOutput if *v == nil { sv = &DeleteFolderOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteFolderMembership struct { } func (*awsRestjson1_deserializeOpDeleteFolderMembership) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteFolderMembership) 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_deserializeOpErrorDeleteFolderMembership(response, &metadata) } output := &DeleteFolderMembershipOutput{} 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_deserializeOpDocumentDeleteFolderMembershipOutput(&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_deserializeOpErrorDeleteFolderMembership(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteFolderMembershipOutput(v **DeleteFolderMembershipOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteFolderMembershipOutput if *v == nil { sv = &DeleteFolderMembershipOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Status = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteGroup struct { } func (*awsRestjson1_deserializeOpDeleteGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteGroup) 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_deserializeOpErrorDeleteGroup(response, &metadata) } output := &DeleteGroupOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteGroupOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteGroupOutput(&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_deserializeOpErrorDeleteGroup(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteGroupOutput(v *DeleteGroupOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteGroupOutput if *v == nil { sv = &DeleteGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteGroupMembership struct { } func (*awsRestjson1_deserializeOpDeleteGroupMembership) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteGroupMembership) 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_deserializeOpErrorDeleteGroupMembership(response, &metadata) } output := &DeleteGroupMembershipOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteGroupMembershipOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteGroupMembershipOutput(&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_deserializeOpErrorDeleteGroupMembership(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteGroupMembershipOutput(v *DeleteGroupMembershipOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteGroupMembershipOutput(v **DeleteGroupMembershipOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteGroupMembershipOutput if *v == nil { sv = &DeleteGroupMembershipOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteIAMPolicyAssignment struct { } func (*awsRestjson1_deserializeOpDeleteIAMPolicyAssignment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteIAMPolicyAssignment) 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_deserializeOpErrorDeleteIAMPolicyAssignment(response, &metadata) } output := &DeleteIAMPolicyAssignmentOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteIAMPolicyAssignmentOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteIAMPolicyAssignmentOutput(&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_deserializeOpErrorDeleteIAMPolicyAssignment(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentUpdatingException", errorCode): return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteIAMPolicyAssignmentOutput(v *DeleteIAMPolicyAssignmentOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteIAMPolicyAssignmentOutput(v **DeleteIAMPolicyAssignmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteIAMPolicyAssignmentOutput if *v == nil { sv = &DeleteIAMPolicyAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) } sv.AssignmentName = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteNamespace struct { } func (*awsRestjson1_deserializeOpDeleteNamespace) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteNamespace) 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_deserializeOpErrorDeleteNamespace(response, &metadata) } output := &DeleteNamespaceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteNamespaceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteNamespaceOutput(&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_deserializeOpErrorDeleteNamespace(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteNamespaceOutput(v *DeleteNamespaceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteNamespaceOutput(v **DeleteNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteNamespaceOutput if *v == nil { sv = &DeleteNamespaceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteRefreshSchedule struct { } func (*awsRestjson1_deserializeOpDeleteRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteRefreshSchedule) 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_deserializeOpErrorDeleteRefreshSchedule(response, &metadata) } output := &DeleteRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteRefreshScheduleOutput(&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_deserializeOpErrorDeleteRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteRefreshScheduleOutput(v *DeleteRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteRefreshScheduleOutput(v **DeleteRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteRefreshScheduleOutput if *v == nil { sv = &DeleteRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ScheduleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScheduleId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTemplate struct { } func (*awsRestjson1_deserializeOpDeleteTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTemplate) 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_deserializeOpErrorDeleteTemplate(response, &metadata) } output := &DeleteTemplateOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteTemplateOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteTemplateOutput(&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_deserializeOpErrorDeleteTemplate(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteTemplateOutput(v *DeleteTemplateOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteTemplateOutput(v **DeleteTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTemplateOutput if *v == nil { sv = &DeleteTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTemplateAlias struct { } func (*awsRestjson1_deserializeOpDeleteTemplateAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTemplateAlias) 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_deserializeOpErrorDeleteTemplateAlias(response, &metadata) } output := &DeleteTemplateAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteTemplateAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteTemplateAliasOutput(&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_deserializeOpErrorDeleteTemplateAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteTemplateAliasOutput(v *DeleteTemplateAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteTemplateAliasOutput(v **DeleteTemplateAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTemplateAliasOutput if *v == nil { sv = &DeleteTemplateAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AliasName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AliasName to be of type string, got %T instead", value) } sv.AliasName = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTheme struct { } func (*awsRestjson1_deserializeOpDeleteTheme) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTheme) 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_deserializeOpErrorDeleteTheme(response, &metadata) } output := &DeleteThemeOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteThemeOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteThemeOutput(&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_deserializeOpErrorDeleteTheme(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteThemeOutput(v *DeleteThemeOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteThemeOutput(v **DeleteThemeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteThemeOutput if *v == nil { sv = &DeleteThemeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteThemeAlias struct { } func (*awsRestjson1_deserializeOpDeleteThemeAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteThemeAlias) 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_deserializeOpErrorDeleteThemeAlias(response, &metadata) } output := &DeleteThemeAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteThemeAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteThemeAliasOutput(&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_deserializeOpErrorDeleteThemeAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteThemeAliasOutput(v *DeleteThemeAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteThemeAliasOutput(v **DeleteThemeAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteThemeAliasOutput if *v == nil { sv = &DeleteThemeAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AliasName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AliasName to be of type string, got %T instead", value) } sv.AliasName = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTopic struct { } func (*awsRestjson1_deserializeOpDeleteTopic) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTopic) 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_deserializeOpErrorDeleteTopic(response, &metadata) } output := &DeleteTopicOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteTopicOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteTopicOutput(&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_deserializeOpErrorDeleteTopic(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteTopicOutput(v *DeleteTopicOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteTopicOutput(v **DeleteTopicOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTopicOutput if *v == nil { sv = &DeleteTopicOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteTopicRefreshSchedule struct { } func (*awsRestjson1_deserializeOpDeleteTopicRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteTopicRefreshSchedule) 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_deserializeOpErrorDeleteTopicRefreshSchedule(response, &metadata) } output := &DeleteTopicRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteTopicRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteTopicRefreshScheduleOutput(&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_deserializeOpErrorDeleteTopicRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteTopicRefreshScheduleOutput(v *DeleteTopicRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteTopicRefreshScheduleOutput(v **DeleteTopicRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTopicRefreshScheduleOutput if *v == nil { sv = &DeleteTopicRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DatasetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DatasetArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteUser struct { } func (*awsRestjson1_deserializeOpDeleteUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteUser) 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_deserializeOpErrorDeleteUser(response, &metadata) } output := &DeleteUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteUserOutput(&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_deserializeOpErrorDeleteUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteUserOutput(v *DeleteUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteUserOutput(v **DeleteUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteUserOutput if *v == nil { sv = &DeleteUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteUserByPrincipalId struct { } func (*awsRestjson1_deserializeOpDeleteUserByPrincipalId) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteUserByPrincipalId) 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_deserializeOpErrorDeleteUserByPrincipalId(response, &metadata) } output := &DeleteUserByPrincipalIdOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteUserByPrincipalIdOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteUserByPrincipalIdOutput(&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_deserializeOpErrorDeleteUserByPrincipalId(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteUserByPrincipalIdOutput(v *DeleteUserByPrincipalIdOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteUserByPrincipalIdOutput(v **DeleteUserByPrincipalIdOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteUserByPrincipalIdOutput if *v == nil { sv = &DeleteUserByPrincipalIdOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteVPCConnection struct { } func (*awsRestjson1_deserializeOpDeleteVPCConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteVPCConnection) 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_deserializeOpErrorDeleteVPCConnection(response, &metadata) } output := &DeleteVPCConnectionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDeleteVPCConnectionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDeleteVPCConnectionOutput(&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_deserializeOpErrorDeleteVPCConnection(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDeleteVPCConnectionOutput(v *DeleteVPCConnectionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDeleteVPCConnectionOutput(v **DeleteVPCConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteVPCConnectionOutput if *v == nil { sv = &DeleteVPCConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionAvailabilityStatus to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.VPCConnectionAvailabilityStatus(jtv) } case "DeletionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceStatus to be of type string, got %T instead", value) } sv.DeletionStatus = types.VPCConnectionResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "VPCConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceIdUnrestricted to be of type string, got %T instead", value) } sv.VPCConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAccountCustomization struct { } func (*awsRestjson1_deserializeOpDescribeAccountCustomization) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAccountCustomization) 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_deserializeOpErrorDescribeAccountCustomization(response, &metadata) } output := &DescribeAccountCustomizationOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAccountCustomizationOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAccountCustomizationOutput(&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_deserializeOpErrorDescribeAccountCustomization(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAccountCustomizationOutput(v *DescribeAccountCustomizationOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAccountCustomizationOutput(v **DescribeAccountCustomizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAccountCustomizationOutput if *v == nil { sv = &DescribeAccountCustomizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccountCustomization": if err := awsRestjson1_deserializeDocumentAccountCustomization(&sv.AccountCustomization, value); err != nil { return err } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAccountSettings struct { } func (*awsRestjson1_deserializeOpDescribeAccountSettings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAccountSettings) 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_deserializeOpErrorDescribeAccountSettings(response, &metadata) } output := &DescribeAccountSettingsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAccountSettingsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAccountSettingsOutput(&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_deserializeOpErrorDescribeAccountSettings(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAccountSettingsOutput(v *DescribeAccountSettingsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAccountSettingsOutput(v **DescribeAccountSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAccountSettingsOutput if *v == nil { sv = &DescribeAccountSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccountSettings": if err := awsRestjson1_deserializeDocumentAccountSettings(&sv.AccountSettings, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAccountSubscription struct { } func (*awsRestjson1_deserializeOpDescribeAccountSubscription) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAccountSubscription) 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_deserializeOpErrorDescribeAccountSubscription(response, &metadata) } output := &DescribeAccountSubscriptionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAccountSubscriptionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAccountSubscriptionOutput(&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_deserializeOpErrorDescribeAccountSubscription(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAccountSubscriptionOutput(v *DescribeAccountSubscriptionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAccountSubscriptionOutput(v **DescribeAccountSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAccountSubscriptionOutput if *v == nil { sv = &DescribeAccountSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccountInfo": if err := awsRestjson1_deserializeDocumentAccountInfo(&sv.AccountInfo, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAnalysis struct { } func (*awsRestjson1_deserializeOpDescribeAnalysis) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAnalysis) 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_deserializeOpErrorDescribeAnalysis(response, &metadata) } output := &DescribeAnalysisOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAnalysisOutput(&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_deserializeOpErrorDescribeAnalysis(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisOutput(v *DescribeAnalysisOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAnalysisOutput(v **DescribeAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAnalysisOutput if *v == nil { sv = &DescribeAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Analysis": if err := awsRestjson1_deserializeDocumentAnalysis(&sv.Analysis, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAnalysisDefinition struct { } func (*awsRestjson1_deserializeOpDescribeAnalysisDefinition) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAnalysisDefinition) 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_deserializeOpErrorDescribeAnalysisDefinition(response, &metadata) } output := &DescribeAnalysisDefinitionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisDefinitionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAnalysisDefinitionOutput(&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_deserializeOpErrorDescribeAnalysisDefinition(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisDefinitionOutput(v *DescribeAnalysisDefinitionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAnalysisDefinitionOutput(v **DescribeAnalysisDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAnalysisDefinitionOutput if *v == nil { sv = &DescribeAnalysisDefinitionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Definition": if err := awsRestjson1_deserializeDocumentAnalysisDefinition(&sv.Definition, value); err != nil { return err } case "Errors": if err := awsRestjson1_deserializeDocumentAnalysisErrorList(&sv.Errors, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AnalysisName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.ResourceStatus = types.ResourceStatus(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAnalysisPermissions struct { } func (*awsRestjson1_deserializeOpDescribeAnalysisPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAnalysisPermissions) 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_deserializeOpErrorDescribeAnalysisPermissions(response, &metadata) } output := &DescribeAnalysisPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAnalysisPermissionsOutput(&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_deserializeOpErrorDescribeAnalysisPermissions(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAnalysisPermissionsOutput(v *DescribeAnalysisPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAnalysisPermissionsOutput(v **DescribeAnalysisPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAnalysisPermissionsOutput if *v == nil { sv = &DescribeAnalysisPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.AnalysisArn = ptr.String(jtv) } case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAssetBundleExportJob struct { } func (*awsRestjson1_deserializeOpDescribeAssetBundleExportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAssetBundleExportJob) 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_deserializeOpErrorDescribeAssetBundleExportJob(response, &metadata) } output := &DescribeAssetBundleExportJobOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAssetBundleExportJobOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAssetBundleExportJobOutput(&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_deserializeOpErrorDescribeAssetBundleExportJob(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAssetBundleExportJobOutput(v *DescribeAssetBundleExportJobOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAssetBundleExportJobOutput(v **DescribeAssetBundleExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAssetBundleExportJobOutput if *v == nil { sv = &DescribeAssetBundleExportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssetBundleExportJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AssetBundleExportJobId = ptr.String(jtv) } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "CloudFormationOverridePropertyConfiguration": if err := awsRestjson1_deserializeDocumentAssetBundleCloudFormationOverridePropertyConfiguration(&sv.CloudFormationOverridePropertyConfiguration, value); err != nil { return err } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DownloadUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DownloadUrl = ptr.String(jtv) } case "Errors": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobErrorList(&sv.Errors, value); err != nil { return err } case "ExportFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportFormat to be of type string, got %T instead", value) } sv.ExportFormat = types.AssetBundleExportFormat(jtv) } case "IncludeAllDependencies": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeAllDependencies = jtv } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.AssetBundleExportJobStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceArns": if err := awsRestjson1_deserializeDocumentAssetBundleResourceArns(&sv.ResourceArns, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeAssetBundleImportJob struct { } func (*awsRestjson1_deserializeOpDescribeAssetBundleImportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeAssetBundleImportJob) 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_deserializeOpErrorDescribeAssetBundleImportJob(response, &metadata) } output := &DescribeAssetBundleImportJobOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeAssetBundleImportJobOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeAssetBundleImportJobOutput(&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_deserializeOpErrorDescribeAssetBundleImportJob(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeAssetBundleImportJobOutput(v *DescribeAssetBundleImportJobOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeAssetBundleImportJobOutput(v **DescribeAssetBundleImportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAssetBundleImportJobOutput if *v == nil { sv = &DescribeAssetBundleImportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssetBundleImportJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AssetBundleImportJobId = ptr.String(jtv) } case "AssetBundleImportSource": if err := awsRestjson1_deserializeDocumentAssetBundleImportSourceDescription(&sv.AssetBundleImportSource, value); err != nil { return err } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Errors": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobErrorList(&sv.Errors, value); err != nil { return err } case "FailureAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleImportFailureAction to be of type string, got %T instead", value) } sv.FailureAction = types.AssetBundleImportFailureAction(jtv) } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleImportJobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.AssetBundleImportJobStatus(jtv) } case "OverrideParameters": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobOverrideParameters(&sv.OverrideParameters, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "RollbackErrors": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobErrorList(&sv.RollbackErrors, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDashboard struct { } func (*awsRestjson1_deserializeOpDescribeDashboard) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDashboard) 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_deserializeOpErrorDescribeDashboard(response, &metadata) } output := &DescribeDashboardOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDashboardOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDashboardOutput(&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_deserializeOpErrorDescribeDashboard(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDashboardOutput(v *DescribeDashboardOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDashboardOutput(v **DescribeDashboardOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDashboardOutput if *v == nil { sv = &DescribeDashboardOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Dashboard": if err := awsRestjson1_deserializeDocumentDashboard(&sv.Dashboard, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDashboardDefinition struct { } func (*awsRestjson1_deserializeOpDescribeDashboardDefinition) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDashboardDefinition) 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_deserializeOpErrorDescribeDashboardDefinition(response, &metadata) } output := &DescribeDashboardDefinitionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDashboardDefinitionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDashboardDefinitionOutput(&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_deserializeOpErrorDescribeDashboardDefinition(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDashboardDefinitionOutput(v *DescribeDashboardDefinitionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDashboardDefinitionOutput(v **DescribeDashboardDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDashboardDefinitionOutput if *v == nil { sv = &DescribeDashboardDefinitionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "DashboardPublishOptions": if err := awsRestjson1_deserializeDocumentDashboardPublishOptions(&sv.DashboardPublishOptions, value); err != nil { return err } case "Definition": if err := awsRestjson1_deserializeDocumentDashboardVersionDefinition(&sv.Definition, value); err != nil { return err } case "Errors": if err := awsRestjson1_deserializeDocumentDashboardErrorList(&sv.Errors, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.ResourceStatus = types.ResourceStatus(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDashboardPermissions struct { } func (*awsRestjson1_deserializeOpDescribeDashboardPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDashboardPermissions) 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_deserializeOpErrorDescribeDashboardPermissions(response, &metadata) } output := &DescribeDashboardPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDashboardPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDashboardPermissionsOutput(&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_deserializeOpErrorDescribeDashboardPermissions(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDashboardPermissionsOutput(v *DescribeDashboardPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDashboardPermissionsOutput(v **DescribeDashboardPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDashboardPermissionsOutput if *v == nil { sv = &DescribeDashboardPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DashboardArn = ptr.String(jtv) } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "LinkSharingConfiguration": if err := awsRestjson1_deserializeDocumentLinkSharingConfiguration(&sv.LinkSharingConfiguration, value); err != nil { return err } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDashboardSnapshotJob struct { } func (*awsRestjson1_deserializeOpDescribeDashboardSnapshotJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDashboardSnapshotJob) 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_deserializeOpErrorDescribeDashboardSnapshotJob(response, &metadata) } output := &DescribeDashboardSnapshotJobOutput{} 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_deserializeOpDocumentDescribeDashboardSnapshotJobOutput(&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_deserializeOpErrorDescribeDashboardSnapshotJob(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeDashboardSnapshotJobOutput(v **DescribeDashboardSnapshotJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDashboardSnapshotJobOutput if *v == nil { sv = &DescribeDashboardSnapshotJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SnapshotJobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.SnapshotJobStatus(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "SnapshotConfiguration": if err := awsRestjson1_deserializeDocumentSnapshotConfiguration(&sv.SnapshotConfiguration, value); err != nil { return err } case "SnapshotJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SnapshotJobId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Status = int32(i64) } case "UserConfiguration": if err := awsRestjson1_deserializeDocumentSnapshotUserConfigurationRedacted(&sv.UserConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDashboardSnapshotJobResult struct { } func (*awsRestjson1_deserializeOpDescribeDashboardSnapshotJobResult) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDashboardSnapshotJobResult) 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_deserializeOpErrorDescribeDashboardSnapshotJobResult(response, &metadata) } output := &DescribeDashboardSnapshotJobResultOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDashboardSnapshotJobResultOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDashboardSnapshotJobResultOutput(&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_deserializeOpErrorDescribeDashboardSnapshotJobResult(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDashboardSnapshotJobResultOutput(v *DescribeDashboardSnapshotJobResultOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDashboardSnapshotJobResultOutput(v **DescribeDashboardSnapshotJobResultOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDashboardSnapshotJobResultOutput if *v == nil { sv = &DescribeDashboardSnapshotJobResultOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ErrorInfo": if err := awsRestjson1_deserializeDocumentSnapshotJobErrorInfo(&sv.ErrorInfo, value); err != nil { return err } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SnapshotJobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.SnapshotJobStatus(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Result": if err := awsRestjson1_deserializeDocumentSnapshotJobResult(&sv.Result, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDataSet struct { } func (*awsRestjson1_deserializeOpDescribeDataSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDataSet) 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_deserializeOpErrorDescribeDataSet(response, &metadata) } output := &DescribeDataSetOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSetOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDataSetOutput(&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_deserializeOpErrorDescribeDataSet(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDataSetOutput(v *DescribeDataSetOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDataSetOutput(v **DescribeDataSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDataSetOutput if *v == nil { sv = &DescribeDataSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSet": if err := awsRestjson1_deserializeDocumentDataSet(&sv.DataSet, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDataSetPermissions struct { } func (*awsRestjson1_deserializeOpDescribeDataSetPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDataSetPermissions) 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_deserializeOpErrorDescribeDataSetPermissions(response, &metadata) } output := &DescribeDataSetPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSetPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDataSetPermissionsOutput(&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_deserializeOpErrorDescribeDataSetPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDataSetPermissionsOutput(v *DescribeDataSetPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDataSetPermissionsOutput(v **DescribeDataSetPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDataSetPermissionsOutput if *v == nil { sv = &DescribeDataSetPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSetArn = ptr.String(jtv) } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDataSetRefreshProperties struct { } func (*awsRestjson1_deserializeOpDescribeDataSetRefreshProperties) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDataSetRefreshProperties) 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_deserializeOpErrorDescribeDataSetRefreshProperties(response, &metadata) } output := &DescribeDataSetRefreshPropertiesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSetRefreshPropertiesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDataSetRefreshPropertiesOutput(&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_deserializeOpErrorDescribeDataSetRefreshProperties(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDataSetRefreshPropertiesOutput(v *DescribeDataSetRefreshPropertiesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDataSetRefreshPropertiesOutput(v **DescribeDataSetRefreshPropertiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDataSetRefreshPropertiesOutput if *v == nil { sv = &DescribeDataSetRefreshPropertiesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetRefreshProperties": if err := awsRestjson1_deserializeDocumentDataSetRefreshProperties(&sv.DataSetRefreshProperties, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDataSource struct { } func (*awsRestjson1_deserializeOpDescribeDataSource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDataSource) 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_deserializeOpErrorDescribeDataSource(response, &metadata) } output := &DescribeDataSourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDataSourceOutput(&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_deserializeOpErrorDescribeDataSource(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDataSourceOutput(v *DescribeDataSourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDataSourceOutput(v **DescribeDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDataSourceOutput if *v == nil { sv = &DescribeDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSource": if err := awsRestjson1_deserializeDocumentDataSource(&sv.DataSource, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeDataSourcePermissions struct { } func (*awsRestjson1_deserializeOpDescribeDataSourcePermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeDataSourcePermissions) 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_deserializeOpErrorDescribeDataSourcePermissions(response, &metadata) } output := &DescribeDataSourcePermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeDataSourcePermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeDataSourcePermissionsOutput(&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_deserializeOpErrorDescribeDataSourcePermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeDataSourcePermissionsOutput(v *DescribeDataSourcePermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeDataSourcePermissionsOutput(v **DescribeDataSourcePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDataSourcePermissionsOutput if *v == nil { sv = &DescribeDataSourcePermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSourceArn = ptr.String(jtv) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeFolder struct { } func (*awsRestjson1_deserializeOpDescribeFolder) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeFolder) 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_deserializeOpErrorDescribeFolder(response, &metadata) } output := &DescribeFolderOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeFolderOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeFolderOutput(&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_deserializeOpErrorDescribeFolder(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeFolderOutput(v *DescribeFolderOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeFolderOutput(v **DescribeFolderOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeFolderOutput if *v == nil { sv = &DescribeFolderOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Folder": if err := awsRestjson1_deserializeDocumentFolder(&sv.Folder, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeFolderPermissions struct { } func (*awsRestjson1_deserializeOpDescribeFolderPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeFolderPermissions) 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_deserializeOpErrorDescribeFolderPermissions(response, &metadata) } output := &DescribeFolderPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeFolderPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeFolderPermissionsOutput(&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_deserializeOpErrorDescribeFolderPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeFolderPermissionsOutput(v *DescribeFolderPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeFolderPermissionsOutput(v **DescribeFolderPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeFolderPermissionsOutput if *v == nil { sv = &DescribeFolderPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeFolderResolvedPermissions struct { } func (*awsRestjson1_deserializeOpDescribeFolderResolvedPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeFolderResolvedPermissions) 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_deserializeOpErrorDescribeFolderResolvedPermissions(response, &metadata) } output := &DescribeFolderResolvedPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeFolderResolvedPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeFolderResolvedPermissionsOutput(&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_deserializeOpErrorDescribeFolderResolvedPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeFolderResolvedPermissionsOutput(v *DescribeFolderResolvedPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeFolderResolvedPermissionsOutput(v **DescribeFolderResolvedPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeFolderResolvedPermissionsOutput if *v == nil { sv = &DescribeFolderResolvedPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeGroup struct { } func (*awsRestjson1_deserializeOpDescribeGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeGroup) 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_deserializeOpErrorDescribeGroup(response, &metadata) } output := &DescribeGroupOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeGroupOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeGroupOutput(&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_deserializeOpErrorDescribeGroup(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeGroupOutput(v *DescribeGroupOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeGroupOutput(v **DescribeGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeGroupOutput if *v == nil { sv = &DescribeGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Group": if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeGroupMembership struct { } func (*awsRestjson1_deserializeOpDescribeGroupMembership) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeGroupMembership) 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_deserializeOpErrorDescribeGroupMembership(response, &metadata) } output := &DescribeGroupMembershipOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeGroupMembershipOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeGroupMembershipOutput(&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_deserializeOpErrorDescribeGroupMembership(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeGroupMembershipOutput(v *DescribeGroupMembershipOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeGroupMembershipOutput(v **DescribeGroupMembershipOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeGroupMembershipOutput if *v == nil { sv = &DescribeGroupMembershipOutput{} } else { sv = *v } for key, value := range shape { switch key { case "GroupMember": if err := awsRestjson1_deserializeDocumentGroupMember(&sv.GroupMember, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeIAMPolicyAssignment struct { } func (*awsRestjson1_deserializeOpDescribeIAMPolicyAssignment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeIAMPolicyAssignment) 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_deserializeOpErrorDescribeIAMPolicyAssignment(response, &metadata) } output := &DescribeIAMPolicyAssignmentOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeIAMPolicyAssignmentOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeIAMPolicyAssignmentOutput(&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_deserializeOpErrorDescribeIAMPolicyAssignment(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeIAMPolicyAssignmentOutput(v *DescribeIAMPolicyAssignmentOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeIAMPolicyAssignmentOutput(v **DescribeIAMPolicyAssignmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeIAMPolicyAssignmentOutput if *v == nil { sv = &DescribeIAMPolicyAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "IAMPolicyAssignment": if err := awsRestjson1_deserializeDocumentIAMPolicyAssignment(&sv.IAMPolicyAssignment, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeIngestion struct { } func (*awsRestjson1_deserializeOpDescribeIngestion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeIngestion) 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_deserializeOpErrorDescribeIngestion(response, &metadata) } output := &DescribeIngestionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeIngestionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeIngestionOutput(&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_deserializeOpErrorDescribeIngestion(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeIngestionOutput(v *DescribeIngestionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeIngestionOutput(v **DescribeIngestionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeIngestionOutput if *v == nil { sv = &DescribeIngestionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Ingestion": if err := awsRestjson1_deserializeDocumentIngestion(&sv.Ingestion, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeIpRestriction struct { } func (*awsRestjson1_deserializeOpDescribeIpRestriction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeIpRestriction) 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_deserializeOpErrorDescribeIpRestriction(response, &metadata) } output := &DescribeIpRestrictionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeIpRestrictionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeIpRestrictionOutput(&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_deserializeOpErrorDescribeIpRestriction(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeIpRestrictionOutput(v *DescribeIpRestrictionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeIpRestrictionOutput(v **DescribeIpRestrictionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeIpRestrictionOutput if *v == nil { sv = &DescribeIpRestrictionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "IpRestrictionRuleMap": if err := awsRestjson1_deserializeDocumentIpRestrictionRuleMap(&sv.IpRestrictionRuleMap, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeNamespace struct { } func (*awsRestjson1_deserializeOpDescribeNamespace) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeNamespace) 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_deserializeOpErrorDescribeNamespace(response, &metadata) } output := &DescribeNamespaceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeNamespaceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeNamespaceOutput(&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_deserializeOpErrorDescribeNamespace(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeNamespaceOutput(v *DescribeNamespaceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeNamespaceOutput(v **DescribeNamespaceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeNamespaceOutput if *v == nil { sv = &DescribeNamespaceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Namespace": if err := awsRestjson1_deserializeDocumentNamespaceInfoV2(&sv.Namespace, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeRefreshSchedule struct { } func (*awsRestjson1_deserializeOpDescribeRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeRefreshSchedule) 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_deserializeOpErrorDescribeRefreshSchedule(response, &metadata) } output := &DescribeRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeRefreshScheduleOutput(&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_deserializeOpErrorDescribeRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeRefreshScheduleOutput(v *DescribeRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeRefreshScheduleOutput(v **DescribeRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeRefreshScheduleOutput if *v == nil { sv = &DescribeRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RefreshSchedule": if err := awsRestjson1_deserializeDocumentRefreshSchedule(&sv.RefreshSchedule, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTemplate struct { } func (*awsRestjson1_deserializeOpDescribeTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTemplate) 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_deserializeOpErrorDescribeTemplate(response, &metadata) } output := &DescribeTemplateOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplateOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTemplateOutput(&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_deserializeOpErrorDescribeTemplate(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTemplateOutput(v *DescribeTemplateOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTemplateOutput(v **DescribeTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTemplateOutput if *v == nil { sv = &DescribeTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Template": if err := awsRestjson1_deserializeDocumentTemplate(&sv.Template, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTemplateAlias struct { } func (*awsRestjson1_deserializeOpDescribeTemplateAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTemplateAlias) 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_deserializeOpErrorDescribeTemplateAlias(response, &metadata) } output := &DescribeTemplateAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplateAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTemplateAliasOutput(&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_deserializeOpErrorDescribeTemplateAlias(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTemplateAliasOutput(v *DescribeTemplateAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTemplateAliasOutput(v **DescribeTemplateAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTemplateAliasOutput if *v == nil { sv = &DescribeTemplateAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateAlias": if err := awsRestjson1_deserializeDocumentTemplateAlias(&sv.TemplateAlias, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTemplateDefinition struct { } func (*awsRestjson1_deserializeOpDescribeTemplateDefinition) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTemplateDefinition) 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_deserializeOpErrorDescribeTemplateDefinition(response, &metadata) } output := &DescribeTemplateDefinitionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplateDefinitionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTemplateDefinitionOutput(&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_deserializeOpErrorDescribeTemplateDefinition(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTemplateDefinitionOutput(v *DescribeTemplateDefinitionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTemplateDefinitionOutput(v **DescribeTemplateDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTemplateDefinitionOutput if *v == nil { sv = &DescribeTemplateDefinitionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Definition": if err := awsRestjson1_deserializeDocumentTemplateVersionDefinition(&sv.Definition, value); err != nil { return err } case "Errors": if err := awsRestjson1_deserializeDocumentTemplateErrorList(&sv.Errors, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.ResourceStatus = types.ResourceStatus(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTemplatePermissions struct { } func (*awsRestjson1_deserializeOpDescribeTemplatePermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTemplatePermissions) 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_deserializeOpErrorDescribeTemplatePermissions(response, &metadata) } output := &DescribeTemplatePermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTemplatePermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTemplatePermissionsOutput(&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_deserializeOpErrorDescribeTemplatePermissions(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTemplatePermissionsOutput(v *DescribeTemplatePermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTemplatePermissionsOutput(v **DescribeTemplatePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTemplatePermissionsOutput if *v == nil { sv = &DescribeTemplatePermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TemplateArn = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTheme struct { } func (*awsRestjson1_deserializeOpDescribeTheme) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTheme) 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_deserializeOpErrorDescribeTheme(response, &metadata) } output := &DescribeThemeOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeThemeOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeThemeOutput(&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_deserializeOpErrorDescribeTheme(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeThemeOutput(v *DescribeThemeOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeThemeOutput(v **DescribeThemeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeThemeOutput if *v == nil { sv = &DescribeThemeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Theme": if err := awsRestjson1_deserializeDocumentTheme(&sv.Theme, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeThemeAlias struct { } func (*awsRestjson1_deserializeOpDescribeThemeAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeThemeAlias) 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_deserializeOpErrorDescribeThemeAlias(response, &metadata) } output := &DescribeThemeAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeThemeAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeThemeAliasOutput(&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_deserializeOpErrorDescribeThemeAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeThemeAliasOutput(v *DescribeThemeAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeThemeAliasOutput(v **DescribeThemeAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeThemeAliasOutput if *v == nil { sv = &DescribeThemeAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeAlias": if err := awsRestjson1_deserializeDocumentThemeAlias(&sv.ThemeAlias, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeThemePermissions struct { } func (*awsRestjson1_deserializeOpDescribeThemePermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeThemePermissions) 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_deserializeOpErrorDescribeThemePermissions(response, &metadata) } output := &DescribeThemePermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeThemePermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeThemePermissionsOutput(&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_deserializeOpErrorDescribeThemePermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeThemePermissionsOutput(v *DescribeThemePermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeThemePermissionsOutput(v **DescribeThemePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeThemePermissionsOutput if *v == nil { sv = &DescribeThemePermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTopic struct { } func (*awsRestjson1_deserializeOpDescribeTopic) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTopic) 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_deserializeOpErrorDescribeTopic(response, &metadata) } output := &DescribeTopicOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTopicOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTopicOutput(&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_deserializeOpErrorDescribeTopic(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTopicOutput(v *DescribeTopicOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTopicOutput(v **DescribeTopicOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTopicOutput if *v == nil { sv = &DescribeTopicOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Topic": if err := awsRestjson1_deserializeDocumentTopicDetails(&sv.Topic, value); err != nil { return err } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTopicPermissions struct { } func (*awsRestjson1_deserializeOpDescribeTopicPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTopicPermissions) 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_deserializeOpErrorDescribeTopicPermissions(response, &metadata) } output := &DescribeTopicPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTopicPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTopicPermissionsOutput(&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_deserializeOpErrorDescribeTopicPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTopicPermissionsOutput(v *DescribeTopicPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTopicPermissionsOutput(v **DescribeTopicPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTopicPermissionsOutput if *v == nil { sv = &DescribeTopicPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTopicRefresh struct { } func (*awsRestjson1_deserializeOpDescribeTopicRefresh) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTopicRefresh) 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_deserializeOpErrorDescribeTopicRefresh(response, &metadata) } output := &DescribeTopicRefreshOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTopicRefreshOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTopicRefreshOutput(&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_deserializeOpErrorDescribeTopicRefresh(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTopicRefreshOutput(v *DescribeTopicRefreshOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTopicRefreshOutput(v **DescribeTopicRefreshOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTopicRefreshOutput if *v == nil { sv = &DescribeTopicRefreshOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RefreshDetails": if err := awsRestjson1_deserializeDocumentTopicRefreshDetails(&sv.RefreshDetails, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeTopicRefreshSchedule struct { } func (*awsRestjson1_deserializeOpDescribeTopicRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeTopicRefreshSchedule) 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_deserializeOpErrorDescribeTopicRefreshSchedule(response, &metadata) } output := &DescribeTopicRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeTopicRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeTopicRefreshScheduleOutput(&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_deserializeOpErrorDescribeTopicRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeTopicRefreshScheduleOutput(v *DescribeTopicRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeTopicRefreshScheduleOutput(v **DescribeTopicRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTopicRefreshScheduleOutput if *v == nil { sv = &DescribeTopicRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DatasetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DatasetArn = ptr.String(jtv) } case "RefreshSchedule": if err := awsRestjson1_deserializeDocumentTopicRefreshSchedule(&sv.RefreshSchedule, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeUser struct { } func (*awsRestjson1_deserializeOpDescribeUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeUser) 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_deserializeOpErrorDescribeUser(response, &metadata) } output := &DescribeUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsDescribeUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentDescribeUserOutput(&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_deserializeOpErrorDescribeUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsDescribeUserOutput(v *DescribeUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentDescribeUserOutput(v **DescribeUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeUserOutput if *v == nil { sv = &DescribeUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "User": if err := awsRestjson1_deserializeDocumentUser(&sv.User, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeVPCConnection struct { } func (*awsRestjson1_deserializeOpDescribeVPCConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeVPCConnection) 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_deserializeOpErrorDescribeVPCConnection(response, &metadata) } output := &DescribeVPCConnectionOutput{} 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_deserializeOpDocumentDescribeVPCConnectionOutput(&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_deserializeOpErrorDescribeVPCConnection(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeVPCConnectionOutput(v **DescribeVPCConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeVPCConnectionOutput if *v == nil { sv = &DescribeVPCConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Status = int32(i64) } case "VPCConnection": if err := awsRestjson1_deserializeDocumentVPCConnection(&sv.VPCConnection, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGenerateEmbedUrlForAnonymousUser struct { } func (*awsRestjson1_deserializeOpGenerateEmbedUrlForAnonymousUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGenerateEmbedUrlForAnonymousUser) 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_deserializeOpErrorGenerateEmbedUrlForAnonymousUser(response, &metadata) } output := &GenerateEmbedUrlForAnonymousUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsGenerateEmbedUrlForAnonymousUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentGenerateEmbedUrlForAnonymousUserOutput(&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_deserializeOpErrorGenerateEmbedUrlForAnonymousUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("SessionLifetimeInMinutesInvalidException", errorCode): return awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedPricingPlanException", errorCode): return awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsGenerateEmbedUrlForAnonymousUserOutput(v *GenerateEmbedUrlForAnonymousUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentGenerateEmbedUrlForAnonymousUserOutput(v **GenerateEmbedUrlForAnonymousUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GenerateEmbedUrlForAnonymousUserOutput if *v == nil { sv = &GenerateEmbedUrlForAnonymousUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnonymousUserArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.AnonymousUserArn = ptr.String(jtv) } case "EmbedUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EmbeddingUrl to be of type string, got %T instead", value) } sv.EmbedUrl = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGenerateEmbedUrlForRegisteredUser struct { } func (*awsRestjson1_deserializeOpGenerateEmbedUrlForRegisteredUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGenerateEmbedUrlForRegisteredUser) 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_deserializeOpErrorGenerateEmbedUrlForRegisteredUser(response, &metadata) } output := &GenerateEmbedUrlForRegisteredUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsGenerateEmbedUrlForRegisteredUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentGenerateEmbedUrlForRegisteredUserOutput(&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_deserializeOpErrorGenerateEmbedUrlForRegisteredUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("QuickSightUserNotFoundException", errorCode): return awsRestjson1_deserializeErrorQuickSightUserNotFoundException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("SessionLifetimeInMinutesInvalidException", errorCode): return awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedPricingPlanException", errorCode): return awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsGenerateEmbedUrlForRegisteredUserOutput(v *GenerateEmbedUrlForRegisteredUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentGenerateEmbedUrlForRegisteredUserOutput(v **GenerateEmbedUrlForRegisteredUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GenerateEmbedUrlForRegisteredUserOutput if *v == nil { sv = &GenerateEmbedUrlForRegisteredUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EmbedUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EmbeddingUrl to be of type string, got %T instead", value) } sv.EmbedUrl = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetDashboardEmbedUrl struct { } func (*awsRestjson1_deserializeOpGetDashboardEmbedUrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetDashboardEmbedUrl) 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_deserializeOpErrorGetDashboardEmbedUrl(response, &metadata) } output := &GetDashboardEmbedUrlOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsGetDashboardEmbedUrlOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentGetDashboardEmbedUrlOutput(&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_deserializeOpErrorGetDashboardEmbedUrl(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("DomainNotWhitelistedException", errorCode): return awsRestjson1_deserializeErrorDomainNotWhitelistedException(response, errorBody) case strings.EqualFold("IdentityTypeNotSupportedException", errorCode): return awsRestjson1_deserializeErrorIdentityTypeNotSupportedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("QuickSightUserNotFoundException", errorCode): return awsRestjson1_deserializeErrorQuickSightUserNotFoundException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("SessionLifetimeInMinutesInvalidException", errorCode): return awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedPricingPlanException", errorCode): return awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsGetDashboardEmbedUrlOutput(v *GetDashboardEmbedUrlOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentGetDashboardEmbedUrlOutput(v **GetDashboardEmbedUrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDashboardEmbedUrlOutput if *v == nil { sv = &GetDashboardEmbedUrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EmbedUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EmbeddingUrl to be of type string, got %T instead", value) } sv.EmbedUrl = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetSessionEmbedUrl struct { } func (*awsRestjson1_deserializeOpGetSessionEmbedUrl) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetSessionEmbedUrl) 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_deserializeOpErrorGetSessionEmbedUrl(response, &metadata) } output := &GetSessionEmbedUrlOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsGetSessionEmbedUrlOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentGetSessionEmbedUrlOutput(&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_deserializeOpErrorGetSessionEmbedUrl(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("QuickSightUserNotFoundException", errorCode): return awsRestjson1_deserializeErrorQuickSightUserNotFoundException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("SessionLifetimeInMinutesInvalidException", errorCode): return awsRestjson1_deserializeErrorSessionLifetimeInMinutesInvalidException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsGetSessionEmbedUrlOutput(v *GetSessionEmbedUrlOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentGetSessionEmbedUrlOutput(v **GetSessionEmbedUrlOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetSessionEmbedUrlOutput if *v == nil { sv = &GetSessionEmbedUrlOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EmbedUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EmbeddingUrl to be of type string, got %T instead", value) } sv.EmbedUrl = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAnalyses struct { } func (*awsRestjson1_deserializeOpListAnalyses) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAnalyses) 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_deserializeOpErrorListAnalyses(response, &metadata) } output := &ListAnalysesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListAnalysesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListAnalysesOutput(&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_deserializeOpErrorListAnalyses(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListAnalysesOutput(v *ListAnalysesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListAnalysesOutput(v **ListAnalysesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAnalysesOutput if *v == nil { sv = &ListAnalysesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisSummaryList": if err := awsRestjson1_deserializeDocumentAnalysisSummaryList(&sv.AnalysisSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAssetBundleExportJobs struct { } func (*awsRestjson1_deserializeOpListAssetBundleExportJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAssetBundleExportJobs) 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_deserializeOpErrorListAssetBundleExportJobs(response, &metadata) } output := &ListAssetBundleExportJobsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListAssetBundleExportJobsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListAssetBundleExportJobsOutput(&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_deserializeOpErrorListAssetBundleExportJobs(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListAssetBundleExportJobsOutput(v *ListAssetBundleExportJobsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListAssetBundleExportJobsOutput(v **ListAssetBundleExportJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAssetBundleExportJobsOutput if *v == nil { sv = &ListAssetBundleExportJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssetBundleExportJobSummaryList": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobSummaryList(&sv.AssetBundleExportJobSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListAssetBundleImportJobs struct { } func (*awsRestjson1_deserializeOpListAssetBundleImportJobs) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListAssetBundleImportJobs) 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_deserializeOpErrorListAssetBundleImportJobs(response, &metadata) } output := &ListAssetBundleImportJobsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListAssetBundleImportJobsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListAssetBundleImportJobsOutput(&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_deserializeOpErrorListAssetBundleImportJobs(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListAssetBundleImportJobsOutput(v *ListAssetBundleImportJobsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListAssetBundleImportJobsOutput(v **ListAssetBundleImportJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAssetBundleImportJobsOutput if *v == nil { sv = &ListAssetBundleImportJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssetBundleImportJobSummaryList": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobSummaryList(&sv.AssetBundleImportJobSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDashboards struct { } func (*awsRestjson1_deserializeOpListDashboards) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDashboards) 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_deserializeOpErrorListDashboards(response, &metadata) } output := &ListDashboardsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListDashboardsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListDashboardsOutput(&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_deserializeOpErrorListDashboards(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListDashboardsOutput(v *ListDashboardsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDashboardsOutput if *v == nil { sv = &ListDashboardsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardSummaryList": if err := awsRestjson1_deserializeDocumentDashboardSummaryList(&sv.DashboardSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDashboardVersions struct { } func (*awsRestjson1_deserializeOpListDashboardVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDashboardVersions) 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_deserializeOpErrorListDashboardVersions(response, &metadata) } output := &ListDashboardVersionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListDashboardVersionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListDashboardVersionsOutput(&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_deserializeOpErrorListDashboardVersions(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListDashboardVersionsOutput(v *ListDashboardVersionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListDashboardVersionsOutput(v **ListDashboardVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDashboardVersionsOutput if *v == nil { sv = &ListDashboardVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardVersionSummaryList": if err := awsRestjson1_deserializeDocumentDashboardVersionSummaryList(&sv.DashboardVersionSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDataSets struct { } func (*awsRestjson1_deserializeOpListDataSets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDataSets) 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_deserializeOpErrorListDataSets(response, &metadata) } output := &ListDataSetsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListDataSetsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListDataSetsOutput(&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_deserializeOpErrorListDataSets(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListDataSetsOutput(v *ListDataSetsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListDataSetsOutput(v **ListDataSetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDataSetsOutput if *v == nil { sv = &ListDataSetsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetSummaries": if err := awsRestjson1_deserializeDocumentDataSetSummaryList(&sv.DataSetSummaries, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListDataSources struct { } func (*awsRestjson1_deserializeOpListDataSources) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDataSources) 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_deserializeOpErrorListDataSources(response, &metadata) } output := &ListDataSourcesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListDataSourcesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListDataSourcesOutput(&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_deserializeOpErrorListDataSources(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListDataSourcesOutput(v *ListDataSourcesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListDataSourcesOutput(v **ListDataSourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDataSourcesOutput if *v == nil { sv = &ListDataSourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSources": if err := awsRestjson1_deserializeDocumentDataSourceList(&sv.DataSources, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFolderMembers struct { } func (*awsRestjson1_deserializeOpListFolderMembers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFolderMembers) 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_deserializeOpErrorListFolderMembers(response, &metadata) } output := &ListFolderMembersOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListFolderMembersOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListFolderMembersOutput(&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_deserializeOpErrorListFolderMembers(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListFolderMembersOutput(v *ListFolderMembersOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListFolderMembersOutput(v **ListFolderMembersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFolderMembersOutput if *v == nil { sv = &ListFolderMembersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FolderMemberList": if err := awsRestjson1_deserializeDocumentFolderMemberList(&sv.FolderMemberList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListFolders struct { } func (*awsRestjson1_deserializeOpListFolders) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListFolders) 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_deserializeOpErrorListFolders(response, &metadata) } output := &ListFoldersOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListFoldersOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListFoldersOutput(&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_deserializeOpErrorListFolders(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListFoldersOutput(v *ListFoldersOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListFoldersOutput(v **ListFoldersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListFoldersOutput if *v == nil { sv = &ListFoldersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FolderSummaryList": if err := awsRestjson1_deserializeDocumentFolderSummaryList(&sv.FolderSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListGroupMemberships struct { } func (*awsRestjson1_deserializeOpListGroupMemberships) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListGroupMemberships) 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_deserializeOpErrorListGroupMemberships(response, &metadata) } output := &ListGroupMembershipsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListGroupMembershipsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListGroupMembershipsOutput(&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_deserializeOpErrorListGroupMemberships(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListGroupMembershipsOutput(v *ListGroupMembershipsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListGroupMembershipsOutput(v **ListGroupMembershipsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListGroupMembershipsOutput if *v == nil { sv = &ListGroupMembershipsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "GroupMemberList": if err := awsRestjson1_deserializeDocumentGroupMemberList(&sv.GroupMemberList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListGroups struct { } func (*awsRestjson1_deserializeOpListGroups) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListGroups) 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_deserializeOpErrorListGroups(response, &metadata) } output := &ListGroupsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListGroupsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListGroupsOutput(&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_deserializeOpErrorListGroups(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListGroupsOutput(v *ListGroupsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListGroupsOutput(v **ListGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListGroupsOutput if *v == nil { sv = &ListGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "GroupList": if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListIAMPolicyAssignments struct { } func (*awsRestjson1_deserializeOpListIAMPolicyAssignments) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListIAMPolicyAssignments) 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_deserializeOpErrorListIAMPolicyAssignments(response, &metadata) } output := &ListIAMPolicyAssignmentsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListIAMPolicyAssignmentsOutput(&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_deserializeOpErrorListIAMPolicyAssignments(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsOutput(v *ListIAMPolicyAssignmentsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsOutput(v **ListIAMPolicyAssignmentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListIAMPolicyAssignmentsOutput if *v == nil { sv = &ListIAMPolicyAssignmentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "IAMPolicyAssignments": if err := awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummaryList(&sv.IAMPolicyAssignments, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListIAMPolicyAssignmentsForUser struct { } func (*awsRestjson1_deserializeOpListIAMPolicyAssignmentsForUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListIAMPolicyAssignmentsForUser) 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_deserializeOpErrorListIAMPolicyAssignmentsForUser(response, &metadata) } output := &ListIAMPolicyAssignmentsForUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsForUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListIAMPolicyAssignmentsForUserOutput(&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_deserializeOpErrorListIAMPolicyAssignmentsForUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentUpdatingException", errorCode): return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListIAMPolicyAssignmentsForUserOutput(v *ListIAMPolicyAssignmentsForUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListIAMPolicyAssignmentsForUserOutput(v **ListIAMPolicyAssignmentsForUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListIAMPolicyAssignmentsForUserOutput if *v == nil { sv = &ListIAMPolicyAssignmentsForUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveAssignments": if err := awsRestjson1_deserializeDocumentActiveIAMPolicyAssignmentList(&sv.ActiveAssignments, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListIngestions struct { } func (*awsRestjson1_deserializeOpListIngestions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListIngestions) 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_deserializeOpErrorListIngestions(response, &metadata) } output := &ListIngestionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListIngestionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListIngestionsOutput(&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_deserializeOpErrorListIngestions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListIngestionsOutput(v *ListIngestionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListIngestionsOutput(v **ListIngestionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListIngestionsOutput if *v == nil { sv = &ListIngestionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Ingestions": if err := awsRestjson1_deserializeDocumentIngestions(&sv.Ingestions, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListNamespaces struct { } func (*awsRestjson1_deserializeOpListNamespaces) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListNamespaces) 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_deserializeOpErrorListNamespaces(response, &metadata) } output := &ListNamespacesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListNamespacesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListNamespacesOutput(&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_deserializeOpErrorListNamespaces(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListNamespacesOutput(v *ListNamespacesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListNamespacesOutput(v **ListNamespacesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListNamespacesOutput if *v == nil { sv = &ListNamespacesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Namespaces": if err := awsRestjson1_deserializeDocumentNamespaces(&sv.Namespaces, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListRefreshSchedules struct { } func (*awsRestjson1_deserializeOpListRefreshSchedules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListRefreshSchedules) 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_deserializeOpErrorListRefreshSchedules(response, &metadata) } output := &ListRefreshSchedulesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListRefreshSchedulesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListRefreshSchedulesOutput(&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_deserializeOpErrorListRefreshSchedules(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListRefreshSchedulesOutput(v *ListRefreshSchedulesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListRefreshSchedulesOutput(v **ListRefreshSchedulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListRefreshSchedulesOutput if *v == nil { sv = &ListRefreshSchedulesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RefreshSchedules": if err := awsRestjson1_deserializeDocumentRefreshSchedules(&sv.RefreshSchedules, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListTagsForResourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListTagsForResourceOutput(v *ListTagsForResourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTemplateAliases struct { } func (*awsRestjson1_deserializeOpListTemplateAliases) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTemplateAliases) 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_deserializeOpErrorListTemplateAliases(response, &metadata) } output := &ListTemplateAliasesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListTemplateAliasesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListTemplateAliasesOutput(&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_deserializeOpErrorListTemplateAliases(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListTemplateAliasesOutput(v *ListTemplateAliasesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListTemplateAliasesOutput(v **ListTemplateAliasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTemplateAliasesOutput if *v == nil { sv = &ListTemplateAliasesOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateAliasList": if err := awsRestjson1_deserializeDocumentTemplateAliasList(&sv.TemplateAliasList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTemplates struct { } func (*awsRestjson1_deserializeOpListTemplates) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTemplates) 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_deserializeOpErrorListTemplates(response, &metadata) } output := &ListTemplatesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListTemplatesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListTemplatesOutput(&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_deserializeOpErrorListTemplates(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListTemplatesOutput(v *ListTemplatesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListTemplatesOutput(v **ListTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTemplatesOutput if *v == nil { sv = &ListTemplatesOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateSummaryList": if err := awsRestjson1_deserializeDocumentTemplateSummaryList(&sv.TemplateSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTemplateVersions struct { } func (*awsRestjson1_deserializeOpListTemplateVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTemplateVersions) 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_deserializeOpErrorListTemplateVersions(response, &metadata) } output := &ListTemplateVersionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListTemplateVersionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListTemplateVersionsOutput(&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_deserializeOpErrorListTemplateVersions(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListTemplateVersionsOutput(v *ListTemplateVersionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListTemplateVersionsOutput(v **ListTemplateVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTemplateVersionsOutput if *v == nil { sv = &ListTemplateVersionsOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateVersionSummaryList": if err := awsRestjson1_deserializeDocumentTemplateVersionSummaryList(&sv.TemplateVersionSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListThemeAliases struct { } func (*awsRestjson1_deserializeOpListThemeAliases) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListThemeAliases) 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_deserializeOpErrorListThemeAliases(response, &metadata) } output := &ListThemeAliasesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListThemeAliasesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListThemeAliasesOutput(&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_deserializeOpErrorListThemeAliases(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListThemeAliasesOutput(v *ListThemeAliasesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListThemeAliasesOutput(v **ListThemeAliasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListThemeAliasesOutput if *v == nil { sv = &ListThemeAliasesOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeAliasList": if err := awsRestjson1_deserializeDocumentThemeAliasList(&sv.ThemeAliasList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListThemes struct { } func (*awsRestjson1_deserializeOpListThemes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListThemes) 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_deserializeOpErrorListThemes(response, &metadata) } output := &ListThemesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListThemesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListThemesOutput(&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_deserializeOpErrorListThemes(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListThemesOutput(v *ListThemesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListThemesOutput(v **ListThemesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListThemesOutput if *v == nil { sv = &ListThemesOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeSummaryList": if err := awsRestjson1_deserializeDocumentThemeSummaryList(&sv.ThemeSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListThemeVersions struct { } func (*awsRestjson1_deserializeOpListThemeVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListThemeVersions) 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_deserializeOpErrorListThemeVersions(response, &metadata) } output := &ListThemeVersionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListThemeVersionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListThemeVersionsOutput(&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_deserializeOpErrorListThemeVersions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListThemeVersionsOutput(v *ListThemeVersionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListThemeVersionsOutput(v **ListThemeVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListThemeVersionsOutput if *v == nil { sv = &ListThemeVersionsOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeVersionSummaryList": if err := awsRestjson1_deserializeDocumentThemeVersionSummaryList(&sv.ThemeVersionSummaryList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTopicRefreshSchedules struct { } func (*awsRestjson1_deserializeOpListTopicRefreshSchedules) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTopicRefreshSchedules) 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_deserializeOpErrorListTopicRefreshSchedules(response, &metadata) } output := &ListTopicRefreshSchedulesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListTopicRefreshSchedulesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListTopicRefreshSchedulesOutput(&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_deserializeOpErrorListTopicRefreshSchedules(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListTopicRefreshSchedulesOutput(v *ListTopicRefreshSchedulesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListTopicRefreshSchedulesOutput(v **ListTopicRefreshSchedulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTopicRefreshSchedulesOutput if *v == nil { sv = &ListTopicRefreshSchedulesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RefreshSchedules": if err := awsRestjson1_deserializeDocumentTopicRefreshScheduleSummaries(&sv.RefreshSchedules, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTopics struct { } func (*awsRestjson1_deserializeOpListTopics) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTopics) 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_deserializeOpErrorListTopics(response, &metadata) } output := &ListTopicsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListTopicsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListTopicsOutput(&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_deserializeOpErrorListTopics(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListTopicsOutput(v *ListTopicsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListTopicsOutput(v **ListTopicsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTopicsOutput if *v == nil { sv = &ListTopicsOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicsSummaries": if err := awsRestjson1_deserializeDocumentTopicSummaries(&sv.TopicsSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListUserGroups struct { } func (*awsRestjson1_deserializeOpListUserGroups) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListUserGroups) 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_deserializeOpErrorListUserGroups(response, &metadata) } output := &ListUserGroupsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListUserGroupsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListUserGroupsOutput(&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_deserializeOpErrorListUserGroups(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListUserGroupsOutput(v *ListUserGroupsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListUserGroupsOutput(v **ListUserGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListUserGroupsOutput if *v == nil { sv = &ListUserGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "GroupList": if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListUsers struct { } func (*awsRestjson1_deserializeOpListUsers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListUsers) 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_deserializeOpErrorListUsers(response, &metadata) } output := &ListUsersOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListUsersOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListUsersOutput(&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_deserializeOpErrorListUsers(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListUsersOutput(v *ListUsersOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListUsersOutput if *v == nil { sv = &ListUsersOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "UserList": if err := awsRestjson1_deserializeDocumentUserList(&sv.UserList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListVPCConnections struct { } func (*awsRestjson1_deserializeOpListVPCConnections) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListVPCConnections) 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_deserializeOpErrorListVPCConnections(response, &metadata) } output := &ListVPCConnectionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsListVPCConnectionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentListVPCConnectionsOutput(&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_deserializeOpErrorListVPCConnections(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsListVPCConnectionsOutput(v *ListVPCConnectionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentListVPCConnectionsOutput(v **ListVPCConnectionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListVPCConnectionsOutput if *v == nil { sv = &ListVPCConnectionsOutput{} } 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 "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "VPCConnectionSummaries": if err := awsRestjson1_deserializeDocumentVPCConnectionSummaryList(&sv.VPCConnectionSummaries, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutDataSetRefreshProperties struct { } func (*awsRestjson1_deserializeOpPutDataSetRefreshProperties) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutDataSetRefreshProperties) 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_deserializeOpErrorPutDataSetRefreshProperties(response, &metadata) } output := &PutDataSetRefreshPropertiesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsPutDataSetRefreshPropertiesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentPutDataSetRefreshPropertiesOutput(&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_deserializeOpErrorPutDataSetRefreshProperties(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsPutDataSetRefreshPropertiesOutput(v *PutDataSetRefreshPropertiesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentPutDataSetRefreshPropertiesOutput(v **PutDataSetRefreshPropertiesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutDataSetRefreshPropertiesOutput if *v == nil { sv = &PutDataSetRefreshPropertiesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRegisterUser struct { } func (*awsRestjson1_deserializeOpRegisterUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRegisterUser) 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_deserializeOpErrorRegisterUser(response, &metadata) } output := &RegisterUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsRegisterUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentRegisterUserOutput(&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_deserializeOpErrorRegisterUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsRegisterUserOutput(v *RegisterUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentRegisterUserOutput(v **RegisterUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RegisterUserOutput if *v == nil { sv = &RegisterUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "User": if err := awsRestjson1_deserializeDocumentUser(&sv.User, value); err != nil { return err } case "UserInvitationUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.UserInvitationUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRestoreAnalysis struct { } func (*awsRestjson1_deserializeOpRestoreAnalysis) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRestoreAnalysis) 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_deserializeOpErrorRestoreAnalysis(response, &metadata) } output := &RestoreAnalysisOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsRestoreAnalysisOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentRestoreAnalysisOutput(&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_deserializeOpErrorRestoreAnalysis(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsRestoreAnalysisOutput(v *RestoreAnalysisOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentRestoreAnalysisOutput(v **RestoreAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *RestoreAnalysisOutput if *v == nil { sv = &RestoreAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSearchAnalyses struct { } func (*awsRestjson1_deserializeOpSearchAnalyses) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchAnalyses) 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_deserializeOpErrorSearchAnalyses(response, &metadata) } output := &SearchAnalysesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsSearchAnalysesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentSearchAnalysesOutput(&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_deserializeOpErrorSearchAnalyses(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsSearchAnalysesOutput(v *SearchAnalysesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentSearchAnalysesOutput(v **SearchAnalysesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchAnalysesOutput if *v == nil { sv = &SearchAnalysesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisSummaryList": if err := awsRestjson1_deserializeDocumentAnalysisSummaryList(&sv.AnalysisSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSearchDashboards struct { } func (*awsRestjson1_deserializeOpSearchDashboards) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchDashboards) 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_deserializeOpErrorSearchDashboards(response, &metadata) } output := &SearchDashboardsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsSearchDashboardsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentSearchDashboardsOutput(&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_deserializeOpErrorSearchDashboards(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("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsSearchDashboardsOutput(v *SearchDashboardsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentSearchDashboardsOutput(v **SearchDashboardsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchDashboardsOutput if *v == nil { sv = &SearchDashboardsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardSummaryList": if err := awsRestjson1_deserializeDocumentDashboardSummaryList(&sv.DashboardSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSearchDataSets struct { } func (*awsRestjson1_deserializeOpSearchDataSets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchDataSets) 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_deserializeOpErrorSearchDataSets(response, &metadata) } output := &SearchDataSetsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsSearchDataSetsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentSearchDataSetsOutput(&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_deserializeOpErrorSearchDataSets(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsSearchDataSetsOutput(v *SearchDataSetsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentSearchDataSetsOutput(v **SearchDataSetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchDataSetsOutput if *v == nil { sv = &SearchDataSetsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetSummaries": if err := awsRestjson1_deserializeDocumentDataSetSummaryList(&sv.DataSetSummaries, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSearchDataSources struct { } func (*awsRestjson1_deserializeOpSearchDataSources) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchDataSources) 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_deserializeOpErrorSearchDataSources(response, &metadata) } output := &SearchDataSourcesOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsSearchDataSourcesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentSearchDataSourcesOutput(&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_deserializeOpErrorSearchDataSources(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsSearchDataSourcesOutput(v *SearchDataSourcesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentSearchDataSourcesOutput(v **SearchDataSourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchDataSourcesOutput if *v == nil { sv = &SearchDataSourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceSummaries": if err := awsRestjson1_deserializeDocumentDataSourceSummaryList(&sv.DataSourceSummaries, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSearchFolders struct { } func (*awsRestjson1_deserializeOpSearchFolders) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchFolders) 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_deserializeOpErrorSearchFolders(response, &metadata) } output := &SearchFoldersOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentSearchFoldersOutput(&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_deserializeOpErrorSearchFolders(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(v *SearchFoldersOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentSearchFoldersOutput(v **SearchFoldersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchFoldersOutput if *v == nil { sv = &SearchFoldersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FolderSummaryList": if err := awsRestjson1_deserializeDocumentFolderSummaryList(&sv.FolderSummaryList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpSearchGroups struct { } func (*awsRestjson1_deserializeOpSearchGroups) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpSearchGroups) 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_deserializeOpErrorSearchGroups(response, &metadata) } output := &SearchGroupsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentSearchGroupsOutput(&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_deserializeOpErrorSearchGroups(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidNextTokenException", errorCode): return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(v *SearchGroupsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentSearchGroupsOutput(v **SearchGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *SearchGroupsOutput if *v == nil { sv = &SearchGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "GroupList": if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, 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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartAssetBundleExportJob struct { } func (*awsRestjson1_deserializeOpStartAssetBundleExportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartAssetBundleExportJob) 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_deserializeOpErrorStartAssetBundleExportJob(response, &metadata) } output := &StartAssetBundleExportJobOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsStartAssetBundleExportJobOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentStartAssetBundleExportJobOutput(&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_deserializeOpErrorStartAssetBundleExportJob(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsStartAssetBundleExportJobOutput(v *StartAssetBundleExportJobOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentStartAssetBundleExportJobOutput(v **StartAssetBundleExportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartAssetBundleExportJobOutput if *v == nil { sv = &StartAssetBundleExportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssetBundleExportJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AssetBundleExportJobId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartAssetBundleImportJob struct { } func (*awsRestjson1_deserializeOpStartAssetBundleImportJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartAssetBundleImportJob) 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_deserializeOpErrorStartAssetBundleImportJob(response, &metadata) } output := &StartAssetBundleImportJobOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsStartAssetBundleImportJobOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentStartAssetBundleImportJobOutput(&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_deserializeOpErrorStartAssetBundleImportJob(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsStartAssetBundleImportJobOutput(v *StartAssetBundleImportJobOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentStartAssetBundleImportJobOutput(v **StartAssetBundleImportJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartAssetBundleImportJobOutput if *v == nil { sv = &StartAssetBundleImportJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssetBundleImportJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AssetBundleImportJobId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartDashboardSnapshotJob struct { } func (*awsRestjson1_deserializeOpStartDashboardSnapshotJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartDashboardSnapshotJob) 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_deserializeOpErrorStartDashboardSnapshotJob(response, &metadata) } output := &StartDashboardSnapshotJobOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsStartDashboardSnapshotJobOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentStartDashboardSnapshotJobOutput(&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_deserializeOpErrorStartDashboardSnapshotJob(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedPricingPlanException", errorCode): return awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsStartDashboardSnapshotJobOutput(v *StartDashboardSnapshotJobOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentStartDashboardSnapshotJobOutput(v **StartDashboardSnapshotJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartDashboardSnapshotJobOutput if *v == nil { sv = &StartDashboardSnapshotJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "SnapshotJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SnapshotJobId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentTagResourceOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(v *TagResourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TagResourceOutput if *v == nil { sv = &TagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUntagResourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUntagResourceOutput(&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_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUntagResourceOutput(v *UntagResourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UntagResourceOutput if *v == nil { sv = &UntagResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateAccountCustomization struct { } func (*awsRestjson1_deserializeOpUpdateAccountCustomization) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateAccountCustomization) 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_deserializeOpErrorUpdateAccountCustomization(response, &metadata) } output := &UpdateAccountCustomizationOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateAccountCustomizationOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateAccountCustomizationOutput(&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_deserializeOpErrorUpdateAccountCustomization(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateAccountCustomizationOutput(v *UpdateAccountCustomizationOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateAccountCustomizationOutput(v **UpdateAccountCustomizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAccountCustomizationOutput if *v == nil { sv = &UpdateAccountCustomizationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AccountCustomization": if err := awsRestjson1_deserializeDocumentAccountCustomization(&sv.AccountCustomization, value); err != nil { return err } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateAccountSettings struct { } func (*awsRestjson1_deserializeOpUpdateAccountSettings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateAccountSettings) 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_deserializeOpErrorUpdateAccountSettings(response, &metadata) } output := &UpdateAccountSettingsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateAccountSettingsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateAccountSettingsOutput(&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_deserializeOpErrorUpdateAccountSettings(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateAccountSettingsOutput(v *UpdateAccountSettingsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateAccountSettingsOutput(v **UpdateAccountSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAccountSettingsOutput if *v == nil { sv = &UpdateAccountSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateAnalysis struct { } func (*awsRestjson1_deserializeOpUpdateAnalysis) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateAnalysis) 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_deserializeOpErrorUpdateAnalysis(response, &metadata) } output := &UpdateAnalysisOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateAnalysisOutput(&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_deserializeOpErrorUpdateAnalysis(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisOutput(v *UpdateAnalysisOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateAnalysisOutput(v **UpdateAnalysisOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAnalysisOutput if *v == nil { sv = &UpdateAnalysisOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "UpdateStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.UpdateStatus = types.ResourceStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateAnalysisPermissions struct { } func (*awsRestjson1_deserializeOpUpdateAnalysisPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateAnalysisPermissions) 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_deserializeOpErrorUpdateAnalysisPermissions(response, &metadata) } output := &UpdateAnalysisPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateAnalysisPermissionsOutput(&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_deserializeOpErrorUpdateAnalysisPermissions(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateAnalysisPermissionsOutput(v *UpdateAnalysisPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateAnalysisPermissionsOutput(v **UpdateAnalysisPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAnalysisPermissionsOutput if *v == nil { sv = &UpdateAnalysisPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.AnalysisArn = ptr.String(jtv) } case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDashboard struct { } func (*awsRestjson1_deserializeOpUpdateDashboard) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDashboard) 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_deserializeOpErrorUpdateDashboard(response, &metadata) } output := &UpdateDashboardOutput{} 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_deserializeOpDocumentUpdateDashboardOutput(&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_deserializeOpErrorUpdateDashboard(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateDashboardOutput(v **UpdateDashboardOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDashboardOutput if *v == nil { sv = &UpdateDashboardOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Status = int32(i64) } case "VersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VersionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDashboardPermissions struct { } func (*awsRestjson1_deserializeOpUpdateDashboardPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDashboardPermissions) 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_deserializeOpErrorUpdateDashboardPermissions(response, &metadata) } output := &UpdateDashboardPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateDashboardPermissionsOutput(&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_deserializeOpErrorUpdateDashboardPermissions(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPermissionsOutput(v *UpdateDashboardPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateDashboardPermissionsOutput(v **UpdateDashboardPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDashboardPermissionsOutput if *v == nil { sv = &UpdateDashboardPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DashboardArn = ptr.String(jtv) } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "LinkSharingConfiguration": if err := awsRestjson1_deserializeDocumentLinkSharingConfiguration(&sv.LinkSharingConfiguration, value); err != nil { return err } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDashboardPublishedVersion struct { } func (*awsRestjson1_deserializeOpUpdateDashboardPublishedVersion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDashboardPublishedVersion) 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_deserializeOpErrorUpdateDashboardPublishedVersion(response, &metadata) } output := &UpdateDashboardPublishedVersionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPublishedVersionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateDashboardPublishedVersionOutput(&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_deserializeOpErrorUpdateDashboardPublishedVersion(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateDashboardPublishedVersionOutput(v *UpdateDashboardPublishedVersionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateDashboardPublishedVersionOutput(v **UpdateDashboardPublishedVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDashboardPublishedVersionOutput if *v == nil { sv = &UpdateDashboardPublishedVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DashboardArn = ptr.String(jtv) } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDataSet struct { } func (*awsRestjson1_deserializeOpUpdateDataSet) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDataSet) 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_deserializeOpErrorUpdateDataSet(response, &metadata) } output := &UpdateDataSetOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSetOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateDataSetOutput(&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_deserializeOpErrorUpdateDataSet(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateDataSetOutput(v *UpdateDataSetOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateDataSetOutput(v **UpdateDataSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDataSetOutput if *v == nil { sv = &UpdateDataSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "IngestionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.IngestionArn = ptr.String(jtv) } case "IngestionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.IngestionId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDataSetPermissions struct { } func (*awsRestjson1_deserializeOpUpdateDataSetPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDataSetPermissions) 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_deserializeOpErrorUpdateDataSetPermissions(response, &metadata) } output := &UpdateDataSetPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSetPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateDataSetPermissionsOutput(&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_deserializeOpErrorUpdateDataSetPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateDataSetPermissionsOutput(v *UpdateDataSetPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateDataSetPermissionsOutput(v **UpdateDataSetPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDataSetPermissionsOutput if *v == nil { sv = &UpdateDataSetPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSetArn = ptr.String(jtv) } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDataSource struct { } func (*awsRestjson1_deserializeOpUpdateDataSource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDataSource) 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_deserializeOpErrorUpdateDataSource(response, &metadata) } output := &UpdateDataSourceOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSourceOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateDataSourceOutput(&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_deserializeOpErrorUpdateDataSource(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateDataSourceOutput(v *UpdateDataSourceOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDataSourceOutput if *v == nil { sv = &UpdateDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "UpdateStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.UpdateStatus = types.ResourceStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateDataSourcePermissions struct { } func (*awsRestjson1_deserializeOpUpdateDataSourcePermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateDataSourcePermissions) 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_deserializeOpErrorUpdateDataSourcePermissions(response, &metadata) } output := &UpdateDataSourcePermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateDataSourcePermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateDataSourcePermissionsOutput(&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_deserializeOpErrorUpdateDataSourcePermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateDataSourcePermissionsOutput(v *UpdateDataSourcePermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateDataSourcePermissionsOutput(v **UpdateDataSourcePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDataSourcePermissionsOutput if *v == nil { sv = &UpdateDataSourcePermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSourceArn = ptr.String(jtv) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateFolder struct { } func (*awsRestjson1_deserializeOpUpdateFolder) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateFolder) 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_deserializeOpErrorUpdateFolder(response, &metadata) } output := &UpdateFolderOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateFolderOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateFolderOutput(&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_deserializeOpErrorUpdateFolder(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateFolderOutput(v *UpdateFolderOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateFolderOutput(v **UpdateFolderOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateFolderOutput if *v == nil { sv = &UpdateFolderOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateFolderPermissions struct { } func (*awsRestjson1_deserializeOpUpdateFolderPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateFolderPermissions) 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_deserializeOpErrorUpdateFolderPermissions(response, &metadata) } output := &UpdateFolderPermissionsOutput{} 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_deserializeOpDocumentUpdateFolderPermissionsOutput(&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_deserializeOpErrorUpdateFolderPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateFolderPermissionsOutput(v **UpdateFolderPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateFolderPermissionsOutput if *v == nil { sv = &UpdateFolderPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected StatusCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Status = int32(i64) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateGroup struct { } func (*awsRestjson1_deserializeOpUpdateGroup) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateGroup) 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_deserializeOpErrorUpdateGroup(response, &metadata) } output := &UpdateGroupOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateGroupOutput(&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_deserializeOpErrorUpdateGroup(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateGroupOutput(v *UpdateGroupOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateGroupOutput if *v == nil { sv = &UpdateGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Group": if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateIAMPolicyAssignment struct { } func (*awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateIAMPolicyAssignment) 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_deserializeOpErrorUpdateIAMPolicyAssignment(response, &metadata) } output := &UpdateIAMPolicyAssignmentOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(&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_deserializeOpErrorUpdateIAMPolicyAssignment(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConcurrentUpdatingException", errorCode): return awsRestjson1_deserializeErrorConcurrentUpdatingException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateIAMPolicyAssignmentOutput(v *UpdateIAMPolicyAssignmentOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateIAMPolicyAssignmentOutput(v **UpdateIAMPolicyAssignmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateIAMPolicyAssignmentOutput if *v == nil { sv = &UpdateIAMPolicyAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AssignmentId = ptr.String(jtv) } case "AssignmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) } sv.AssignmentName = ptr.String(jtv) } case "AssignmentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) } sv.AssignmentStatus = types.AssignmentStatus(jtv) } case "Identities": if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil { return err } case "PolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.PolicyArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateIpRestriction struct { } func (*awsRestjson1_deserializeOpUpdateIpRestriction) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateIpRestriction) 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_deserializeOpErrorUpdateIpRestriction(response, &metadata) } output := &UpdateIpRestrictionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateIpRestrictionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateIpRestrictionOutput(&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_deserializeOpErrorUpdateIpRestriction(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateIpRestrictionOutput(v *UpdateIpRestrictionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateIpRestrictionOutput(v **UpdateIpRestrictionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateIpRestrictionOutput if *v == nil { sv = &UpdateIpRestrictionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdatePublicSharingSettings struct { } func (*awsRestjson1_deserializeOpUpdatePublicSharingSettings) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdatePublicSharingSettings) 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_deserializeOpErrorUpdatePublicSharingSettings(response, &metadata) } output := &UpdatePublicSharingSettingsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdatePublicSharingSettingsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdatePublicSharingSettingsOutput(&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_deserializeOpErrorUpdatePublicSharingSettings(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedPricingPlanException", errorCode): return awsRestjson1_deserializeErrorUnsupportedPricingPlanException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdatePublicSharingSettingsOutput(v *UpdatePublicSharingSettingsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdatePublicSharingSettingsOutput(v **UpdatePublicSharingSettingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdatePublicSharingSettingsOutput if *v == nil { sv = &UpdatePublicSharingSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateRefreshSchedule struct { } func (*awsRestjson1_deserializeOpUpdateRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateRefreshSchedule) 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_deserializeOpErrorUpdateRefreshSchedule(response, &metadata) } output := &UpdateRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateRefreshScheduleOutput(&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_deserializeOpErrorUpdateRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateRefreshScheduleOutput(v *UpdateRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateRefreshScheduleOutput(v **UpdateRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateRefreshScheduleOutput if *v == nil { sv = &UpdateRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ScheduleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScheduleId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTemplate struct { } func (*awsRestjson1_deserializeOpUpdateTemplate) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTemplate) 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_deserializeOpErrorUpdateTemplate(response, &metadata) } output := &UpdateTemplateOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateTemplateOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateTemplateOutput(&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_deserializeOpErrorUpdateTemplate(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateTemplateOutput(v *UpdateTemplateOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateTemplateOutput(v **UpdateTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTemplateOutput if *v == nil { sv = &UpdateTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } case "VersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VersionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTemplateAlias struct { } func (*awsRestjson1_deserializeOpUpdateTemplateAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTemplateAlias) 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_deserializeOpErrorUpdateTemplateAlias(response, &metadata) } output := &UpdateTemplateAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateTemplateAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateTemplateAliasOutput(&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_deserializeOpErrorUpdateTemplateAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateTemplateAliasOutput(v *UpdateTemplateAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateTemplateAliasOutput(v **UpdateTemplateAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTemplateAliasOutput if *v == nil { sv = &UpdateTemplateAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateAlias": if err := awsRestjson1_deserializeDocumentTemplateAlias(&sv.TemplateAlias, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTemplatePermissions struct { } func (*awsRestjson1_deserializeOpUpdateTemplatePermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTemplatePermissions) 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_deserializeOpErrorUpdateTemplatePermissions(response, &metadata) } output := &UpdateTemplatePermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateTemplatePermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateTemplatePermissionsOutput(&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_deserializeOpErrorUpdateTemplatePermissions(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateTemplatePermissionsOutput(v *UpdateTemplatePermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateTemplatePermissionsOutput(v **UpdateTemplatePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTemplatePermissionsOutput if *v == nil { sv = &UpdateTemplatePermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TemplateArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TemplateArn = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTheme struct { } func (*awsRestjson1_deserializeOpUpdateTheme) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTheme) 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_deserializeOpErrorUpdateTheme(response, &metadata) } output := &UpdateThemeOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateThemeOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateThemeOutput(&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_deserializeOpErrorUpdateTheme(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateThemeOutput(v *UpdateThemeOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateThemeOutput(v **UpdateThemeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateThemeOutput if *v == nil { sv = &UpdateThemeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.ResourceStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } case "VersionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VersionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateThemeAlias struct { } func (*awsRestjson1_deserializeOpUpdateThemeAlias) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateThemeAlias) 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_deserializeOpErrorUpdateThemeAlias(response, &metadata) } output := &UpdateThemeAliasOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateThemeAliasOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateThemeAliasOutput(&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_deserializeOpErrorUpdateThemeAlias(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("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateThemeAliasOutput(v *UpdateThemeAliasOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateThemeAliasOutput(v **UpdateThemeAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateThemeAliasOutput if *v == nil { sv = &UpdateThemeAliasOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeAlias": if err := awsRestjson1_deserializeDocumentThemeAlias(&sv.ThemeAlias, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateThemePermissions struct { } func (*awsRestjson1_deserializeOpUpdateThemePermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateThemePermissions) 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_deserializeOpErrorUpdateThemePermissions(response, &metadata) } output := &UpdateThemePermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateThemePermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateThemePermissionsOutput(&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_deserializeOpErrorUpdateThemePermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateThemePermissionsOutput(v *UpdateThemePermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateThemePermissionsOutput(v **UpdateThemePermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateThemePermissionsOutput if *v == nil { sv = &UpdateThemePermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTopic struct { } func (*awsRestjson1_deserializeOpUpdateTopic) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTopic) 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_deserializeOpErrorUpdateTopic(response, &metadata) } output := &UpdateTopicOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateTopicOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateTopicOutput(&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_deserializeOpErrorUpdateTopic(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateTopicOutput(v *UpdateTopicOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateTopicOutput(v **UpdateTopicOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTopicOutput if *v == nil { sv = &UpdateTopicOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RefreshArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RefreshArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTopicPermissions struct { } func (*awsRestjson1_deserializeOpUpdateTopicPermissions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTopicPermissions) 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_deserializeOpErrorUpdateTopicPermissions(response, &metadata) } output := &UpdateTopicPermissionsOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateTopicPermissionsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateTopicPermissionsOutput(&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_deserializeOpErrorUpdateTopicPermissions(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateTopicPermissionsOutput(v *UpdateTopicPermissionsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateTopicPermissionsOutput(v **UpdateTopicPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTopicPermissionsOutput if *v == nil { sv = &UpdateTopicPermissionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateTopicRefreshSchedule struct { } func (*awsRestjson1_deserializeOpUpdateTopicRefreshSchedule) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateTopicRefreshSchedule) 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_deserializeOpErrorUpdateTopicRefreshSchedule(response, &metadata) } output := &UpdateTopicRefreshScheduleOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateTopicRefreshScheduleOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateTopicRefreshScheduleOutput(&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_deserializeOpErrorUpdateTopicRefreshSchedule(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceExistsException", errorCode): return awsRestjson1_deserializeErrorResourceExistsException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateTopicRefreshScheduleOutput(v *UpdateTopicRefreshScheduleOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateTopicRefreshScheduleOutput(v **UpdateTopicRefreshScheduleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateTopicRefreshScheduleOutput if *v == nil { sv = &UpdateTopicRefreshScheduleOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DatasetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DatasetArn = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "TopicArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateUser struct { } func (*awsRestjson1_deserializeOpUpdateUser) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateUser) 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_deserializeOpErrorUpdateUser(response, &metadata) } output := &UpdateUserOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateUserOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateUserOutput(&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_deserializeOpErrorUpdateUser(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("PreconditionNotMetException", errorCode): return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ResourceUnavailableException", errorCode): return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateUserOutput(v *UpdateUserOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateUserOutput(v **UpdateUserOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateUserOutput if *v == nil { sv = &UpdateUserOutput{} } else { sv = *v } for key, value := range shape { switch key { case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "User": if err := awsRestjson1_deserializeDocumentUser(&sv.User, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateVPCConnection struct { } func (*awsRestjson1_deserializeOpUpdateVPCConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateVPCConnection) 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_deserializeOpErrorUpdateVPCConnection(response, &metadata) } output := &UpdateVPCConnectionOutput{} out.Result = output err = awsRestjson1_deserializeOpHttpBindingsUpdateVPCConnectionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } 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_deserializeOpDocumentUpdateVPCConnectionOutput(&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_deserializeOpErrorUpdateVPCConnection(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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnsupportedUserEditionException", errorCode): return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpHttpBindingsUpdateVPCConnectionOutput(v *UpdateVPCConnectionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } v.Status = int32(response.StatusCode) return nil } func awsRestjson1_deserializeOpDocumentUpdateVPCConnectionOutput(v **UpdateVPCConnectionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateVPCConnectionOutput if *v == nil { sv = &UpdateVPCConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionAvailabilityStatus to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.VPCConnectionAvailabilityStatus(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "UpdateStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceStatus to be of type string, got %T instead", value) } sv.UpdateStatus = types.VPCConnectionResourceStatus(jtv) } case "VPCConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceIdUnrestricted to be of type string, got %T instead", value) } sv.VPCConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorConcurrentUpdatingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConcurrentUpdatingException{} 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_deserializeDocumentConcurrentUpdatingException(&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_deserializeErrorDomainNotWhitelistedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.DomainNotWhitelistedException{} 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_deserializeDocumentDomainNotWhitelistedException(&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_deserializeErrorIdentityTypeNotSupportedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.IdentityTypeNotSupportedException{} 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_deserializeDocumentIdentityTypeNotSupportedException(&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_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalFailureException{} 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_deserializeDocumentInternalFailureException(&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_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidNextTokenException{} 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_deserializeDocumentInvalidNextTokenException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidParameterValueException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.LimitExceededException{} 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_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorPreconditionNotMetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.PreconditionNotMetException{} 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_deserializeDocumentPreconditionNotMetException(&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_deserializeErrorQuickSightUserNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.QuickSightUserNotFoundException{} 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_deserializeDocumentQuickSightUserNotFoundException(&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_deserializeErrorResourceExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceExistsException{} 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_deserializeDocumentResourceExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceUnavailableException{} 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_deserializeDocumentResourceUnavailableException(&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_deserializeErrorSessionLifetimeInMinutesInvalidException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.SessionLifetimeInMinutesInvalidException{} 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_deserializeDocumentSessionLifetimeInMinutesInvalidException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} 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_deserializeDocumentThrottlingException(&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_deserializeErrorUnsupportedPricingPlanException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnsupportedPricingPlanException{} 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_deserializeDocumentUnsupportedPricingPlanException(&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_deserializeErrorUnsupportedUserEditionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnsupportedUserEditionException{} 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_deserializeDocumentUnsupportedUserEditionException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountCustomization(v **types.AccountCustomization, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountCustomization if *v == nil { sv = &types.AccountCustomization{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultEmailCustomizationTemplate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DefaultEmailCustomizationTemplate = ptr.String(jtv) } case "DefaultTheme": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DefaultTheme = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountInfo(v **types.AccountInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountInfo if *v == nil { sv = &types.AccountInfo{} } else { sv = *v } for key, value := range shape { switch key { case "AccountName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AccountName = ptr.String(jtv) } case "AccountSubscriptionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AccountSubscriptionStatus = ptr.String(jtv) } case "AuthenticationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AuthenticationType = ptr.String(jtv) } case "Edition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Edition to be of type string, got %T instead", value) } sv.Edition = types.Edition(jtv) } case "NotificationEmail": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NotificationEmail = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAccountSettings(v **types.AccountSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AccountSettings if *v == nil { sv = &types.AccountSettings{} } else { sv = *v } for key, value := range shape { switch key { case "AccountName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AccountName = ptr.String(jtv) } case "DefaultNamespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.DefaultNamespace = ptr.String(jtv) } case "Edition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Edition to be of type string, got %T instead", value) } sv.Edition = types.Edition(jtv) } case "NotificationEmail": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NotificationEmail = ptr.String(jtv) } case "PublicSharingEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PublicSharingEnabled = jtv } case "TerminationProtectionEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.TerminationProtectionEnabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActionList(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_deserializeDocumentActiveIAMPolicyAssignment(v **types.ActiveIAMPolicyAssignment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ActiveIAMPolicyAssignment if *v == nil { sv = &types.ActiveIAMPolicyAssignment{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) } sv.AssignmentName = ptr.String(jtv) } case "PolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.PolicyArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentActiveIAMPolicyAssignmentList(v *[]types.ActiveIAMPolicyAssignment, 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.ActiveIAMPolicyAssignment if *v == nil { cv = []types.ActiveIAMPolicyAssignment{} } else { cv = *v } for _, value := range shape { var col types.ActiveIAMPolicyAssignment destAddr := &col if err := awsRestjson1_deserializeDocumentActiveIAMPolicyAssignment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAdHocFilteringOption(v **types.AdHocFilteringOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AdHocFilteringOption if *v == nil { sv = &types.AdHocFilteringOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAggregationFunction(v **types.AggregationFunction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AggregationFunction if *v == nil { sv = &types.AggregationFunction{} } else { sv = *v } for key, value := range shape { switch key { case "AttributeAggregationFunction": if err := awsRestjson1_deserializeDocumentAttributeAggregationFunction(&sv.AttributeAggregationFunction, value); err != nil { return err } case "CategoricalAggregationFunction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoricalAggregationFunction to be of type string, got %T instead", value) } sv.CategoricalAggregationFunction = types.CategoricalAggregationFunction(jtv) } case "DateAggregationFunction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateAggregationFunction to be of type string, got %T instead", value) } sv.DateAggregationFunction = types.DateAggregationFunction(jtv) } case "NumericalAggregationFunction": if err := awsRestjson1_deserializeDocumentNumericalAggregationFunction(&sv.NumericalAggregationFunction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAggregationFunctionParameters(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentAggregationSortConfiguration(v **types.AggregationSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AggregationSortConfiguration if *v == nil { sv = &types.AggregationSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if err := awsRestjson1_deserializeDocumentAggregationFunction(&sv.AggregationFunction, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "SortDirection": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SortDirection to be of type string, got %T instead", value) } sv.SortDirection = types.SortDirection(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAggregationSortConfigurationList(v *[]types.AggregationSortConfiguration, 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.AggregationSortConfiguration if *v == nil { cv = []types.AggregationSortConfiguration{} } else { cv = *v } for _, value := range shape { var col types.AggregationSortConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentAggregationSortConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAmazonElasticsearchParameters(v **types.AmazonElasticsearchParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AmazonElasticsearchParameters if *v == nil { sv = &types.AmazonElasticsearchParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Domain to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAmazonOpenSearchParameters(v **types.AmazonOpenSearchParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AmazonOpenSearchParameters if *v == nil { sv = &types.AmazonOpenSearchParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Domain to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnalysis(v **types.Analysis, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Analysis if *v == nil { sv = &types.Analysis{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSetArns": if err := awsRestjson1_deserializeDocumentDataSetArnsList(&sv.DataSetArns, value); err != nil { return err } case "Errors": if err := awsRestjson1_deserializeDocumentAnalysisErrorList(&sv.Errors, value); err != nil { return err } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AnalysisName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Sheets": if err := awsRestjson1_deserializeDocumentSheetList(&sv.Sheets, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnalysisDefaults(v **types.AnalysisDefaults, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AnalysisDefaults if *v == nil { sv = &types.AnalysisDefaults{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultNewSheetConfiguration": if err := awsRestjson1_deserializeDocumentDefaultNewSheetConfiguration(&sv.DefaultNewSheetConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnalysisDefinition(v **types.AnalysisDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AnalysisDefinition if *v == nil { sv = &types.AnalysisDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisDefaults": if err := awsRestjson1_deserializeDocumentAnalysisDefaults(&sv.AnalysisDefaults, value); err != nil { return err } case "CalculatedFields": if err := awsRestjson1_deserializeDocumentCalculatedFields(&sv.CalculatedFields, value); err != nil { return err } case "ColumnConfigurations": if err := awsRestjson1_deserializeDocumentColumnConfigurationList(&sv.ColumnConfigurations, value); err != nil { return err } case "DataSetIdentifierDeclarations": if err := awsRestjson1_deserializeDocumentDataSetIdentifierDeclarationList(&sv.DataSetIdentifierDeclarations, value); err != nil { return err } case "FilterGroups": if err := awsRestjson1_deserializeDocumentFilterGroupList(&sv.FilterGroups, value); err != nil { return err } case "ParameterDeclarations": if err := awsRestjson1_deserializeDocumentParameterDeclarationList(&sv.ParameterDeclarations, value); err != nil { return err } case "Sheets": if err := awsRestjson1_deserializeDocumentSheetDefinitionList(&sv.Sheets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnalysisError(v **types.AnalysisError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AnalysisError if *v == nil { sv = &types.AnalysisError{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AnalysisErrorType to be of type string, got %T instead", value) } sv.Type = types.AnalysisErrorType(jtv) } case "ViolatedEntities": if err := awsRestjson1_deserializeDocumentEntityList(&sv.ViolatedEntities, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnalysisErrorList(v *[]types.AnalysisError, 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.AnalysisError if *v == nil { cv = []types.AnalysisError{} } else { cv = *v } for _, value := range shape { var col types.AnalysisError destAddr := &col if err := awsRestjson1_deserializeDocumentAnalysisError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAnalysisSummary(v **types.AnalysisSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AnalysisSummary if *v == nil { sv = &types.AnalysisSummary{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AnalysisName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnalysisSummaryList(v *[]types.AnalysisSummary, 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.AnalysisSummary if *v == nil { cv = []types.AnalysisSummary{} } else { cv = *v } for _, value := range shape { var col types.AnalysisSummary destAddr := &col if err := awsRestjson1_deserializeDocumentAnalysisSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAnchorDateConfiguration(v **types.AnchorDateConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AnchorDateConfiguration if *v == nil { sv = &types.AnchorDateConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AnchorOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AnchorOption to be of type string, got %T instead", value) } sv.AnchorOption = types.AnchorOption(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnonymousUserSnapshotJobResult(v **types.AnonymousUserSnapshotJobResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AnonymousUserSnapshotJobResult if *v == nil { sv = &types.AnonymousUserSnapshotJobResult{} } else { sv = *v } for key, value := range shape { switch key { case "FileGroups": if err := awsRestjson1_deserializeDocumentSnapshotJobResultFileGroupList(&sv.FileGroups, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAnonymousUserSnapshotJobResultList(v *[]types.AnonymousUserSnapshotJobResult, 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.AnonymousUserSnapshotJobResult if *v == nil { cv = []types.AnonymousUserSnapshotJobResult{} } else { cv = *v } for _, value := range shape { var col types.AnonymousUserSnapshotJobResult destAddr := &col if err := awsRestjson1_deserializeDocumentAnonymousUserSnapshotJobResult(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentArcAxisConfiguration(v **types.ArcAxisConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ArcAxisConfiguration if *v == nil { sv = &types.ArcAxisConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Range": if err := awsRestjson1_deserializeDocumentArcAxisDisplayRange(&sv.Range, value); err != nil { return err } case "ReserveRange": 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.ReserveRange = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentArcAxisDisplayRange(v **types.ArcAxisDisplayRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ArcAxisDisplayRange if *v == nil { sv = &types.ArcAxisDisplayRange{} } else { sv = *v } for key, value := range shape { switch key { case "Max": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Max = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Max = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Min": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Min = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Min = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentArcConfiguration(v **types.ArcConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ArcConfiguration if *v == nil { sv = &types.ArcConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ArcAngle": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ArcAngle = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.ArcAngle = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "ArcThickness": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArcThicknessOptions to be of type string, got %T instead", value) } sv.ArcThickness = types.ArcThicknessOptions(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentArcOptions(v **types.ArcOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ArcOptions if *v == nil { sv = &types.ArcOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ArcThickness": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArcThickness to be of type string, got %T instead", value) } sv.ArcThickness = types.ArcThickness(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleCloudFormationOverridePropertyConfiguration(v **types.AssetBundleCloudFormationOverridePropertyConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleCloudFormationOverridePropertyConfiguration if *v == nil { sv = &types.AssetBundleCloudFormationOverridePropertyConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Analyses": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobAnalysisOverridePropertiesList(&sv.Analyses, value); err != nil { return err } case "Dashboards": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDashboardOverridePropertiesList(&sv.Dashboards, value); err != nil { return err } case "DataSets": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDataSetOverridePropertiesList(&sv.DataSets, value); err != nil { return err } case "DataSources": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDataSourceOverridePropertiesList(&sv.DataSources, value); err != nil { return err } case "RefreshSchedules": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobRefreshScheduleOverridePropertiesList(&sv.RefreshSchedules, value); err != nil { return err } case "ResourceIdOverrideConfiguration": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobResourceIdOverrideConfiguration(&sv.ResourceIdOverrideConfiguration, value); err != nil { return err } case "Themes": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobThemeOverridePropertiesList(&sv.Themes, value); err != nil { return err } case "VPCConnections": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobVPCConnectionOverridePropertiesList(&sv.VPCConnections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobAnalysisOverrideProperties(v **types.AssetBundleExportJobAnalysisOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobAnalysisOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobAnalysisOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobAnalysisPropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobAnalysisOverridePropertiesList(v *[]types.AssetBundleExportJobAnalysisOverrideProperties, 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.AssetBundleExportJobAnalysisOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobAnalysisOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobAnalysisOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobAnalysisOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobAnalysisPropertyToOverrideList(v *[]types.AssetBundleExportJobAnalysisPropertyToOverride, 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.AssetBundleExportJobAnalysisPropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobAnalysisPropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobAnalysisPropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobAnalysisPropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobAnalysisPropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDashboardOverrideProperties(v **types.AssetBundleExportJobDashboardOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobDashboardOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobDashboardOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDashboardPropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDashboardOverridePropertiesList(v *[]types.AssetBundleExportJobDashboardOverrideProperties, 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.AssetBundleExportJobDashboardOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobDashboardOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobDashboardOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDashboardOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDashboardPropertyToOverrideList(v *[]types.AssetBundleExportJobDashboardPropertyToOverride, 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.AssetBundleExportJobDashboardPropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobDashboardPropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobDashboardPropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobDashboardPropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobDashboardPropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDataSetOverrideProperties(v **types.AssetBundleExportJobDataSetOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobDataSetOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobDataSetOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDataSetPropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDataSetOverridePropertiesList(v *[]types.AssetBundleExportJobDataSetOverrideProperties, 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.AssetBundleExportJobDataSetOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobDataSetOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobDataSetOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDataSetOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDataSetPropertyToOverrideList(v *[]types.AssetBundleExportJobDataSetPropertyToOverride, 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.AssetBundleExportJobDataSetPropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobDataSetPropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobDataSetPropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobDataSetPropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobDataSetPropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDataSourceOverrideProperties(v **types.AssetBundleExportJobDataSourceOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobDataSourceOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobDataSourceOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDataSourcePropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDataSourceOverridePropertiesList(v *[]types.AssetBundleExportJobDataSourceOverrideProperties, 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.AssetBundleExportJobDataSourceOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobDataSourceOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobDataSourceOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobDataSourceOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobDataSourcePropertyToOverrideList(v *[]types.AssetBundleExportJobDataSourcePropertyToOverride, 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.AssetBundleExportJobDataSourcePropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobDataSourcePropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobDataSourcePropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobDataSourcePropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobDataSourcePropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobError(v **types.AssetBundleExportJobError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobError if *v == nil { sv = &types.AssetBundleExportJobError{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobErrorList(v *[]types.AssetBundleExportJobError, 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.AssetBundleExportJobError if *v == nil { cv = []types.AssetBundleExportJobError{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobError destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobRefreshScheduleOverrideProperties(v **types.AssetBundleExportJobRefreshScheduleOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobRefreshScheduleOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobRefreshScheduleOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobRefreshSchedulePropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobRefreshScheduleOverridePropertiesList(v *[]types.AssetBundleExportJobRefreshScheduleOverrideProperties, 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.AssetBundleExportJobRefreshScheduleOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobRefreshScheduleOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobRefreshScheduleOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobRefreshScheduleOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobRefreshSchedulePropertyToOverrideList(v *[]types.AssetBundleExportJobRefreshSchedulePropertyToOverride, 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.AssetBundleExportJobRefreshSchedulePropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobRefreshSchedulePropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobRefreshSchedulePropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobRefreshSchedulePropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobRefreshSchedulePropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobResourceIdOverrideConfiguration(v **types.AssetBundleExportJobResourceIdOverrideConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobResourceIdOverrideConfiguration if *v == nil { sv = &types.AssetBundleExportJobResourceIdOverrideConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "PrefixForAllResources": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PrefixForAllResources = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobSummary(v **types.AssetBundleExportJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobSummary if *v == nil { sv = &types.AssetBundleExportJobSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssetBundleExportJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AssetBundleExportJobId = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ExportFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportFormat to be of type string, got %T instead", value) } sv.ExportFormat = types.AssetBundleExportFormat(jtv) } case "IncludeAllDependencies": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeAllDependencies = jtv } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.AssetBundleExportJobStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobSummaryList(v *[]types.AssetBundleExportJobSummary, 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.AssetBundleExportJobSummary if *v == nil { cv = []types.AssetBundleExportJobSummary{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobSummary destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobThemeOverrideProperties(v **types.AssetBundleExportJobThemeOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobThemeOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobThemeOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobThemePropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobThemeOverridePropertiesList(v *[]types.AssetBundleExportJobThemeOverrideProperties, 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.AssetBundleExportJobThemeOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobThemeOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobThemeOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobThemeOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobThemePropertyToOverrideList(v *[]types.AssetBundleExportJobThemePropertyToOverride, 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.AssetBundleExportJobThemePropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobThemePropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobThemePropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobThemePropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobThemePropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobVPCConnectionOverrideProperties(v **types.AssetBundleExportJobVPCConnectionOverrideProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleExportJobVPCConnectionOverrideProperties if *v == nil { sv = &types.AssetBundleExportJobVPCConnectionOverrideProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Properties": if err := awsRestjson1_deserializeDocumentAssetBundleExportJobVPCConnectionPropertyToOverrideList(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobVPCConnectionOverridePropertiesList(v *[]types.AssetBundleExportJobVPCConnectionOverrideProperties, 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.AssetBundleExportJobVPCConnectionOverrideProperties if *v == nil { cv = []types.AssetBundleExportJobVPCConnectionOverrideProperties{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobVPCConnectionOverrideProperties destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleExportJobVPCConnectionOverrideProperties(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleExportJobVPCConnectionPropertyToOverrideList(v *[]types.AssetBundleExportJobVPCConnectionPropertyToOverride, 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.AssetBundleExportJobVPCConnectionPropertyToOverride if *v == nil { cv = []types.AssetBundleExportJobVPCConnectionPropertyToOverride{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleExportJobVPCConnectionPropertyToOverride if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleExportJobVPCConnectionPropertyToOverride to be of type string, got %T instead", value) } col = types.AssetBundleExportJobVPCConnectionPropertyToOverride(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobAnalysisOverrideParameters(v **types.AssetBundleImportJobAnalysisOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobAnalysisOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobAnalysisOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.AnalysisId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobAnalysisOverrideParametersList(v *[]types.AssetBundleImportJobAnalysisOverrideParameters, 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.AssetBundleImportJobAnalysisOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobAnalysisOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobAnalysisOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobAnalysisOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDashboardOverrideParameters(v **types.AssetBundleImportJobDashboardOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobDashboardOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobDashboardOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDashboardOverrideParametersList(v *[]types.AssetBundleImportJobDashboardOverrideParameters, 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.AssetBundleImportJobDashboardOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobDashboardOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobDashboardOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDashboardOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDataSetOverrideParameters(v **types.AssetBundleImportJobDataSetOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobDataSetOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobDataSetOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDataSetOverrideParametersList(v *[]types.AssetBundleImportJobDataSetOverrideParameters, 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.AssetBundleImportJobDataSetOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobDataSetOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobDataSetOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDataSetOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceCredentialPair(v **types.AssetBundleImportJobDataSourceCredentialPair, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobDataSourceCredentialPair if *v == nil { sv = &types.AssetBundleImportJobDataSourceCredentialPair{} } else { sv = *v } for key, value := range shape { switch key { case "Password": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Password to be of type string, got %T instead", value) } sv.Password = ptr.String(jtv) } case "Username": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DbUsername to be of type string, got %T instead", value) } sv.Username = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceCredentials(v **types.AssetBundleImportJobDataSourceCredentials, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobDataSourceCredentials if *v == nil { sv = &types.AssetBundleImportJobDataSourceCredentials{} } else { sv = *v } for key, value := range shape { switch key { case "CredentialPair": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceCredentialPair(&sv.CredentialPair, value); err != nil { return err } case "SecretArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } sv.SecretArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceOverrideParameters(v **types.AssetBundleImportJobDataSourceOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobDataSourceOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobDataSourceOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Credentials": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceCredentials(&sv.Credentials, value); err != nil { return err } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "DataSourceParameters": if err := awsRestjson1_deserializeDocumentDataSourceParameters(&sv.DataSourceParameters, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SslProperties": if err := awsRestjson1_deserializeDocumentSslProperties(&sv.SslProperties, value); err != nil { return err } case "VpcConnectionProperties": if err := awsRestjson1_deserializeDocumentVpcConnectionProperties(&sv.VpcConnectionProperties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceOverrideParametersList(v *[]types.AssetBundleImportJobDataSourceOverrideParameters, 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.AssetBundleImportJobDataSourceOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobDataSourceOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobDataSourceOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobError(v **types.AssetBundleImportJobError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobError if *v == nil { sv = &types.AssetBundleImportJobError{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobErrorList(v *[]types.AssetBundleImportJobError, 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.AssetBundleImportJobError if *v == nil { cv = []types.AssetBundleImportJobError{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobError destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobOverrideParameters(v **types.AssetBundleImportJobOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Analyses": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobAnalysisOverrideParametersList(&sv.Analyses, value); err != nil { return err } case "Dashboards": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDashboardOverrideParametersList(&sv.Dashboards, value); err != nil { return err } case "DataSets": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDataSetOverrideParametersList(&sv.DataSets, value); err != nil { return err } case "DataSources": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobDataSourceOverrideParametersList(&sv.DataSources, value); err != nil { return err } case "RefreshSchedules": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobRefreshScheduleOverrideParametersList(&sv.RefreshSchedules, value); err != nil { return err } case "ResourceIdOverrideConfiguration": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobResourceIdOverrideConfiguration(&sv.ResourceIdOverrideConfiguration, value); err != nil { return err } case "Themes": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobThemeOverrideParametersList(&sv.Themes, value); err != nil { return err } case "VPCConnections": if err := awsRestjson1_deserializeDocumentAssetBundleImportJobVPCConnectionOverrideParametersList(&sv.VPCConnections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobRefreshScheduleOverrideParameters(v **types.AssetBundleImportJobRefreshScheduleOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobRefreshScheduleOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobRefreshScheduleOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "ScheduleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScheduleId = ptr.String(jtv) } case "StartAfterDateTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartAfterDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobRefreshScheduleOverrideParametersList(v *[]types.AssetBundleImportJobRefreshScheduleOverrideParameters, 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.AssetBundleImportJobRefreshScheduleOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobRefreshScheduleOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobRefreshScheduleOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobRefreshScheduleOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobResourceIdOverrideConfiguration(v **types.AssetBundleImportJobResourceIdOverrideConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobResourceIdOverrideConfiguration if *v == nil { sv = &types.AssetBundleImportJobResourceIdOverrideConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "PrefixForAllResources": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PrefixForAllResources = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobSummary(v **types.AssetBundleImportJobSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobSummary if *v == nil { sv = &types.AssetBundleImportJobSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AssetBundleImportJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.AssetBundleImportJobId = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "FailureAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleImportFailureAction to be of type string, got %T instead", value) } sv.FailureAction = types.AssetBundleImportFailureAction(jtv) } case "JobStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssetBundleImportJobStatus to be of type string, got %T instead", value) } sv.JobStatus = types.AssetBundleImportJobStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobSummaryList(v *[]types.AssetBundleImportJobSummary, 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.AssetBundleImportJobSummary if *v == nil { cv = []types.AssetBundleImportJobSummary{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobSummary destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobThemeOverrideParameters(v **types.AssetBundleImportJobThemeOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobThemeOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobThemeOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobThemeOverrideParametersList(v *[]types.AssetBundleImportJobThemeOverrideParameters, 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.AssetBundleImportJobThemeOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobThemeOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobThemeOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobThemeOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobVPCConnectionOverrideParameters(v **types.AssetBundleImportJobVPCConnectionOverrideParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportJobVPCConnectionOverrideParameters if *v == nil { sv = &types.AssetBundleImportJobVPCConnectionOverrideParameters{} } else { sv = *v } for key, value := range shape { switch key { case "DnsResolvers": if err := awsRestjson1_deserializeDocumentDnsResolverList(&sv.DnsResolvers, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil { return err } case "VPCConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceIdUnrestricted to be of type string, got %T instead", value) } sv.VPCConnectionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportJobVPCConnectionOverrideParametersList(v *[]types.AssetBundleImportJobVPCConnectionOverrideParameters, 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.AssetBundleImportJobVPCConnectionOverrideParameters if *v == nil { cv = []types.AssetBundleImportJobVPCConnectionOverrideParameters{} } else { cv = *v } for _, value := range shape { var col types.AssetBundleImportJobVPCConnectionOverrideParameters destAddr := &col if err := awsRestjson1_deserializeDocumentAssetBundleImportJobVPCConnectionOverrideParameters(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAssetBundleImportSourceDescription(v **types.AssetBundleImportSourceDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AssetBundleImportSourceDescription if *v == nil { sv = &types.AssetBundleImportSourceDescription{} } else { sv = *v } for key, value := range shape { switch key { case "Body": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Body = ptr.String(jtv) } case "S3Uri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAssetBundleResourceArns(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 Arn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAthenaParameters(v **types.AthenaParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AthenaParameters if *v == nil { sv = &types.AthenaParameters{} } else { sv = *v } for key, value := range shape { switch key { case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "WorkGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WorkGroup to be of type string, got %T instead", value) } sv.WorkGroup = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAttributeAggregationFunction(v **types.AttributeAggregationFunction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AttributeAggregationFunction if *v == nil { sv = &types.AttributeAggregationFunction{} } else { sv = *v } for key, value := range shape { switch key { case "SimpleAttributeAggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimpleAttributeAggregationFunction to be of type string, got %T instead", value) } sv.SimpleAttributeAggregation = types.SimpleAttributeAggregationFunction(jtv) } case "ValueForMultipleValues": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ValueForMultipleValues = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAuroraParameters(v **types.AuroraParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AuroraParameters if *v == nil { sv = &types.AuroraParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAuroraPostgreSqlParameters(v **types.AuroraPostgreSqlParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AuroraPostgreSqlParameters if *v == nil { sv = &types.AuroraPostgreSqlParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAuthorSpecifiedAggregations(v *[]types.AuthorSpecifiedAggregation, 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.AuthorSpecifiedAggregation if *v == nil { cv = []types.AuthorSpecifiedAggregation{} } else { cv = *v } for _, value := range shape { var col types.AuthorSpecifiedAggregation if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AuthorSpecifiedAggregation to be of type string, got %T instead", value) } col = types.AuthorSpecifiedAggregation(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAwsIotAnalyticsParameters(v **types.AwsIotAnalyticsParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AwsIotAnalyticsParameters if *v == nil { sv = &types.AwsIotAnalyticsParameters{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetName to be of type string, got %T instead", value) } sv.DataSetName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisDataOptions(v **types.AxisDataOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisDataOptions if *v == nil { sv = &types.AxisDataOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DateAxisOptions": if err := awsRestjson1_deserializeDocumentDateAxisOptions(&sv.DateAxisOptions, value); err != nil { return err } case "NumericAxisOptions": if err := awsRestjson1_deserializeDocumentNumericAxisOptions(&sv.NumericAxisOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisDisplayDataDrivenRange(v **types.AxisDisplayDataDrivenRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisDisplayDataDrivenRange if *v == nil { sv = &types.AxisDisplayDataDrivenRange{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisDisplayMinMaxRange(v **types.AxisDisplayMinMaxRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisDisplayMinMaxRange if *v == nil { sv = &types.AxisDisplayMinMaxRange{} } else { sv = *v } for key, value := range shape { switch key { case "Maximum": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Maximum = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Maximum = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Minimum": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Minimum = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Minimum = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisDisplayOptions(v **types.AxisDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisDisplayOptions if *v == nil { sv = &types.AxisDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AxisLineVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.AxisLineVisibility = types.Visibility(jtv) } case "AxisOffset": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.AxisOffset = ptr.String(jtv) } case "DataOptions": if err := awsRestjson1_deserializeDocumentAxisDataOptions(&sv.DataOptions, value); err != nil { return err } case "GridLineVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.GridLineVisibility = types.Visibility(jtv) } case "ScrollbarOptions": if err := awsRestjson1_deserializeDocumentScrollBarOptions(&sv.ScrollbarOptions, value); err != nil { return err } case "TickLabelOptions": if err := awsRestjson1_deserializeDocumentAxisTickLabelOptions(&sv.TickLabelOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisDisplayRange(v **types.AxisDisplayRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisDisplayRange if *v == nil { sv = &types.AxisDisplayRange{} } else { sv = *v } for key, value := range shape { switch key { case "DataDriven": if err := awsRestjson1_deserializeDocumentAxisDisplayDataDrivenRange(&sv.DataDriven, value); err != nil { return err } case "MinMax": if err := awsRestjson1_deserializeDocumentAxisDisplayMinMaxRange(&sv.MinMax, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisLabelOptions(v **types.AxisLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisLabelOptions if *v == nil { sv = &types.AxisLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ApplyTo": if err := awsRestjson1_deserializeDocumentAxisLabelReferenceOptions(&sv.ApplyTo, value); err != nil { return err } case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "FontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.FontConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisLabelOptionsList(v *[]types.AxisLabelOptions, 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.AxisLabelOptions if *v == nil { cv = []types.AxisLabelOptions{} } else { cv = *v } for _, value := range shape { var col types.AxisLabelOptions destAddr := &col if err := awsRestjson1_deserializeDocumentAxisLabelOptions(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAxisLabelReferenceOptions(v **types.AxisLabelReferenceOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisLabelReferenceOptions if *v == nil { sv = &types.AxisLabelReferenceOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisLinearScale(v **types.AxisLinearScale, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisLinearScale if *v == nil { sv = &types.AxisLinearScale{} } else { sv = *v } for key, value := range shape { switch key { case "StepCount": 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.StepCount = ptr.Int32(int32(i64)) } case "StepSize": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StepSize = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.StepSize = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisLogarithmicScale(v **types.AxisLogarithmicScale, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisLogarithmicScale if *v == nil { sv = &types.AxisLogarithmicScale{} } else { sv = *v } for key, value := range shape { switch key { case "Base": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Base = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Base = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisScale(v **types.AxisScale, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisScale if *v == nil { sv = &types.AxisScale{} } else { sv = *v } for key, value := range shape { switch key { case "Linear": if err := awsRestjson1_deserializeDocumentAxisLinearScale(&sv.Linear, value); err != nil { return err } case "Logarithmic": if err := awsRestjson1_deserializeDocumentAxisLogarithmicScale(&sv.Logarithmic, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAxisTickLabelOptions(v **types.AxisTickLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AxisTickLabelOptions if *v == nil { sv = &types.AxisTickLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "LabelOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.LabelOptions, value); err != nil { return err } case "RotationAngle": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RotationAngle = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.RotationAngle = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBarChartAggregatedFieldWells(v **types.BarChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BarChartAggregatedFieldWells if *v == nil { sv = &types.BarChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Category, value); err != nil { return err } case "Colors": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Colors, value); err != nil { return err } case "SmallMultiples": if err := awsRestjson1_deserializeDocumentSmallMultiplesDimensionFieldList(&sv.SmallMultiples, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBarChartConfiguration(v **types.BarChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BarChartConfiguration if *v == nil { sv = &types.BarChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BarsArrangement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BarsArrangement to be of type string, got %T instead", value) } sv.BarsArrangement = types.BarsArrangement(jtv) } case "CategoryAxis": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.CategoryAxis, value); err != nil { return err } case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "ColorLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ColorLabelOptions, value); err != nil { return err } case "ContributionAnalysisDefaults": if err := awsRestjson1_deserializeDocumentContributionAnalysisDefaultList(&sv.ContributionAnalysisDefaults, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentBarChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "Orientation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BarChartOrientation to be of type string, got %T instead", value) } sv.Orientation = types.BarChartOrientation(jtv) } case "ReferenceLines": if err := awsRestjson1_deserializeDocumentReferenceLineList(&sv.ReferenceLines, value); err != nil { return err } case "SmallMultiplesOptions": if err := awsRestjson1_deserializeDocumentSmallMultiplesOptions(&sv.SmallMultiplesOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentBarChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "ValueAxis": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.ValueAxis, value); err != nil { return err } case "ValueLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ValueLabelOptions, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBarChartFieldWells(v **types.BarChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BarChartFieldWells if *v == nil { sv = &types.BarChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "BarChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentBarChartAggregatedFieldWells(&sv.BarChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBarChartSortConfiguration(v **types.BarChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BarChartSortConfiguration if *v == nil { sv = &types.BarChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } case "ColorItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.ColorItemsLimit, value); err != nil { return err } case "ColorSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.ColorSort, value); err != nil { return err } case "SmallMultiplesLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.SmallMultiplesLimitConfiguration, value); err != nil { return err } case "SmallMultiplesSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.SmallMultiplesSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBarChartVisual(v **types.BarChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BarChartVisual if *v == nil { sv = &types.BarChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentBarChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBinCountOptions(v **types.BinCountOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BinCountOptions if *v == nil { sv = &types.BinCountOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Value": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BinCountValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Value = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBinWidthOptions(v **types.BinWidthOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BinWidthOptions if *v == nil { sv = &types.BinWidthOptions{} } else { sv = *v } for key, value := range shape { switch key { case "BinCountLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BinCountLimit to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BinCountLimit = ptr.Int64(i64) } case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Value = ptr.Float64(f64) default: return fmt.Errorf("expected BinWidthValue to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBodySectionConfiguration(v **types.BodySectionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BodySectionConfiguration if *v == nil { sv = &types.BodySectionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Content": if err := awsRestjson1_deserializeDocumentBodySectionContent(&sv.Content, value); err != nil { return err } case "PageBreakConfiguration": if err := awsRestjson1_deserializeDocumentSectionPageBreakConfiguration(&sv.PageBreakConfiguration, value); err != nil { return err } case "SectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SectionId = ptr.String(jtv) } case "Style": if err := awsRestjson1_deserializeDocumentSectionStyle(&sv.Style, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBodySectionConfigurationList(v *[]types.BodySectionConfiguration, 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.BodySectionConfiguration if *v == nil { cv = []types.BodySectionConfiguration{} } else { cv = *v } for _, value := range shape { var col types.BodySectionConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentBodySectionConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBodySectionContent(v **types.BodySectionContent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BodySectionContent if *v == nil { sv = &types.BodySectionContent{} } else { sv = *v } for key, value := range shape { switch key { case "Layout": if err := awsRestjson1_deserializeDocumentSectionLayoutConfiguration(&sv.Layout, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBorderStyle(v **types.BorderStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BorderStyle if *v == nil { sv = &types.BorderStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Show": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Show = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotAggregatedFieldWells(v **types.BoxPlotAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotAggregatedFieldWells if *v == nil { sv = &types.BoxPlotAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "GroupBy": if err := awsRestjson1_deserializeDocumentBoxPlotDimensionFieldList(&sv.GroupBy, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentBoxPlotMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotChartConfiguration(v **types.BoxPlotChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotChartConfiguration if *v == nil { sv = &types.BoxPlotChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BoxPlotOptions": if err := awsRestjson1_deserializeDocumentBoxPlotOptions(&sv.BoxPlotOptions, value); err != nil { return err } case "CategoryAxis": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.CategoryAxis, value); err != nil { return err } case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentBoxPlotFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "PrimaryYAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.PrimaryYAxisDisplayOptions, value); err != nil { return err } case "PrimaryYAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.PrimaryYAxisLabelOptions, value); err != nil { return err } case "ReferenceLines": if err := awsRestjson1_deserializeDocumentReferenceLineList(&sv.ReferenceLines, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentBoxPlotSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBoxPlotFieldWells(v **types.BoxPlotFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotFieldWells if *v == nil { sv = &types.BoxPlotFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "BoxPlotAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentBoxPlotAggregatedFieldWells(&sv.BoxPlotAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBoxPlotOptions(v **types.BoxPlotOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotOptions if *v == nil { sv = &types.BoxPlotOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AllDataPointsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.AllDataPointsVisibility = types.Visibility(jtv) } case "OutlierVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.OutlierVisibility = types.Visibility(jtv) } case "StyleOptions": if err := awsRestjson1_deserializeDocumentBoxPlotStyleOptions(&sv.StyleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotSortConfiguration(v **types.BoxPlotSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotSortConfiguration if *v == nil { sv = &types.BoxPlotSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } case "PaginationConfiguration": if err := awsRestjson1_deserializeDocumentPaginationConfiguration(&sv.PaginationConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotStyleOptions(v **types.BoxPlotStyleOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotStyleOptions if *v == nil { sv = &types.BoxPlotStyleOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FillStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BoxPlotFillStyle to be of type string, got %T instead", value) } sv.FillStyle = types.BoxPlotFillStyle(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBoxPlotVisual(v **types.BoxPlotVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.BoxPlotVisual if *v == nil { sv = &types.BoxPlotVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentBoxPlotChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCalculatedColumn(v **types.CalculatedColumn, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CalculatedColumn if *v == nil { sv = &types.CalculatedColumn{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnId to be of type string, got %T instead", value) } sv.ColumnId = ptr.String(jtv) } case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCalculatedColumnList(v *[]types.CalculatedColumn, 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.CalculatedColumn if *v == nil { cv = []types.CalculatedColumn{} } else { cv = *v } for _, value := range shape { var col types.CalculatedColumn destAddr := &col if err := awsRestjson1_deserializeDocumentCalculatedColumn(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCalculatedField(v **types.CalculatedField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CalculatedField if *v == nil { sv = &types.CalculatedField{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CalculatedFieldExpression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCalculatedFields(v *[]types.CalculatedField, 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.CalculatedField if *v == nil { cv = []types.CalculatedField{} } else { cv = *v } for _, value := range shape { var col types.CalculatedField destAddr := &col if err := awsRestjson1_deserializeDocumentCalculatedField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCalculatedMeasureField(v **types.CalculatedMeasureField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CalculatedMeasureField if *v == nil { sv = &types.CalculatedMeasureField{} } else { sv = *v } for key, value := range shape { switch key { case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCascadingControlConfiguration(v **types.CascadingControlConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CascadingControlConfiguration if *v == nil { sv = &types.CascadingControlConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SourceControls": if err := awsRestjson1_deserializeDocumentCascadingControlSourceList(&sv.SourceControls, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCascadingControlSource(v **types.CascadingControlSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CascadingControlSource if *v == nil { sv = &types.CascadingControlSource{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnToMatch": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.ColumnToMatch, value); err != nil { return err } case "SourceSheetControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SourceSheetControlId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCascadingControlSourceList(v *[]types.CascadingControlSource, 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.CascadingControlSource if *v == nil { cv = []types.CascadingControlSource{} } else { cv = *v } for _, value := range shape { var col types.CascadingControlSource destAddr := &col if err := awsRestjson1_deserializeDocumentCascadingControlSource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCastColumnTypeOperation(v **types.CastColumnTypeOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CastColumnTypeOperation if *v == nil { sv = &types.CastColumnTypeOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "Format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TypeCastFormat to be of type string, got %T instead", value) } sv.Format = ptr.String(jtv) } case "NewColumnType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnDataType to be of type string, got %T instead", value) } sv.NewColumnType = types.ColumnDataType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoricalDimensionField(v **types.CategoricalDimensionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CategoricalDimensionField if *v == nil { sv = &types.CategoricalDimensionField{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentStringFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } case "HierarchyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HierarchyId to be of type string, got %T instead", value) } sv.HierarchyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoricalMeasureField(v **types.CategoricalMeasureField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CategoricalMeasureField if *v == nil { sv = &types.CategoricalMeasureField{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoricalAggregationFunction to be of type string, got %T instead", value) } sv.AggregationFunction = types.CategoricalAggregationFunction(jtv) } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentStringFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoryDrillDownFilter(v **types.CategoryDrillDownFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CategoryDrillDownFilter if *v == nil { sv = &types.CategoryDrillDownFilter{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryValues": if err := awsRestjson1_deserializeDocumentCategoryValueList(&sv.CategoryValues, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoryFilter(v **types.CategoryFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CategoryFilter if *v == nil { sv = &types.CategoryFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "Configuration": if err := awsRestjson1_deserializeDocumentCategoryFilterConfiguration(&sv.Configuration, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoryFilterConfiguration(v **types.CategoryFilterConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CategoryFilterConfiguration if *v == nil { sv = &types.CategoryFilterConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomFilterConfiguration": if err := awsRestjson1_deserializeDocumentCustomFilterConfiguration(&sv.CustomFilterConfiguration, value); err != nil { return err } case "CustomFilterListConfiguration": if err := awsRestjson1_deserializeDocumentCustomFilterListConfiguration(&sv.CustomFilterListConfiguration, value); err != nil { return err } case "FilterListConfiguration": if err := awsRestjson1_deserializeDocumentFilterListConfiguration(&sv.FilterListConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoryValueList(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 CategoryValue to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCellValueSynonym(v **types.CellValueSynonym, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CellValueSynonym if *v == nil { sv = &types.CellValueSynonym{} } else { sv = *v } for key, value := range shape { switch key { case "CellValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.CellValue = ptr.String(jtv) } case "Synonyms": if err := awsRestjson1_deserializeDocumentStringList(&sv.Synonyms, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCellValueSynonyms(v *[]types.CellValueSynonym, 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.CellValueSynonym if *v == nil { cv = []types.CellValueSynonym{} } else { cv = *v } for _, value := range shape { var col types.CellValueSynonym destAddr := &col if err := awsRestjson1_deserializeDocumentCellValueSynonym(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChartAxisLabelOptions(v **types.ChartAxisLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ChartAxisLabelOptions if *v == nil { sv = &types.ChartAxisLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AxisLabelOptions": if err := awsRestjson1_deserializeDocumentAxisLabelOptionsList(&sv.AxisLabelOptions, value); err != nil { return err } case "SortIconVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.SortIconVisibility = types.Visibility(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterMarker(v **types.ClusterMarker, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ClusterMarker if *v == nil { sv = &types.ClusterMarker{} } else { sv = *v } for key, value := range shape { switch key { case "SimpleClusterMarker": if err := awsRestjson1_deserializeDocumentSimpleClusterMarker(&sv.SimpleClusterMarker, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterMarkerConfiguration(v **types.ClusterMarkerConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ClusterMarkerConfiguration if *v == nil { sv = &types.ClusterMarkerConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterMarker": if err := awsRestjson1_deserializeDocumentClusterMarker(&sv.ClusterMarker, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCollectiveConstant(v **types.CollectiveConstant, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CollectiveConstant if *v == nil { sv = &types.CollectiveConstant{} } else { sv = *v } for key, value := range shape { switch key { case "ValueList": if err := awsRestjson1_deserializeDocumentStringList(&sv.ValueList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColorList(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 HexColor to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColorScale(v **types.ColorScale, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColorScale if *v == nil { sv = &types.ColorScale{} } else { sv = *v } for key, value := range shape { switch key { case "ColorFillType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColorFillType to be of type string, got %T instead", value) } sv.ColorFillType = types.ColorFillType(jtv) } case "Colors": if err := awsRestjson1_deserializeDocumentColorScaleColorList(&sv.Colors, value); err != nil { return err } case "NullValueColor": if err := awsRestjson1_deserializeDocumentDataColor(&sv.NullValueColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColorScaleColorList(v *[]types.DataColor, 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.DataColor if *v == nil { cv = []types.DataColor{} } else { cv = *v } for _, value := range shape { var col types.DataColor destAddr := &col if err := awsRestjson1_deserializeDocumentDataColor(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColorsConfiguration(v **types.ColorsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColorsConfiguration if *v == nil { sv = &types.ColorsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomColors": if err := awsRestjson1_deserializeDocumentCustomColorsList(&sv.CustomColors, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnConfiguration(v **types.ColumnConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnConfiguration if *v == nil { sv = &types.ColumnConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ColorsConfiguration": if err := awsRestjson1_deserializeDocumentColorsConfiguration(&sv.ColorsConfiguration, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnRole to be of type string, got %T instead", value) } sv.Role = types.ColumnRole(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnConfigurationList(v *[]types.ColumnConfiguration, 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.ColumnConfiguration if *v == nil { cv = []types.ColumnConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ColumnConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentColumnConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnDescription(v **types.ColumnDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnDescription if *v == nil { sv = &types.ColumnDescription{} } else { sv = *v } for key, value := range shape { switch key { case "Text": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnDescriptiveText to be of type string, got %T instead", value) } sv.Text = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnGroup(v **types.ColumnGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnGroup if *v == nil { sv = &types.ColumnGroup{} } else { sv = *v } for key, value := range shape { switch key { case "GeoSpatialColumnGroup": if err := awsRestjson1_deserializeDocumentGeoSpatialColumnGroup(&sv.GeoSpatialColumnGroup, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnGroupColumnSchema(v **types.ColumnGroupColumnSchema, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnGroupColumnSchema if *v == nil { sv = &types.ColumnGroupColumnSchema{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnGroupColumnSchemaList(v *[]types.ColumnGroupColumnSchema, 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.ColumnGroupColumnSchema if *v == nil { cv = []types.ColumnGroupColumnSchema{} } else { cv = *v } for _, value := range shape { var col types.ColumnGroupColumnSchema destAddr := &col if err := awsRestjson1_deserializeDocumentColumnGroupColumnSchema(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnGroupList(v *[]types.ColumnGroup, 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.ColumnGroup if *v == nil { cv = []types.ColumnGroup{} } else { cv = *v } for _, value := range shape { var col types.ColumnGroup destAddr := &col if err := awsRestjson1_deserializeDocumentColumnGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnGroupSchema(v **types.ColumnGroupSchema, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnGroupSchema if *v == nil { sv = &types.ColumnGroupSchema{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnGroupColumnSchemaList": if err := awsRestjson1_deserializeDocumentColumnGroupColumnSchemaList(&sv.ColumnGroupColumnSchemaList, 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnGroupSchemaList(v *[]types.ColumnGroupSchema, 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.ColumnGroupSchema if *v == nil { cv = []types.ColumnGroupSchema{} } else { cv = *v } for _, value := range shape { var col types.ColumnGroupSchema destAddr := &col if err := awsRestjson1_deserializeDocumentColumnGroupSchema(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnHierarchy(v **types.ColumnHierarchy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnHierarchy if *v == nil { sv = &types.ColumnHierarchy{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeHierarchy": if err := awsRestjson1_deserializeDocumentDateTimeHierarchy(&sv.DateTimeHierarchy, value); err != nil { return err } case "ExplicitHierarchy": if err := awsRestjson1_deserializeDocumentExplicitHierarchy(&sv.ExplicitHierarchy, value); err != nil { return err } case "PredefinedHierarchy": if err := awsRestjson1_deserializeDocumentPredefinedHierarchy(&sv.PredefinedHierarchy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnHierarchyList(v *[]types.ColumnHierarchy, 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.ColumnHierarchy if *v == nil { cv = []types.ColumnHierarchy{} } else { cv = *v } for _, value := range shape { var col types.ColumnHierarchy destAddr := &col if err := awsRestjson1_deserializeDocumentColumnHierarchy(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnIdentifier(v **types.ColumnIdentifier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnIdentifier if *v == nil { sv = &types.ColumnIdentifier{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnLevelPermissionRule(v **types.ColumnLevelPermissionRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnLevelPermissionRule if *v == nil { sv = &types.ColumnLevelPermissionRule{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnNames": if err := awsRestjson1_deserializeDocumentColumnNameList(&sv.ColumnNames, value); err != nil { return err } case "Principals": if err := awsRestjson1_deserializeDocumentPrincipalList(&sv.Principals, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnLevelPermissionRuleList(v *[]types.ColumnLevelPermissionRule, 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.ColumnLevelPermissionRule if *v == nil { cv = []types.ColumnLevelPermissionRule{} } else { cv = *v } for _, value := range shape { var col types.ColumnLevelPermissionRule destAddr := &col if err := awsRestjson1_deserializeDocumentColumnLevelPermissionRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnList(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 ColumnName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnNameList(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_deserializeDocumentColumnSchema(v **types.ColumnSchema, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnSchema if *v == nil { sv = &types.ColumnSchema{} } else { sv = *v } for key, value := range shape { switch key { case "DataType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DataType = ptr.String(jtv) } case "GeographicRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.GeographicRole = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnSchemaList(v *[]types.ColumnSchema, 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.ColumnSchema if *v == nil { cv = []types.ColumnSchema{} } else { cv = *v } for _, value := range shape { var col types.ColumnSchema destAddr := &col if err := awsRestjson1_deserializeDocumentColumnSchema(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnSort(v **types.ColumnSort, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnSort if *v == nil { sv = &types.ColumnSort{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if err := awsRestjson1_deserializeDocumentAggregationFunction(&sv.AggregationFunction, value); err != nil { return err } case "Direction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SortDirection to be of type string, got %T instead", value) } sv.Direction = types.SortDirection(jtv) } case "SortBy": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.SortBy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnTag(v **types.ColumnTag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnTag if *v == nil { sv = &types.ColumnTag{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnDescription": if err := awsRestjson1_deserializeDocumentColumnDescription(&sv.ColumnDescription, value); err != nil { return err } case "ColumnGeographicRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GeoSpatialDataRole to be of type string, got %T instead", value) } sv.ColumnGeographicRole = types.GeoSpatialDataRole(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentColumnTagList(v *[]types.ColumnTag, 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.ColumnTag if *v == nil { cv = []types.ColumnTag{} } else { cv = *v } for _, value := range shape { var col types.ColumnTag destAddr := &col if err := awsRestjson1_deserializeDocumentColumnTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnTagNames(v *[]types.ColumnTagName, 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.ColumnTagName if *v == nil { cv = []types.ColumnTagName{} } else { cv = *v } for _, value := range shape { var col types.ColumnTagName if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnTagName to be of type string, got %T instead", value) } col = types.ColumnTagName(jtv) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentColumnTooltipItem(v **types.ColumnTooltipItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ColumnTooltipItem if *v == nil { sv = &types.ColumnTooltipItem{} } else { sv = *v } for key, value := range shape { switch key { case "Aggregation": if err := awsRestjson1_deserializeDocumentAggregationFunction(&sv.Aggregation, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "Label": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Label = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComboChartAggregatedFieldWells(v **types.ComboChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComboChartAggregatedFieldWells if *v == nil { sv = &types.ComboChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "BarValues": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.BarValues, value); err != nil { return err } case "Category": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Category, value); err != nil { return err } case "Colors": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Colors, value); err != nil { return err } case "LineValues": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.LineValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComboChartConfiguration(v **types.ComboChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComboChartConfiguration if *v == nil { sv = &types.ComboChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BarDataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.BarDataLabels, value); err != nil { return err } case "BarsArrangement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BarsArrangement to be of type string, got %T instead", value) } sv.BarsArrangement = types.BarsArrangement(jtv) } case "CategoryAxis": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.CategoryAxis, value); err != nil { return err } case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "ColorLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ColorLabelOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentComboChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "LineDataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.LineDataLabels, value); err != nil { return err } case "PrimaryYAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.PrimaryYAxisDisplayOptions, value); err != nil { return err } case "PrimaryYAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.PrimaryYAxisLabelOptions, value); err != nil { return err } case "ReferenceLines": if err := awsRestjson1_deserializeDocumentReferenceLineList(&sv.ReferenceLines, value); err != nil { return err } case "SecondaryYAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.SecondaryYAxisDisplayOptions, value); err != nil { return err } case "SecondaryYAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.SecondaryYAxisLabelOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentComboChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComboChartFieldWells(v **types.ComboChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComboChartFieldWells if *v == nil { sv = &types.ComboChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "ComboChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentComboChartAggregatedFieldWells(&sv.ComboChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComboChartSortConfiguration(v **types.ComboChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComboChartSortConfiguration if *v == nil { sv = &types.ComboChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } case "ColorItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.ColorItemsLimit, value); err != nil { return err } case "ColorSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.ColorSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComboChartVisual(v **types.ComboChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComboChartVisual if *v == nil { sv = &types.ComboChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentComboChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComparativeOrder(v **types.ComparativeOrder, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComparativeOrder if *v == nil { sv = &types.ComparativeOrder{} } else { sv = *v } for key, value := range shape { switch key { case "SpecifedOrder": if err := awsRestjson1_deserializeDocumentStringList(&sv.SpecifedOrder, value); err != nil { return err } case "TreatUndefinedSpecifiedValues": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UndefinedSpecifiedValueType to be of type string, got %T instead", value) } sv.TreatUndefinedSpecifiedValues = types.UndefinedSpecifiedValueType(jtv) } case "UseOrdering": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnOrderingType to be of type string, got %T instead", value) } sv.UseOrdering = types.ColumnOrderingType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComparisonConfiguration(v **types.ComparisonConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComparisonConfiguration if *v == nil { sv = &types.ComparisonConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ComparisonFormat": if err := awsRestjson1_deserializeDocumentComparisonFormatConfiguration(&sv.ComparisonFormat, value); err != nil { return err } case "ComparisonMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ComparisonMethod to be of type string, got %T instead", value) } sv.ComparisonMethod = types.ComparisonMethod(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComparisonFormatConfiguration(v **types.ComparisonFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ComparisonFormatConfiguration if *v == nil { sv = &types.ComparisonFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "NumberDisplayFormatConfiguration": if err := awsRestjson1_deserializeDocumentNumberDisplayFormatConfiguration(&sv.NumberDisplayFormatConfiguration, value); err != nil { return err } case "PercentageDisplayFormatConfiguration": if err := awsRestjson1_deserializeDocumentPercentageDisplayFormatConfiguration(&sv.PercentageDisplayFormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComputation(v **types.Computation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Computation if *v == nil { sv = &types.Computation{} } else { sv = *v } for key, value := range shape { switch key { case "Forecast": if err := awsRestjson1_deserializeDocumentForecastComputation(&sv.Forecast, value); err != nil { return err } case "GrowthRate": if err := awsRestjson1_deserializeDocumentGrowthRateComputation(&sv.GrowthRate, value); err != nil { return err } case "MaximumMinimum": if err := awsRestjson1_deserializeDocumentMaximumMinimumComputation(&sv.MaximumMinimum, value); err != nil { return err } case "MetricComparison": if err := awsRestjson1_deserializeDocumentMetricComparisonComputation(&sv.MetricComparison, value); err != nil { return err } case "PeriodOverPeriod": if err := awsRestjson1_deserializeDocumentPeriodOverPeriodComputation(&sv.PeriodOverPeriod, value); err != nil { return err } case "PeriodToDate": if err := awsRestjson1_deserializeDocumentPeriodToDateComputation(&sv.PeriodToDate, value); err != nil { return err } case "TopBottomMovers": if err := awsRestjson1_deserializeDocumentTopBottomMoversComputation(&sv.TopBottomMovers, value); err != nil { return err } case "TopBottomRanked": if err := awsRestjson1_deserializeDocumentTopBottomRankedComputation(&sv.TopBottomRanked, value); err != nil { return err } case "TotalAggregation": if err := awsRestjson1_deserializeDocumentTotalAggregationComputation(&sv.TotalAggregation, value); err != nil { return err } case "UniqueValues": if err := awsRestjson1_deserializeDocumentUniqueValuesComputation(&sv.UniqueValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentComputationList(v *[]types.Computation, 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.Computation if *v == nil { cv = []types.Computation{} } else { cv = *v } for _, value := range shape { var col types.Computation destAddr := &col if err := awsRestjson1_deserializeDocumentComputation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentConcurrentUpdatingException(v **types.ConcurrentUpdatingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConcurrentUpdatingException if *v == nil { sv = &types.ConcurrentUpdatingException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingColor(v **types.ConditionalFormattingColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingColor if *v == nil { sv = &types.ConditionalFormattingColor{} } else { sv = *v } for key, value := range shape { switch key { case "Gradient": if err := awsRestjson1_deserializeDocumentConditionalFormattingGradientColor(&sv.Gradient, value); err != nil { return err } case "Solid": if err := awsRestjson1_deserializeDocumentConditionalFormattingSolidColor(&sv.Solid, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingCustomIconCondition(v **types.ConditionalFormattingCustomIconCondition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingCustomIconCondition if *v == nil { sv = &types.ConditionalFormattingCustomIconCondition{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "DisplayConfiguration": if err := awsRestjson1_deserializeDocumentConditionalFormattingIconDisplayConfiguration(&sv.DisplayConfiguration, value); err != nil { return err } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "IconOptions": if err := awsRestjson1_deserializeDocumentConditionalFormattingCustomIconOptions(&sv.IconOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingCustomIconOptions(v **types.ConditionalFormattingCustomIconOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingCustomIconOptions if *v == nil { sv = &types.ConditionalFormattingCustomIconOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Icon": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Icon to be of type string, got %T instead", value) } sv.Icon = types.Icon(jtv) } case "UnicodeIcon": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UnicodeIcon to be of type string, got %T instead", value) } sv.UnicodeIcon = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingGradientColor(v **types.ConditionalFormattingGradientColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingGradientColor if *v == nil { sv = &types.ConditionalFormattingGradientColor{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if err := awsRestjson1_deserializeDocumentGradientColor(&sv.Color, value); err != nil { return err } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingIcon(v **types.ConditionalFormattingIcon, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingIcon if *v == nil { sv = &types.ConditionalFormattingIcon{} } else { sv = *v } for key, value := range shape { switch key { case "CustomCondition": if err := awsRestjson1_deserializeDocumentConditionalFormattingCustomIconCondition(&sv.CustomCondition, value); err != nil { return err } case "IconSet": if err := awsRestjson1_deserializeDocumentConditionalFormattingIconSet(&sv.IconSet, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingIconDisplayConfiguration(v **types.ConditionalFormattingIconDisplayConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingIconDisplayConfiguration if *v == nil { sv = &types.ConditionalFormattingIconDisplayConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "IconDisplayOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConditionalFormattingIconDisplayOption to be of type string, got %T instead", value) } sv.IconDisplayOption = types.ConditionalFormattingIconDisplayOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingIconSet(v **types.ConditionalFormattingIconSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingIconSet if *v == nil { sv = &types.ConditionalFormattingIconSet{} } else { sv = *v } for key, value := range shape { switch key { case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "IconSetType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConditionalFormattingIconSetType to be of type string, got %T instead", value) } sv.IconSetType = types.ConditionalFormattingIconSetType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConditionalFormattingSolidColor(v **types.ConditionalFormattingSolidColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ConditionalFormattingSolidColor if *v == nil { sv = &types.ConditionalFormattingSolidColor{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = 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 "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) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContributionAnalysisDefault(v **types.ContributionAnalysisDefault, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ContributionAnalysisDefault if *v == nil { sv = &types.ContributionAnalysisDefault{} } else { sv = *v } for key, value := range shape { switch key { case "ContributorDimensions": if err := awsRestjson1_deserializeDocumentContributorDimensionList(&sv.ContributorDimensions, value); err != nil { return err } case "MeasureFieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.MeasureFieldId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContributionAnalysisDefaultList(v *[]types.ContributionAnalysisDefault, 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.ContributionAnalysisDefault if *v == nil { cv = []types.ContributionAnalysisDefault{} } else { cv = *v } for _, value := range shape { var col types.ContributionAnalysisDefault destAddr := &col if err := awsRestjson1_deserializeDocumentContributionAnalysisDefault(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentContributorDimensionList(v *[]types.ColumnIdentifier, 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.ColumnIdentifier if *v == nil { cv = []types.ColumnIdentifier{} } else { cv = *v } for _, value := range shape { var col types.ColumnIdentifier destAddr := &col if err := awsRestjson1_deserializeDocumentColumnIdentifier(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCreateColumnsOperation(v **types.CreateColumnsOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CreateColumnsOperation if *v == nil { sv = &types.CreateColumnsOperation{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentCalculatedColumnList(&sv.Columns, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCurrencyDisplayFormatConfiguration(v **types.CurrencyDisplayFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CurrencyDisplayFormatConfiguration if *v == nil { sv = &types.CurrencyDisplayFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DecimalPlacesConfiguration": if err := awsRestjson1_deserializeDocumentDecimalPlacesConfiguration(&sv.DecimalPlacesConfiguration, value); err != nil { return err } case "NegativeValueConfiguration": if err := awsRestjson1_deserializeDocumentNegativeValueConfiguration(&sv.NegativeValueConfiguration, value); err != nil { return err } case "NullValueFormatConfiguration": if err := awsRestjson1_deserializeDocumentNullValueFormatConfiguration(&sv.NullValueFormatConfiguration, value); err != nil { return err } case "NumberScale": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberScale to be of type string, got %T instead", value) } sv.NumberScale = types.NumberScale(jtv) } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "SeparatorConfiguration": if err := awsRestjson1_deserializeDocumentNumericSeparatorConfiguration(&sv.SeparatorConfiguration, value); err != nil { return err } case "Suffix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Suffix to be of type string, got %T instead", value) } sv.Suffix = ptr.String(jtv) } case "Symbol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CurrencyCode to be of type string, got %T instead", value) } sv.Symbol = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomActionColumnList(v *[]types.ColumnIdentifier, 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.ColumnIdentifier if *v == nil { cv = []types.ColumnIdentifier{} } else { cv = *v } for _, value := range shape { var col types.ColumnIdentifier destAddr := &col if err := awsRestjson1_deserializeDocumentColumnIdentifier(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCustomActionFilterOperation(v **types.CustomActionFilterOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomActionFilterOperation if *v == nil { sv = &types.CustomActionFilterOperation{} } else { sv = *v } for key, value := range shape { switch key { case "SelectedFieldsConfiguration": if err := awsRestjson1_deserializeDocumentFilterOperationSelectedFieldsConfiguration(&sv.SelectedFieldsConfiguration, value); err != nil { return err } case "TargetVisualsConfiguration": if err := awsRestjson1_deserializeDocumentFilterOperationTargetVisualsConfiguration(&sv.TargetVisualsConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomActionNavigationOperation(v **types.CustomActionNavigationOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomActionNavigationOperation if *v == nil { sv = &types.CustomActionNavigationOperation{} } else { sv = *v } for key, value := range shape { switch key { case "LocalNavigationConfiguration": if err := awsRestjson1_deserializeDocumentLocalNavigationConfiguration(&sv.LocalNavigationConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomActionSetParametersOperation(v **types.CustomActionSetParametersOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomActionSetParametersOperation if *v == nil { sv = &types.CustomActionSetParametersOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ParameterValueConfigurations": if err := awsRestjson1_deserializeDocumentSetParameterValueConfigurationList(&sv.ParameterValueConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomActionURLOperation(v **types.CustomActionURLOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomActionURLOperation if *v == nil { sv = &types.CustomActionURLOperation{} } else { sv = *v } for key, value := range shape { switch key { case "URLTarget": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URLTargetConfiguration to be of type string, got %T instead", value) } sv.URLTarget = types.URLTargetConfiguration(jtv) } case "URLTemplate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URLOperationTemplate to be of type string, got %T instead", value) } sv.URLTemplate = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomColor(v **types.CustomColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomColor if *v == nil { sv = &types.CustomColor{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "FieldValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldValue to be of type string, got %T instead", value) } sv.FieldValue = ptr.String(jtv) } case "SpecialValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SpecialValue to be of type string, got %T instead", value) } sv.SpecialValue = types.SpecialValue(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomColorsList(v *[]types.CustomColor, 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.CustomColor if *v == nil { cv = []types.CustomColor{} } else { cv = *v } for _, value := range shape { var col types.CustomColor destAddr := &col if err := awsRestjson1_deserializeDocumentCustomColor(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCustomContentConfiguration(v **types.CustomContentConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomContentConfiguration if *v == nil { sv = &types.CustomContentConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ContentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomContentType to be of type string, got %T instead", value) } sv.ContentType = types.CustomContentType(jtv) } case "ContentUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URLOperationTemplate to be of type string, got %T instead", value) } sv.ContentUrl = ptr.String(jtv) } case "ImageScaling": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomContentImageScalingConfiguration to be of type string, got %T instead", value) } sv.ImageScaling = types.CustomContentImageScalingConfiguration(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomContentVisual(v **types.CustomContentVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomContentVisual if *v == nil { sv = &types.CustomContentVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentCustomContentConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomFilterConfiguration(v **types.CustomFilterConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomFilterConfiguration if *v == nil { sv = &types.CustomFilterConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryValue to be of type string, got %T instead", value) } sv.CategoryValue = ptr.String(jtv) } case "MatchOperator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterMatchOperator to be of type string, got %T instead", value) } sv.MatchOperator = types.CategoryFilterMatchOperator(jtv) } case "NullOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterNullOption to be of type string, got %T instead", value) } sv.NullOption = types.FilterNullOption(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "SelectAllOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterSelectAllOptions to be of type string, got %T instead", value) } sv.SelectAllOptions = types.CategoryFilterSelectAllOptions(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomFilterListConfiguration(v **types.CustomFilterListConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomFilterListConfiguration if *v == nil { sv = &types.CustomFilterListConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryValues": if err := awsRestjson1_deserializeDocumentCategoryValueList(&sv.CategoryValues, value); err != nil { return err } case "MatchOperator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterMatchOperator to be of type string, got %T instead", value) } sv.MatchOperator = types.CategoryFilterMatchOperator(jtv) } case "NullOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterNullOption to be of type string, got %T instead", value) } sv.NullOption = types.FilterNullOption(jtv) } case "SelectAllOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterSelectAllOptions to be of type string, got %T instead", value) } sv.SelectAllOptions = types.CategoryFilterSelectAllOptions(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomNarrativeOptions(v **types.CustomNarrativeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomNarrativeOptions if *v == nil { sv = &types.CustomNarrativeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Narrative": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NarrativeString to be of type string, got %T instead", value) } sv.Narrative = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomParameterValues(v **types.CustomParameterValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomParameterValues if *v == nil { sv = &types.CustomParameterValues{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeValues": if err := awsRestjson1_deserializeDocumentDateTimeDefaultValueList(&sv.DateTimeValues, value); err != nil { return err } case "DecimalValues": if err := awsRestjson1_deserializeDocumentDecimalDefaultValueList(&sv.DecimalValues, value); err != nil { return err } case "IntegerValues": if err := awsRestjson1_deserializeDocumentIntegerDefaultValueList(&sv.IntegerValues, value); err != nil { return err } case "StringValues": if err := awsRestjson1_deserializeDocumentStringDefaultValueList(&sv.StringValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomSql(v **types.CustomSql, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomSql if *v == nil { sv = &types.CustomSql{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentInputColumnList(&sv.Columns, value); err != nil { return err } case "DataSourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSourceArn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomSqlName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SqlQuery": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SqlQuery to be of type string, got %T instead", value) } sv.SqlQuery = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomValuesConfiguration(v **types.CustomValuesConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CustomValuesConfiguration if *v == nil { sv = &types.CustomValuesConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomValues": if err := awsRestjson1_deserializeDocumentCustomParameterValues(&sv.CustomValues, value); err != nil { return err } case "IncludeNullValue": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value) } sv.IncludeNullValue = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboard(v **types.Dashboard, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Dashboard if *v == nil { sv = &types.Dashboard{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "LastPublishedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastPublishedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Version": if err := awsRestjson1_deserializeDocumentDashboardVersion(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardError(v **types.DashboardError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardError if *v == nil { sv = &types.DashboardError{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardErrorType to be of type string, got %T instead", value) } sv.Type = types.DashboardErrorType(jtv) } case "ViolatedEntities": if err := awsRestjson1_deserializeDocumentEntityList(&sv.ViolatedEntities, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardErrorList(v *[]types.DashboardError, 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.DashboardError if *v == nil { cv = []types.DashboardError{} } else { cv = *v } for _, value := range shape { var col types.DashboardError destAddr := &col if err := awsRestjson1_deserializeDocumentDashboardError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDashboardPublishOptions(v **types.DashboardPublishOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardPublishOptions if *v == nil { sv = &types.DashboardPublishOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AdHocFilteringOption": if err := awsRestjson1_deserializeDocumentAdHocFilteringOption(&sv.AdHocFilteringOption, value); err != nil { return err } case "DataPointDrillUpDownOption": if err := awsRestjson1_deserializeDocumentDataPointDrillUpDownOption(&sv.DataPointDrillUpDownOption, value); err != nil { return err } case "DataPointMenuLabelOption": if err := awsRestjson1_deserializeDocumentDataPointMenuLabelOption(&sv.DataPointMenuLabelOption, value); err != nil { return err } case "DataPointTooltipOption": if err := awsRestjson1_deserializeDocumentDataPointTooltipOption(&sv.DataPointTooltipOption, value); err != nil { return err } case "ExportToCSVOption": if err := awsRestjson1_deserializeDocumentExportToCSVOption(&sv.ExportToCSVOption, value); err != nil { return err } case "ExportWithHiddenFieldsOption": if err := awsRestjson1_deserializeDocumentExportWithHiddenFieldsOption(&sv.ExportWithHiddenFieldsOption, value); err != nil { return err } case "SheetControlsOption": if err := awsRestjson1_deserializeDocumentSheetControlsOption(&sv.SheetControlsOption, value); err != nil { return err } case "SheetLayoutElementMaximizationOption": if err := awsRestjson1_deserializeDocumentSheetLayoutElementMaximizationOption(&sv.SheetLayoutElementMaximizationOption, value); err != nil { return err } case "VisualAxisSortOption": if err := awsRestjson1_deserializeDocumentVisualAxisSortOption(&sv.VisualAxisSortOption, value); err != nil { return err } case "VisualMenuOption": if err := awsRestjson1_deserializeDocumentVisualMenuOption(&sv.VisualMenuOption, value); err != nil { return err } case "VisualPublishOptions": if err := awsRestjson1_deserializeDocumentDashboardVisualPublishOptions(&sv.VisualPublishOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardSummary(v **types.DashboardSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardSummary if *v == nil { sv = &types.DashboardSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DashboardId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.DashboardId = ptr.String(jtv) } case "LastPublishedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastPublishedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PublishedVersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PublishedVersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardSummaryList(v *[]types.DashboardSummary, 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.DashboardSummary if *v == nil { cv = []types.DashboardSummary{} } else { cv = *v } for _, value := range shape { var col types.DashboardSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDashboardSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDashboardVersion(v **types.DashboardVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardVersion if *v == nil { sv = &types.DashboardVersion{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSetArns": if err := awsRestjson1_deserializeDocumentDataSetArnsList(&sv.DataSetArns, value); err != nil { return err } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Errors": if err := awsRestjson1_deserializeDocumentDashboardErrorList(&sv.Errors, value); err != nil { return err } case "Sheets": if err := awsRestjson1_deserializeDocumentSheetList(&sv.Sheets, value); err != nil { return err } case "SourceEntityArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.SourceEntityArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } case "VersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardVersionDefinition(v **types.DashboardVersionDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardVersionDefinition if *v == nil { sv = &types.DashboardVersionDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisDefaults": if err := awsRestjson1_deserializeDocumentAnalysisDefaults(&sv.AnalysisDefaults, value); err != nil { return err } case "CalculatedFields": if err := awsRestjson1_deserializeDocumentCalculatedFields(&sv.CalculatedFields, value); err != nil { return err } case "ColumnConfigurations": if err := awsRestjson1_deserializeDocumentColumnConfigurationList(&sv.ColumnConfigurations, value); err != nil { return err } case "DataSetIdentifierDeclarations": if err := awsRestjson1_deserializeDocumentDataSetIdentifierDeclarationList(&sv.DataSetIdentifierDeclarations, value); err != nil { return err } case "FilterGroups": if err := awsRestjson1_deserializeDocumentFilterGroupList(&sv.FilterGroups, value); err != nil { return err } case "ParameterDeclarations": if err := awsRestjson1_deserializeDocumentParameterDeclarationList(&sv.ParameterDeclarations, value); err != nil { return err } case "Sheets": if err := awsRestjson1_deserializeDocumentSheetDefinitionList(&sv.Sheets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardVersionSummary(v **types.DashboardVersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardVersionSummary if *v == nil { sv = &types.DashboardVersionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "SourceEntityArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.SourceEntityArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "VersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDashboardVersionSummaryList(v *[]types.DashboardVersionSummary, 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.DashboardVersionSummary if *v == nil { cv = []types.DashboardVersionSummary{} } else { cv = *v } for _, value := range shape { var col types.DashboardVersionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDashboardVersionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDashboardVisualPublishOptions(v **types.DashboardVisualPublishOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DashboardVisualPublishOptions if *v == nil { sv = &types.DashboardVisualPublishOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ExportHiddenFieldsOption": if err := awsRestjson1_deserializeDocumentExportHiddenFieldsOption(&sv.ExportHiddenFieldsOption, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataAggregation(v **types.DataAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataAggregation if *v == nil { sv = &types.DataAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "DatasetRowDateGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicTimeGranularity to be of type string, got %T instead", value) } sv.DatasetRowDateGranularity = types.TopicTimeGranularity(jtv) } case "DefaultDateColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.DefaultDateColumnName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataBarsOptions(v **types.DataBarsOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataBarsOptions if *v == nil { sv = &types.DataBarsOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "NegativeColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.NegativeColor = ptr.String(jtv) } case "PositiveColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.PositiveColor = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDatabricksParameters(v **types.DatabricksParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DatabricksParameters if *v == nil { sv = &types.DatabricksParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } case "SqlEndpointPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SqlEndpointPath to be of type string, got %T instead", value) } sv.SqlEndpointPath = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataColor(v **types.DataColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataColor if *v == nil { sv = &types.DataColor{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "DataValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DataValue = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.DataValue = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataColorPalette(v **types.DataColorPalette, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataColorPalette if *v == nil { sv = &types.DataColorPalette{} } else { sv = *v } for key, value := range shape { switch key { case "Colors": if err := awsRestjson1_deserializeDocumentColorList(&sv.Colors, value); err != nil { return err } case "EmptyFillColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.EmptyFillColor = ptr.String(jtv) } case "MinMaxGradient": if err := awsRestjson1_deserializeDocumentColorList(&sv.MinMaxGradient, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataFieldSeriesItem(v **types.DataFieldSeriesItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataFieldSeriesItem if *v == nil { sv = &types.DataFieldSeriesItem{} } else { sv = *v } for key, value := range shape { switch key { case "AxisBinding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AxisBinding to be of type string, got %T instead", value) } sv.AxisBinding = types.AxisBinding(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FieldValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) } sv.FieldValue = ptr.String(jtv) } case "Settings": if err := awsRestjson1_deserializeDocumentLineChartSeriesSettings(&sv.Settings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataLabelOptions(v **types.DataLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataLabelOptions if *v == nil { sv = &types.DataLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryLabelVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.CategoryLabelVisibility = types.Visibility(jtv) } case "DataLabelTypes": if err := awsRestjson1_deserializeDocumentDataLabelTypes(&sv.DataLabelTypes, value); err != nil { return err } case "LabelColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.LabelColor = ptr.String(jtv) } case "LabelContent": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataLabelContent to be of type string, got %T instead", value) } sv.LabelContent = types.DataLabelContent(jtv) } case "LabelFontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.LabelFontConfiguration, value); err != nil { return err } case "MeasureLabelVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.MeasureLabelVisibility = types.Visibility(jtv) } case "Overlap": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataLabelOverlap to be of type string, got %T instead", value) } sv.Overlap = types.DataLabelOverlap(jtv) } case "Position": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataLabelPosition to be of type string, got %T instead", value) } sv.Position = types.DataLabelPosition(jtv) } case "TotalsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.TotalsVisibility = types.Visibility(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataLabelType(v **types.DataLabelType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataLabelType if *v == nil { sv = &types.DataLabelType{} } else { sv = *v } for key, value := range shape { switch key { case "DataPathLabelType": if err := awsRestjson1_deserializeDocumentDataPathLabelType(&sv.DataPathLabelType, value); err != nil { return err } case "FieldLabelType": if err := awsRestjson1_deserializeDocumentFieldLabelType(&sv.FieldLabelType, value); err != nil { return err } case "MaximumLabelType": if err := awsRestjson1_deserializeDocumentMaximumLabelType(&sv.MaximumLabelType, value); err != nil { return err } case "MinimumLabelType": if err := awsRestjson1_deserializeDocumentMinimumLabelType(&sv.MinimumLabelType, value); err != nil { return err } case "RangeEndsLabelType": if err := awsRestjson1_deserializeDocumentRangeEndsLabelType(&sv.RangeEndsLabelType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataLabelTypes(v *[]types.DataLabelType, 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.DataLabelType if *v == nil { cv = []types.DataLabelType{} } else { cv = *v } for _, value := range shape { var col types.DataLabelType destAddr := &col if err := awsRestjson1_deserializeDocumentDataLabelType(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataPathColor(v **types.DataPathColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPathColor if *v == nil { sv = &types.DataPathColor{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "Element": if err := awsRestjson1_deserializeDocumentDataPathValue(&sv.Element, value); err != nil { return err } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataPathColorList(v *[]types.DataPathColor, 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.DataPathColor if *v == nil { cv = []types.DataPathColor{} } else { cv = *v } for _, value := range shape { var col types.DataPathColor destAddr := &col if err := awsRestjson1_deserializeDocumentDataPathColor(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataPathLabelType(v **types.DataPathLabelType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPathLabelType if *v == nil { sv = &types.DataPathLabelType{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FieldValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldValue to be of type string, got %T instead", value) } sv.FieldValue = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataPathSort(v **types.DataPathSort, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPathSort if *v == nil { sv = &types.DataPathSort{} } else { sv = *v } for key, value := range shape { switch key { case "Direction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SortDirection to be of type string, got %T instead", value) } sv.Direction = types.SortDirection(jtv) } case "SortPaths": if err := awsRestjson1_deserializeDocumentDataPathValueList(&sv.SortPaths, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataPathValue(v **types.DataPathValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPathValue if *v == nil { sv = &types.DataPathValue{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FieldValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldValue to be of type string, got %T instead", value) } sv.FieldValue = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataPathValueList(v *[]types.DataPathValue, 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.DataPathValue if *v == nil { cv = []types.DataPathValue{} } else { cv = *v } for _, value := range shape { var col types.DataPathValue destAddr := &col if err := awsRestjson1_deserializeDocumentDataPathValue(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataPointDrillUpDownOption(v **types.DataPointDrillUpDownOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPointDrillUpDownOption if *v == nil { sv = &types.DataPointDrillUpDownOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataPointMenuLabelOption(v **types.DataPointMenuLabelOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPointMenuLabelOption if *v == nil { sv = &types.DataPointMenuLabelOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataPointTooltipOption(v **types.DataPointTooltipOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataPointTooltipOption if *v == nil { sv = &types.DataPointTooltipOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSet(v **types.DataSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSet if *v == nil { sv = &types.DataSet{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ColumnGroups": if err := awsRestjson1_deserializeDocumentColumnGroupList(&sv.ColumnGroups, value); err != nil { return err } case "ColumnLevelPermissionRules": if err := awsRestjson1_deserializeDocumentColumnLevelPermissionRuleList(&sv.ColumnLevelPermissionRules, value); err != nil { return err } case "ConsumedSpiceCapacityInBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ConsumedSpiceCapacityInBytes = i64 } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "DatasetParameters": if err := awsRestjson1_deserializeDocumentDatasetParameterList(&sv.DatasetParameters, value); err != nil { return err } case "DataSetUsageConfiguration": if err := awsRestjson1_deserializeDocumentDataSetUsageConfiguration(&sv.DataSetUsageConfiguration, value); err != nil { return err } case "FieldFolders": if err := awsRestjson1_deserializeDocumentFieldFolderMap(&sv.FieldFolders, value); err != nil { return err } case "ImportMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetImportMode to be of type string, got %T instead", value) } sv.ImportMode = types.DataSetImportMode(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LogicalTableMap": if err := awsRestjson1_deserializeDocumentLogicalTableMap(&sv.LogicalTableMap, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OutputColumns": if err := awsRestjson1_deserializeDocumentOutputColumnList(&sv.OutputColumns, value); err != nil { return err } case "PhysicalTableMap": if err := awsRestjson1_deserializeDocumentPhysicalTableMap(&sv.PhysicalTableMap, value); err != nil { return err } case "RowLevelPermissionDataSet": if err := awsRestjson1_deserializeDocumentRowLevelPermissionDataSet(&sv.RowLevelPermissionDataSet, value); err != nil { return err } case "RowLevelPermissionTagConfiguration": if err := awsRestjson1_deserializeDocumentRowLevelPermissionTagConfiguration(&sv.RowLevelPermissionTagConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetArnsList(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 Arn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetConfiguration(v **types.DataSetConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSetConfiguration if *v == nil { sv = &types.DataSetConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnGroupSchemaList": if err := awsRestjson1_deserializeDocumentColumnGroupSchemaList(&sv.ColumnGroupSchemaList, value); err != nil { return err } case "DataSetSchema": if err := awsRestjson1_deserializeDocumentDataSetSchema(&sv.DataSetSchema, value); err != nil { return err } case "Placeholder": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Placeholder = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetConfigurationList(v *[]types.DataSetConfiguration, 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.DataSetConfiguration if *v == nil { cv = []types.DataSetConfiguration{} } else { cv = *v } for _, value := range shape { var col types.DataSetConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentDataSetConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetIdentifierDeclaration(v **types.DataSetIdentifierDeclaration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSetIdentifierDeclaration if *v == nil { sv = &types.DataSetIdentifierDeclaration{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSetArn = ptr.String(jtv) } case "Identifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.Identifier = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetIdentifierDeclarationList(v *[]types.DataSetIdentifierDeclaration, 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.DataSetIdentifierDeclaration if *v == nil { cv = []types.DataSetIdentifierDeclaration{} } else { cv = *v } for _, value := range shape { var col types.DataSetIdentifierDeclaration destAddr := &col if err := awsRestjson1_deserializeDocumentDataSetIdentifierDeclaration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDatasetMetadata(v **types.DatasetMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DatasetMetadata if *v == nil { sv = &types.DatasetMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "CalculatedFields": if err := awsRestjson1_deserializeDocumentTopicCalculatedFields(&sv.CalculatedFields, value); err != nil { return err } case "Columns": if err := awsRestjson1_deserializeDocumentTopicColumns(&sv.Columns, value); err != nil { return err } case "DataAggregation": if err := awsRestjson1_deserializeDocumentDataAggregation(&sv.DataAggregation, value); err != nil { return err } case "DatasetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DatasetArn = ptr.String(jtv) } case "DatasetDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.DatasetDescription = ptr.String(jtv) } case "DatasetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.DatasetName = ptr.String(jtv) } case "Filters": if err := awsRestjson1_deserializeDocumentTopicFilters(&sv.Filters, value); err != nil { return err } case "NamedEntities": if err := awsRestjson1_deserializeDocumentTopicNamedEntities(&sv.NamedEntities, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDatasetParameter(v **types.DatasetParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DatasetParameter if *v == nil { sv = &types.DatasetParameter{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeDatasetParameter": if err := awsRestjson1_deserializeDocumentDateTimeDatasetParameter(&sv.DateTimeDatasetParameter, value); err != nil { return err } case "DecimalDatasetParameter": if err := awsRestjson1_deserializeDocumentDecimalDatasetParameter(&sv.DecimalDatasetParameter, value); err != nil { return err } case "IntegerDatasetParameter": if err := awsRestjson1_deserializeDocumentIntegerDatasetParameter(&sv.IntegerDatasetParameter, value); err != nil { return err } case "StringDatasetParameter": if err := awsRestjson1_deserializeDocumentStringDatasetParameter(&sv.StringDatasetParameter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDatasetParameterList(v *[]types.DatasetParameter, 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.DatasetParameter if *v == nil { cv = []types.DatasetParameter{} } else { cv = *v } for _, value := range shape { var col types.DatasetParameter destAddr := &col if err := awsRestjson1_deserializeDocumentDatasetParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetRefreshProperties(v **types.DataSetRefreshProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSetRefreshProperties if *v == nil { sv = &types.DataSetRefreshProperties{} } else { sv = *v } for key, value := range shape { switch key { case "RefreshConfiguration": if err := awsRestjson1_deserializeDocumentRefreshConfiguration(&sv.RefreshConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDatasets(v *[]types.DatasetMetadata, 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.DatasetMetadata if *v == nil { cv = []types.DatasetMetadata{} } else { cv = *v } for _, value := range shape { var col types.DatasetMetadata destAddr := &col if err := awsRestjson1_deserializeDocumentDatasetMetadata(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetSchema(v **types.DataSetSchema, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSetSchema if *v == nil { sv = &types.DataSetSchema{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnSchemaList": if err := awsRestjson1_deserializeDocumentColumnSchemaList(&sv.ColumnSchemaList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetSummary(v **types.DataSetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSetSummary if *v == nil { sv = &types.DataSetSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ColumnLevelPermissionRulesApplied": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ColumnLevelPermissionRulesApplied = jtv } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSetId = ptr.String(jtv) } case "ImportMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetImportMode to be of type string, got %T instead", value) } sv.ImportMode = types.DataSetImportMode(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RowLevelPermissionDataSet": if err := awsRestjson1_deserializeDocumentRowLevelPermissionDataSet(&sv.RowLevelPermissionDataSet, value); err != nil { return err } case "RowLevelPermissionTagConfigurationApplied": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RowLevelPermissionTagConfigurationApplied = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetSummaryList(v *[]types.DataSetSummary, 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.DataSetSummary if *v == nil { cv = []types.DataSetSummary{} } else { cv = *v } for _, value := range shape { var col types.DataSetSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDataSetSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetUsageConfiguration(v **types.DataSetUsageConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSetUsageConfiguration if *v == nil { sv = &types.DataSetUsageConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DisableUseAsDirectQuerySource": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableUseAsDirectQuerySource = jtv } case "DisableUseAsImportedSource": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableUseAsImportedSource = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSource if *v == nil { sv = &types.DataSource{} } else { sv = *v } for key, value := range shape { switch key { case "AlternateDataSourceParameters": if err := awsRestjson1_deserializeDocumentDataSourceParametersList(&sv.AlternateDataSourceParameters, value); err != nil { return err } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "DataSourceParameters": if err := awsRestjson1_deserializeDocumentDataSourceParameters(&sv.DataSourceParameters, value); err != nil { return err } case "ErrorInfo": if err := awsRestjson1_deserializeDocumentDataSourceErrorInfo(&sv.ErrorInfo, value); err != nil { return err } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SecretArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecretArn to be of type string, got %T instead", value) } sv.SecretArn = ptr.String(jtv) } case "SslProperties": if err := awsRestjson1_deserializeDocumentSslProperties(&sv.SslProperties, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) } sv.Type = types.DataSourceType(jtv) } case "VpcConnectionProperties": if err := awsRestjson1_deserializeDocumentVpcConnectionProperties(&sv.VpcConnectionProperties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSourceErrorInfo(v **types.DataSourceErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSourceErrorInfo if *v == nil { sv = &types.DataSourceErrorInfo{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSourceErrorInfoType to be of type string, got %T instead", value) } sv.Type = types.DataSourceErrorInfoType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSourceList(v *[]types.DataSource, 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.DataSource if *v == nil { cv = []types.DataSource{} } else { cv = *v } for _, value := range shape { var col types.DataSource destAddr := &col if err := awsRestjson1_deserializeDocumentDataSource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSourceParameters(v *types.DataSourceParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var uv types.DataSourceParameters loop: for key, value := range shape { if value == nil { continue } switch key { case "AmazonElasticsearchParameters": var mv types.AmazonElasticsearchParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentAmazonElasticsearchParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberAmazonElasticsearchParameters{Value: mv} break loop case "AmazonOpenSearchParameters": var mv types.AmazonOpenSearchParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentAmazonOpenSearchParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberAmazonOpenSearchParameters{Value: mv} break loop case "AthenaParameters": var mv types.AthenaParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentAthenaParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberAthenaParameters{Value: mv} break loop case "AuroraParameters": var mv types.AuroraParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentAuroraParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberAuroraParameters{Value: mv} break loop case "AuroraPostgreSqlParameters": var mv types.AuroraPostgreSqlParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentAuroraPostgreSqlParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberAuroraPostgreSqlParameters{Value: mv} break loop case "AwsIotAnalyticsParameters": var mv types.AwsIotAnalyticsParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentAwsIotAnalyticsParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberAwsIotAnalyticsParameters{Value: mv} break loop case "DatabricksParameters": var mv types.DatabricksParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentDatabricksParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberDatabricksParameters{Value: mv} break loop case "ExasolParameters": var mv types.ExasolParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentExasolParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberExasolParameters{Value: mv} break loop case "JiraParameters": var mv types.JiraParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentJiraParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberJiraParameters{Value: mv} break loop case "MariaDbParameters": var mv types.MariaDbParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentMariaDbParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberMariaDbParameters{Value: mv} break loop case "MySqlParameters": var mv types.MySqlParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentMySqlParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberMySqlParameters{Value: mv} break loop case "OracleParameters": var mv types.OracleParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentOracleParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberOracleParameters{Value: mv} break loop case "PostgreSqlParameters": var mv types.PostgreSqlParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentPostgreSqlParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberPostgreSqlParameters{Value: mv} break loop case "PrestoParameters": var mv types.PrestoParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentPrestoParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberPrestoParameters{Value: mv} break loop case "RdsParameters": var mv types.RdsParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentRdsParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberRdsParameters{Value: mv} break loop case "RedshiftParameters": var mv types.RedshiftParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentRedshiftParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberRedshiftParameters{Value: mv} break loop case "S3Parameters": var mv types.S3Parameters destAddr := &mv if err := awsRestjson1_deserializeDocumentS3Parameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberS3Parameters{Value: mv} break loop case "ServiceNowParameters": var mv types.ServiceNowParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentServiceNowParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberServiceNowParameters{Value: mv} break loop case "SnowflakeParameters": var mv types.SnowflakeParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentSnowflakeParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberSnowflakeParameters{Value: mv} break loop case "SparkParameters": var mv types.SparkParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentSparkParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberSparkParameters{Value: mv} break loop case "SqlServerParameters": var mv types.SqlServerParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentSqlServerParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberSqlServerParameters{Value: mv} break loop case "TeradataParameters": var mv types.TeradataParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentTeradataParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberTeradataParameters{Value: mv} break loop case "TwitterParameters": var mv types.TwitterParameters destAddr := &mv if err := awsRestjson1_deserializeDocumentTwitterParameters(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DataSourceParametersMemberTwitterParameters{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentDataSourceParametersList(v *[]types.DataSourceParameters, 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.DataSourceParameters if *v == nil { cv = []types.DataSourceParameters{} } else { cv = *v } for _, value := range shape { var col types.DataSourceParameters if err := awsRestjson1_deserializeDocumentDataSourceParameters(&col, value); err != nil { return err } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSourceSummary(v **types.DataSourceSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DataSourceSummary if *v == nil { sv = &types.DataSourceSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) } sv.Type = types.DataSourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSourceSummaryList(v *[]types.DataSourceSummary, 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.DataSourceSummary if *v == nil { cv = []types.DataSourceSummary{} } else { cv = *v } for _, value := range shape { var col types.DataSourceSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDataSourceSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDateAxisOptions(v **types.DateAxisOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateAxisOptions if *v == nil { sv = &types.DateAxisOptions{} } else { sv = *v } for key, value := range shape { switch key { case "MissingDateVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.MissingDateVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateDimensionField(v **types.DateDimensionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateDimensionField if *v == nil { sv = &types.DateDimensionField{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "DateGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.DateGranularity = types.TimeGranularity(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentDateTimeFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } case "HierarchyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HierarchyId to be of type string, got %T instead", value) } sv.HierarchyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateMeasureField(v **types.DateMeasureField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateMeasureField if *v == nil { sv = &types.DateMeasureField{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateAggregationFunction to be of type string, got %T instead", value) } sv.AggregationFunction = types.DateAggregationFunction(jtv) } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentDateTimeFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeDatasetParameter(v **types.DateTimeDatasetParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeDatasetParameter if *v == nil { sv = &types.DateTimeDatasetParameter{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentDateTimeDatasetParameterDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } case "ValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterValueType to be of type string, got %T instead", value) } sv.ValueType = types.DatasetParameterValueType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeDatasetParameterDefaultValues(v **types.DateTimeDatasetParameterDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeDatasetParameterDefaultValues if *v == nil { sv = &types.DateTimeDatasetParameterDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "StaticValues": if err := awsRestjson1_deserializeDocumentDateTimeDatasetParameterValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeDatasetParameterValueList(v *[]time.Time, 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 []time.Time if *v == nil { cv = []time.Time{} } else { cv = *v } for _, value := range shape { var col time.Time if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } col = smithytime.ParseEpochSeconds(f64) default: return fmt.Errorf("expected DateTimeDatasetParameterDefaultValue to be a JSON Number, got %T instead", value) } } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDateTimeDefaultValueList(v *[]time.Time, 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 []time.Time if *v == nil { cv = []time.Time{} } else { cv = *v } for _, value := range shape { var col time.Time if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } col = smithytime.ParseEpochSeconds(f64) default: return fmt.Errorf("expected SensitiveTimestamp to be a JSON Number, got %T instead", value) } } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDateTimeDefaultValues(v **types.DateTimeDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeDefaultValues if *v == nil { sv = &types.DateTimeDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "DynamicValue": if err := awsRestjson1_deserializeDocumentDynamicDefaultValue(&sv.DynamicValue, value); err != nil { return err } case "RollingDate": if err := awsRestjson1_deserializeDocumentRollingDateConfiguration(&sv.RollingDate, value); err != nil { return err } case "StaticValues": if err := awsRestjson1_deserializeDocumentDateTimeDefaultValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeFormatConfiguration(v **types.DateTimeFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeFormatConfiguration if *v == nil { sv = &types.DateTimeFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeFormat to be of type string, got %T instead", value) } sv.DateTimeFormat = ptr.String(jtv) } case "NullValueFormatConfiguration": if err := awsRestjson1_deserializeDocumentNullValueFormatConfiguration(&sv.NullValueFormatConfiguration, value); err != nil { return err } case "NumericFormatConfiguration": if err := awsRestjson1_deserializeDocumentNumericFormatConfiguration(&sv.NumericFormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeHierarchy(v **types.DateTimeHierarchy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeHierarchy if *v == nil { sv = &types.DateTimeHierarchy{} } else { sv = *v } for key, value := range shape { switch key { case "DrillDownFilters": if err := awsRestjson1_deserializeDocumentDrillDownFilterList(&sv.DrillDownFilters, value); err != nil { return err } case "HierarchyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HierarchyId to be of type string, got %T instead", value) } sv.HierarchyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeParameter(v **types.DateTimeParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeParameter if *v == nil { sv = &types.DateTimeParameter{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Values": if err := awsRestjson1_deserializeDocumentSensitiveTimestampList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeParameterDeclaration(v **types.DateTimeParameterDeclaration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeParameterDeclaration if *v == nil { sv = &types.DateTimeParameterDeclaration{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentDateTimeDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "MappedDataSetParameters": if err := awsRestjson1_deserializeDocumentMappedDataSetParameters(&sv.MappedDataSetParameters, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } case "ValueWhenUnset": if err := awsRestjson1_deserializeDocumentDateTimeValueWhenUnsetConfiguration(&sv.ValueWhenUnset, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeParameterList(v *[]types.DateTimeParameter, 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.DateTimeParameter if *v == nil { cv = []types.DateTimeParameter{} } else { cv = *v } for _, value := range shape { var col types.DateTimeParameter destAddr := &col if err := awsRestjson1_deserializeDocumentDateTimeParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDateTimePickerControlDisplayOptions(v **types.DateTimePickerControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimePickerControlDisplayOptions if *v == nil { sv = &types.DateTimePickerControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeFormat to be of type string, got %T instead", value) } sv.DateTimeFormat = ptr.String(jtv) } case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDateTimeValueWhenUnsetConfiguration(v **types.DateTimeValueWhenUnsetConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DateTimeValueWhenUnsetConfiguration if *v == nil { sv = &types.DateTimeValueWhenUnsetConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CustomValue = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected SensitiveTimestamp to be a JSON Number, got %T instead", value) } } case "ValueWhenUnsetOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValueWhenUnsetOption to be of type string, got %T instead", value) } sv.ValueWhenUnsetOption = types.ValueWhenUnsetOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalDatasetParameter(v **types.DecimalDatasetParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalDatasetParameter if *v == nil { sv = &types.DecimalDatasetParameter{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentDecimalDatasetParameterDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterValueType to be of type string, got %T instead", value) } sv.ValueType = types.DatasetParameterValueType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalDatasetParameterDefaultValues(v **types.DecimalDatasetParameterDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalDatasetParameterDefaultValues if *v == nil { sv = &types.DecimalDatasetParameterDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "StaticValues": if err := awsRestjson1_deserializeDocumentDecimalDatasetParameterValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalDatasetParameterValueList(v *[]float64, 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 []float64 if *v == nil { cv = []float64{} } else { cv = *v } for _, value := range shape { var col float64 if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } col = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } col = f64 default: return fmt.Errorf("expected DecimalDatasetParameterDefaultValue to be a JSON Number, got %T instead", value) } } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDecimalDefaultValueList(v *[]float64, 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 []float64 if *v == nil { cv = []float64{} } else { cv = *v } for _, value := range shape { var col float64 if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } col = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } col = f64 default: return fmt.Errorf("expected SensitiveDoubleObject to be a JSON Number, got %T instead", value) } } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDecimalDefaultValues(v **types.DecimalDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalDefaultValues if *v == nil { sv = &types.DecimalDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "DynamicValue": if err := awsRestjson1_deserializeDocumentDynamicDefaultValue(&sv.DynamicValue, value); err != nil { return err } case "StaticValues": if err := awsRestjson1_deserializeDocumentDecimalDefaultValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalParameter(v **types.DecimalParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalParameter if *v == nil { sv = &types.DecimalParameter{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Values": if err := awsRestjson1_deserializeDocumentSensitiveDoubleList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalParameterDeclaration(v **types.DecimalParameterDeclaration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalParameterDeclaration if *v == nil { sv = &types.DecimalParameterDeclaration{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentDecimalDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "MappedDataSetParameters": if err := awsRestjson1_deserializeDocumentMappedDataSetParameters(&sv.MappedDataSetParameters, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ParameterValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterValueType to be of type string, got %T instead", value) } sv.ParameterValueType = types.ParameterValueType(jtv) } case "ValueWhenUnset": if err := awsRestjson1_deserializeDocumentDecimalValueWhenUnsetConfiguration(&sv.ValueWhenUnset, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalParameterList(v *[]types.DecimalParameter, 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.DecimalParameter if *v == nil { cv = []types.DecimalParameter{} } else { cv = *v } for _, value := range shape { var col types.DecimalParameter destAddr := &col if err := awsRestjson1_deserializeDocumentDecimalParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDecimalPlacesConfiguration(v **types.DecimalPlacesConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalPlacesConfiguration if *v == nil { sv = &types.DecimalPlacesConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DecimalPlaces": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected DecimalPlaces to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DecimalPlaces = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDecimalValueWhenUnsetConfiguration(v **types.DecimalValueWhenUnsetConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DecimalValueWhenUnsetConfiguration if *v == nil { sv = &types.DecimalValueWhenUnsetConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CustomValue = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.CustomValue = ptr.Float64(f64) default: return fmt.Errorf("expected SensitiveDouble to be a JSON Number, got %T instead", value) } } case "ValueWhenUnsetOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValueWhenUnsetOption to be of type string, got %T instead", value) } sv.ValueWhenUnsetOption = types.ValueWhenUnsetOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultFormatting(v **types.DefaultFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultFormatting if *v == nil { sv = &types.DefaultFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DisplayFormat to be of type string, got %T instead", value) } sv.DisplayFormat = types.DisplayFormat(jtv) } case "DisplayFormatOptions": if err := awsRestjson1_deserializeDocumentDisplayFormatOptions(&sv.DisplayFormatOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultFreeFormLayoutConfiguration(v **types.DefaultFreeFormLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultFreeFormLayoutConfiguration if *v == nil { sv = &types.DefaultFreeFormLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CanvasSizeOptions": if err := awsRestjson1_deserializeDocumentFreeFormLayoutCanvasSizeOptions(&sv.CanvasSizeOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultGridLayoutConfiguration(v **types.DefaultGridLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultGridLayoutConfiguration if *v == nil { sv = &types.DefaultGridLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CanvasSizeOptions": if err := awsRestjson1_deserializeDocumentGridLayoutCanvasSizeOptions(&sv.CanvasSizeOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultInteractiveLayoutConfiguration(v **types.DefaultInteractiveLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultInteractiveLayoutConfiguration if *v == nil { sv = &types.DefaultInteractiveLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FreeForm": if err := awsRestjson1_deserializeDocumentDefaultFreeFormLayoutConfiguration(&sv.FreeForm, value); err != nil { return err } case "Grid": if err := awsRestjson1_deserializeDocumentDefaultGridLayoutConfiguration(&sv.Grid, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultNewSheetConfiguration(v **types.DefaultNewSheetConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultNewSheetConfiguration if *v == nil { sv = &types.DefaultNewSheetConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "InteractiveLayoutConfiguration": if err := awsRestjson1_deserializeDocumentDefaultInteractiveLayoutConfiguration(&sv.InteractiveLayoutConfiguration, value); err != nil { return err } case "PaginatedLayoutConfiguration": if err := awsRestjson1_deserializeDocumentDefaultPaginatedLayoutConfiguration(&sv.PaginatedLayoutConfiguration, value); err != nil { return err } case "SheetContentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetContentType to be of type string, got %T instead", value) } sv.SheetContentType = types.SheetContentType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultPaginatedLayoutConfiguration(v **types.DefaultPaginatedLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultPaginatedLayoutConfiguration if *v == nil { sv = &types.DefaultPaginatedLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SectionBased": if err := awsRestjson1_deserializeDocumentDefaultSectionBasedLayoutConfiguration(&sv.SectionBased, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDefaultSectionBasedLayoutConfiguration(v **types.DefaultSectionBasedLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DefaultSectionBasedLayoutConfiguration if *v == nil { sv = &types.DefaultSectionBasedLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CanvasSizeOptions": if err := awsRestjson1_deserializeDocumentSectionBasedLayoutCanvasSizeOptions(&sv.CanvasSizeOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDestinationParameterValueConfiguration(v **types.DestinationParameterValueConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DestinationParameterValueConfiguration if *v == nil { sv = &types.DestinationParameterValueConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomValuesConfiguration": if err := awsRestjson1_deserializeDocumentCustomValuesConfiguration(&sv.CustomValuesConfiguration, value); err != nil { return err } case "SelectAllValueOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SelectAllValueOptions to be of type string, got %T instead", value) } sv.SelectAllValueOptions = types.SelectAllValueOptions(jtv) } case "SourceColumn": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.SourceColumn, value); err != nil { return err } case "SourceField": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.SourceField = ptr.String(jtv) } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDimensionField(v **types.DimensionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DimensionField if *v == nil { sv = &types.DimensionField{} } else { sv = *v } for key, value := range shape { switch key { case "CategoricalDimensionField": if err := awsRestjson1_deserializeDocumentCategoricalDimensionField(&sv.CategoricalDimensionField, value); err != nil { return err } case "DateDimensionField": if err := awsRestjson1_deserializeDocumentDateDimensionField(&sv.DateDimensionField, value); err != nil { return err } case "NumericalDimensionField": if err := awsRestjson1_deserializeDocumentNumericalDimensionField(&sv.NumericalDimensionField, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDisplayFormatOptions(v **types.DisplayFormatOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DisplayFormatOptions if *v == nil { sv = &types.DisplayFormatOptions{} } else { sv = *v } for key, value := range shape { switch key { case "BlankCellFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.BlankCellFormat = ptr.String(jtv) } case "CurrencySymbol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.CurrencySymbol = ptr.String(jtv) } case "DateFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.DateFormat = ptr.String(jtv) } case "DecimalSeparator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicNumericSeparatorSymbol to be of type string, got %T instead", value) } sv.DecimalSeparator = types.TopicNumericSeparatorSymbol(jtv) } case "FractionDigits": 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.FractionDigits = int32(i64) } case "GroupingSeparator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.GroupingSeparator = ptr.String(jtv) } case "NegativeFormat": if err := awsRestjson1_deserializeDocumentNegativeFormat(&sv.NegativeFormat, value); err != nil { return err } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "Suffix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Suffix = ptr.String(jtv) } case "UnitScaler": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberScale to be of type string, got %T instead", value) } sv.UnitScaler = types.NumberScale(jtv) } case "UseBlankCellFormat": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseBlankCellFormat = jtv } case "UseGrouping": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UseGrouping = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDnsResolverList(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 IPv4Address to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDomainNotWhitelistedException(v **types.DomainNotWhitelistedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DomainNotWhitelistedException if *v == nil { sv = &types.DomainNotWhitelistedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDonutCenterOptions(v **types.DonutCenterOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DonutCenterOptions if *v == nil { sv = &types.DonutCenterOptions{} } else { sv = *v } for key, value := range shape { switch key { case "LabelVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.LabelVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDonutOptions(v **types.DonutOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DonutOptions if *v == nil { sv = &types.DonutOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ArcOptions": if err := awsRestjson1_deserializeDocumentArcOptions(&sv.ArcOptions, value); err != nil { return err } case "DonutCenterOptions": if err := awsRestjson1_deserializeDocumentDonutCenterOptions(&sv.DonutCenterOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDrillDownFilter(v **types.DrillDownFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DrillDownFilter if *v == nil { sv = &types.DrillDownFilter{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryFilter": if err := awsRestjson1_deserializeDocumentCategoryDrillDownFilter(&sv.CategoryFilter, value); err != nil { return err } case "NumericEqualityFilter": if err := awsRestjson1_deserializeDocumentNumericEqualityDrillDownFilter(&sv.NumericEqualityFilter, value); err != nil { return err } case "TimeRangeFilter": if err := awsRestjson1_deserializeDocumentTimeRangeDrillDownFilter(&sv.TimeRangeFilter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDrillDownFilterList(v *[]types.DrillDownFilter, 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.DrillDownFilter if *v == nil { cv = []types.DrillDownFilter{} } else { cv = *v } for _, value := range shape { var col types.DrillDownFilter destAddr := &col if err := awsRestjson1_deserializeDocumentDrillDownFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDropDownControlDisplayOptions(v **types.DropDownControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DropDownControlDisplayOptions if *v == nil { sv = &types.DropDownControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "SelectAllOptions": if err := awsRestjson1_deserializeDocumentListControlSelectAllOptions(&sv.SelectAllOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDynamicDefaultValue(v **types.DynamicDefaultValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DynamicDefaultValue if *v == nil { sv = &types.DynamicDefaultValue{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValueColumn": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.DefaultValueColumn, value); err != nil { return err } case "GroupNameColumn": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.GroupNameColumn, value); err != nil { return err } case "UserNameColumn": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.UserNameColumn, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEmptyVisual(v **types.EmptyVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.EmptyVisual if *v == nil { sv = &types.EmptyVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEntity(v **types.Entity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Entity if *v == nil { sv = &types.Entity{} } else { sv = *v } for key, value := range shape { switch key { case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Path = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEntityList(v *[]types.Entity, 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.Entity if *v == nil { cv = []types.Entity{} } else { cv = *v } for _, value := range shape { var col types.Entity destAddr := &col if err := awsRestjson1_deserializeDocumentEntity(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentErrorInfo(v **types.ErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ErrorInfo if *v == nil { sv = &types.ErrorInfo{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionErrorType to be of type string, got %T instead", value) } sv.Type = types.IngestionErrorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExasolParameters(v **types.ExasolParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExasolParameters if *v == nil { sv = &types.ExasolParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExcludePeriodConfiguration(v **types.ExcludePeriodConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExcludePeriodConfiguration if *v == nil { sv = &types.ExcludePeriodConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Amount": 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.Amount = ptr.Int32(int32(i64)) } case "Granularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.Granularity = types.TimeGranularity(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WidgetStatus to be of type string, got %T instead", value) } sv.Status = types.WidgetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExplicitHierarchy(v **types.ExplicitHierarchy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExplicitHierarchy if *v == nil { sv = &types.ExplicitHierarchy{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentExplicitHierarchyColumnList(&sv.Columns, value); err != nil { return err } case "DrillDownFilters": if err := awsRestjson1_deserializeDocumentDrillDownFilterList(&sv.DrillDownFilters, value); err != nil { return err } case "HierarchyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HierarchyId to be of type string, got %T instead", value) } sv.HierarchyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExplicitHierarchyColumnList(v *[]types.ColumnIdentifier, 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.ColumnIdentifier if *v == nil { cv = []types.ColumnIdentifier{} } else { cv = *v } for _, value := range shape { var col types.ColumnIdentifier destAddr := &col if err := awsRestjson1_deserializeDocumentColumnIdentifier(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentExportHiddenFieldsOption(v **types.ExportHiddenFieldsOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportHiddenFieldsOption if *v == nil { sv = &types.ExportHiddenFieldsOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportToCSVOption(v **types.ExportToCSVOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportToCSVOption if *v == nil { sv = &types.ExportToCSVOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExportWithHiddenFieldsOption(v **types.ExportWithHiddenFieldsOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ExportWithHiddenFieldsOption if *v == nil { sv = &types.ExportWithHiddenFieldsOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldBasedTooltip(v **types.FieldBasedTooltip, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldBasedTooltip if *v == nil { sv = &types.FieldBasedTooltip{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.AggregationVisibility = types.Visibility(jtv) } case "TooltipFields": if err := awsRestjson1_deserializeDocumentTooltipItemList(&sv.TooltipFields, value); err != nil { return err } case "TooltipTitleType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TooltipTitleType to be of type string, got %T instead", value) } sv.TooltipTitleType = types.TooltipTitleType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldFolder(v **types.FieldFolder, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldFolder if *v == nil { sv = &types.FieldFolder{} } else { sv = *v } for key, value := range shape { switch key { case "columns": if err := awsRestjson1_deserializeDocumentFolderColumnList(&sv.Columns, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldFolderDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldFolderMap(v *map[string]types.FieldFolder, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]types.FieldFolder if *v == nil { mv = map[string]types.FieldFolder{} } else { mv = *v } for key, value := range shape { var parsedVal types.FieldFolder mapVar := parsedVal destAddr := &mapVar if err := awsRestjson1_deserializeDocumentFieldFolder(&destAddr, value); err != nil { return err } parsedVal = *destAddr mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentFieldLabelType(v **types.FieldLabelType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldLabelType if *v == nil { sv = &types.FieldLabelType{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldOrderList(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 FieldId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFieldSeriesItem(v **types.FieldSeriesItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldSeriesItem if *v == nil { sv = &types.FieldSeriesItem{} } else { sv = *v } for key, value := range shape { switch key { case "AxisBinding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AxisBinding to be of type string, got %T instead", value) } sv.AxisBinding = types.AxisBinding(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "Settings": if err := awsRestjson1_deserializeDocumentLineChartSeriesSettings(&sv.Settings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldSort(v **types.FieldSort, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldSort if *v == nil { sv = &types.FieldSort{} } else { sv = *v } for key, value := range shape { switch key { case "Direction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SortDirection to be of type string, got %T instead", value) } sv.Direction = types.SortDirection(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldSortOptions(v **types.FieldSortOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldSortOptions if *v == nil { sv = &types.FieldSortOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnSort": if err := awsRestjson1_deserializeDocumentColumnSort(&sv.ColumnSort, value); err != nil { return err } case "FieldSort": if err := awsRestjson1_deserializeDocumentFieldSort(&sv.FieldSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFieldSortOptionsList(v *[]types.FieldSortOptions, 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.FieldSortOptions if *v == nil { cv = []types.FieldSortOptions{} } else { cv = *v } for _, value := range shape { var col types.FieldSortOptions destAddr := &col if err := awsRestjson1_deserializeDocumentFieldSortOptions(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFieldTooltipItem(v **types.FieldTooltipItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FieldTooltipItem if *v == nil { sv = &types.FieldTooltipItem{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "Label": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Label = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapAggregatedFieldWells(v **types.FilledMapAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapAggregatedFieldWells if *v == nil { sv = &types.FilledMapAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Geospatial": if err := awsRestjson1_deserializeDocumentFilledMapDimensionFieldList(&sv.Geospatial, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentFilledMapMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapConditionalFormatting(v **types.FilledMapConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapConditionalFormatting if *v == nil { sv = &types.FilledMapConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ConditionalFormattingOptions": if err := awsRestjson1_deserializeDocumentFilledMapConditionalFormattingOptionList(&sv.ConditionalFormattingOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapConditionalFormattingOption(v **types.FilledMapConditionalFormattingOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapConditionalFormattingOption if *v == nil { sv = &types.FilledMapConditionalFormattingOption{} } else { sv = *v } for key, value := range shape { switch key { case "Shape": if err := awsRestjson1_deserializeDocumentFilledMapShapeConditionalFormatting(&sv.Shape, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapConditionalFormattingOptionList(v *[]types.FilledMapConditionalFormattingOption, 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.FilledMapConditionalFormattingOption if *v == nil { cv = []types.FilledMapConditionalFormattingOption{} } else { cv = *v } for _, value := range shape { var col types.FilledMapConditionalFormattingOption destAddr := &col if err := awsRestjson1_deserializeDocumentFilledMapConditionalFormattingOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilledMapConfiguration(v **types.FilledMapConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapConfiguration if *v == nil { sv = &types.FilledMapConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FieldWells": if err := awsRestjson1_deserializeDocumentFilledMapFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "MapStyleOptions": if err := awsRestjson1_deserializeDocumentGeospatialMapStyleOptions(&sv.MapStyleOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentFilledMapSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "WindowOptions": if err := awsRestjson1_deserializeDocumentGeospatialWindowOptions(&sv.WindowOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilledMapFieldWells(v **types.FilledMapFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapFieldWells if *v == nil { sv = &types.FilledMapFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "FilledMapAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentFilledMapAggregatedFieldWells(&sv.FilledMapAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilledMapShapeConditionalFormatting(v **types.FilledMapShapeConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapShapeConditionalFormatting if *v == nil { sv = &types.FilledMapShapeConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "Format": if err := awsRestjson1_deserializeDocumentShapeConditionalFormat(&sv.Format, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapSortConfiguration(v **types.FilledMapSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapSortConfiguration if *v == nil { sv = &types.FilledMapSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilledMapVisual(v **types.FilledMapVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilledMapVisual if *v == nil { sv = &types.FilledMapVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentFilledMapConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "ConditionalFormatting": if err := awsRestjson1_deserializeDocumentFilledMapConditionalFormatting(&sv.ConditionalFormatting, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilter(v **types.Filter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Filter if *v == nil { sv = &types.Filter{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryFilter": if err := awsRestjson1_deserializeDocumentCategoryFilter(&sv.CategoryFilter, value); err != nil { return err } case "NumericEqualityFilter": if err := awsRestjson1_deserializeDocumentNumericEqualityFilter(&sv.NumericEqualityFilter, value); err != nil { return err } case "NumericRangeFilter": if err := awsRestjson1_deserializeDocumentNumericRangeFilter(&sv.NumericRangeFilter, value); err != nil { return err } case "RelativeDatesFilter": if err := awsRestjson1_deserializeDocumentRelativeDatesFilter(&sv.RelativeDatesFilter, value); err != nil { return err } case "TimeEqualityFilter": if err := awsRestjson1_deserializeDocumentTimeEqualityFilter(&sv.TimeEqualityFilter, value); err != nil { return err } case "TimeRangeFilter": if err := awsRestjson1_deserializeDocumentTimeRangeFilter(&sv.TimeRangeFilter, value); err != nil { return err } case "TopBottomFilter": if err := awsRestjson1_deserializeDocumentTopBottomFilter(&sv.TopBottomFilter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterControl(v **types.FilterControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterControl if *v == nil { sv = &types.FilterControl{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimePicker": if err := awsRestjson1_deserializeDocumentFilterDateTimePickerControl(&sv.DateTimePicker, value); err != nil { return err } case "Dropdown": if err := awsRestjson1_deserializeDocumentFilterDropDownControl(&sv.Dropdown, value); err != nil { return err } case "List": if err := awsRestjson1_deserializeDocumentFilterListControl(&sv.List, value); err != nil { return err } case "RelativeDateTime": if err := awsRestjson1_deserializeDocumentFilterRelativeDateTimeControl(&sv.RelativeDateTime, value); err != nil { return err } case "Slider": if err := awsRestjson1_deserializeDocumentFilterSliderControl(&sv.Slider, value); err != nil { return err } case "TextArea": if err := awsRestjson1_deserializeDocumentFilterTextAreaControl(&sv.TextArea, value); err != nil { return err } case "TextField": if err := awsRestjson1_deserializeDocumentFilterTextFieldControl(&sv.TextField, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterControlList(v *[]types.FilterControl, 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.FilterControl if *v == nil { cv = []types.FilterControl{} } else { cv = *v } for _, value := range shape { var col types.FilterControl destAddr := &col if err := awsRestjson1_deserializeDocumentFilterControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilterDateTimePickerControl(v **types.FilterDateTimePickerControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterDateTimePickerControl if *v == nil { sv = &types.FilterDateTimePickerControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentDateTimePickerControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlDateTimePickerType to be of type string, got %T instead", value) } sv.Type = types.SheetControlDateTimePickerType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterDropDownControl(v **types.FilterDropDownControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterDropDownControl if *v == nil { sv = &types.FilterDropDownControl{} } else { sv = *v } for key, value := range shape { switch key { case "CascadingControlConfiguration": if err := awsRestjson1_deserializeDocumentCascadingControlConfiguration(&sv.CascadingControlConfiguration, value); err != nil { return err } case "DisplayOptions": if err := awsRestjson1_deserializeDocumentDropDownControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "SelectableValues": if err := awsRestjson1_deserializeDocumentFilterSelectableValues(&sv.SelectableValues, value); err != nil { return err } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlListType to be of type string, got %T instead", value) } sv.Type = types.SheetControlListType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilteredVisualsList(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 ShortRestrictiveResourceId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilterGroup(v **types.FilterGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterGroup if *v == nil { sv = &types.FilterGroup{} } else { sv = *v } for key, value := range shape { switch key { case "CrossDataset": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CrossDatasetTypes to be of type string, got %T instead", value) } sv.CrossDataset = types.CrossDatasetTypes(jtv) } case "FilterGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterGroupId = ptr.String(jtv) } case "Filters": if err := awsRestjson1_deserializeDocumentFilterList(&sv.Filters, value); err != nil { return err } case "ScopeConfiguration": if err := awsRestjson1_deserializeDocumentFilterScopeConfiguration(&sv.ScopeConfiguration, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WidgetStatus to be of type string, got %T instead", value) } sv.Status = types.WidgetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterGroupList(v *[]types.FilterGroup, 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.FilterGroup if *v == nil { cv = []types.FilterGroup{} } else { cv = *v } for _, value := range shape { var col types.FilterGroup destAddr := &col if err := awsRestjson1_deserializeDocumentFilterGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilterList(v *[]types.Filter, 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.Filter if *v == nil { cv = []types.Filter{} } else { cv = *v } for _, value := range shape { var col types.Filter destAddr := &col if err := awsRestjson1_deserializeDocumentFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFilterListConfiguration(v **types.FilterListConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterListConfiguration if *v == nil { sv = &types.FilterListConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryValues": if err := awsRestjson1_deserializeDocumentCategoryValueList(&sv.CategoryValues, value); err != nil { return err } case "MatchOperator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterMatchOperator to be of type string, got %T instead", value) } sv.MatchOperator = types.CategoryFilterMatchOperator(jtv) } case "SelectAllOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterSelectAllOptions to be of type string, got %T instead", value) } sv.SelectAllOptions = types.CategoryFilterSelectAllOptions(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterListControl(v **types.FilterListControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterListControl if *v == nil { sv = &types.FilterListControl{} } else { sv = *v } for key, value := range shape { switch key { case "CascadingControlConfiguration": if err := awsRestjson1_deserializeDocumentCascadingControlConfiguration(&sv.CascadingControlConfiguration, value); err != nil { return err } case "DisplayOptions": if err := awsRestjson1_deserializeDocumentListControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "SelectableValues": if err := awsRestjson1_deserializeDocumentFilterSelectableValues(&sv.SelectableValues, value); err != nil { return err } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlListType to be of type string, got %T instead", value) } sv.Type = types.SheetControlListType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterOperation(v **types.FilterOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterOperation if *v == nil { sv = &types.FilterOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ConditionExpression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.ConditionExpression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterOperationSelectedFieldsConfiguration(v **types.FilterOperationSelectedFieldsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterOperationSelectedFieldsConfiguration if *v == nil { sv = &types.FilterOperationSelectedFieldsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SelectedColumns": if err := awsRestjson1_deserializeDocumentCustomActionColumnList(&sv.SelectedColumns, value); err != nil { return err } case "SelectedFieldOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SelectedFieldOptions to be of type string, got %T instead", value) } sv.SelectedFieldOptions = types.SelectedFieldOptions(jtv) } case "SelectedFields": if err := awsRestjson1_deserializeDocumentSelectedFieldList(&sv.SelectedFields, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterOperationTargetVisualsConfiguration(v **types.FilterOperationTargetVisualsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterOperationTargetVisualsConfiguration if *v == nil { sv = &types.FilterOperationTargetVisualsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SameSheetTargetVisualConfiguration": if err := awsRestjson1_deserializeDocumentSameSheetTargetVisualConfiguration(&sv.SameSheetTargetVisualConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterRelativeDateTimeControl(v **types.FilterRelativeDateTimeControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterRelativeDateTimeControl if *v == nil { sv = &types.FilterRelativeDateTimeControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentRelativeDateTimeControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterScopeConfiguration(v **types.FilterScopeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterScopeConfiguration if *v == nil { sv = &types.FilterScopeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SelectedSheets": if err := awsRestjson1_deserializeDocumentSelectedSheetsFilterScopeConfiguration(&sv.SelectedSheets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterSelectableValues(v **types.FilterSelectableValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterSelectableValues if *v == nil { sv = &types.FilterSelectableValues{} } else { sv = *v } for key, value := range shape { switch key { case "Values": if err := awsRestjson1_deserializeDocumentParameterSelectableValueList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterSliderControl(v **types.FilterSliderControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterSliderControl if *v == nil { sv = &types.FilterSliderControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentSliderControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "MaximumValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.MaximumValue = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.MaximumValue = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "MinimumValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.MinimumValue = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.MinimumValue = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "StepSize": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StepSize = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.StepSize = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlSliderType to be of type string, got %T instead", value) } sv.Type = types.SheetControlSliderType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterTextAreaControl(v **types.FilterTextAreaControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterTextAreaControl if *v == nil { sv = &types.FilterTextAreaControl{} } else { sv = *v } for key, value := range shape { switch key { case "Delimiter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TextAreaControlDelimiter to be of type string, got %T instead", value) } sv.Delimiter = ptr.String(jtv) } case "DisplayOptions": if err := awsRestjson1_deserializeDocumentTextAreaControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFilterTextFieldControl(v **types.FilterTextFieldControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FilterTextFieldControl if *v == nil { sv = &types.FilterTextFieldControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentTextFieldControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "FilterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterControlId = ptr.String(jtv) } case "SourceFilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SourceFilterId = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFolder(v **types.Folder, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Folder if *v == nil { sv = &types.Folder{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "FolderPath": if err := awsRestjson1_deserializeDocumentPath(&sv.FolderPath, value); err != nil { return err } case "FolderType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FolderType to be of type string, got %T instead", value) } sv.FolderType = types.FolderType(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FolderName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFolderColumnList(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_deserializeDocumentFolderMember(v **types.FolderMember, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FolderMember if *v == nil { sv = &types.FolderMember{} } else { sv = *v } for key, value := range shape { switch key { case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } case "MemberType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MemberType to be of type string, got %T instead", value) } sv.MemberType = types.MemberType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFolderMemberList(v *[]types.MemberIdArnPair, 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.MemberIdArnPair if *v == nil { cv = []types.MemberIdArnPair{} } else { cv = *v } for _, value := range shape { var col types.MemberIdArnPair destAddr := &col if err := awsRestjson1_deserializeDocumentMemberIdArnPair(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFolderSummary(v **types.FolderSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FolderSummary if *v == nil { sv = &types.FolderSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "FolderId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.FolderId = ptr.String(jtv) } case "FolderType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FolderType to be of type string, got %T instead", value) } sv.FolderType = types.FolderType(jtv) } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FolderName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFolderSummaryList(v *[]types.FolderSummary, 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.FolderSummary if *v == nil { cv = []types.FolderSummary{} } else { cv = *v } for _, value := range shape { var col types.FolderSummary destAddr := &col if err := awsRestjson1_deserializeDocumentFolderSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFont(v **types.Font, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Font if *v == nil { sv = &types.Font{} } else { sv = *v } for key, value := range shape { switch key { case "FontFamily": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FontFamily = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFontConfiguration(v **types.FontConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FontConfiguration if *v == nil { sv = &types.FontConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FontColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.FontColor = ptr.String(jtv) } case "FontDecoration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FontDecoration to be of type string, got %T instead", value) } sv.FontDecoration = types.FontDecoration(jtv) } case "FontSize": if err := awsRestjson1_deserializeDocumentFontSize(&sv.FontSize, value); err != nil { return err } case "FontStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FontStyle to be of type string, got %T instead", value) } sv.FontStyle = types.FontStyle(jtv) } case "FontWeight": if err := awsRestjson1_deserializeDocumentFontWeight(&sv.FontWeight, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFontList(v *[]types.Font, 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.Font if *v == nil { cv = []types.Font{} } else { cv = *v } for _, value := range shape { var col types.Font destAddr := &col if err := awsRestjson1_deserializeDocumentFont(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFontSize(v **types.FontSize, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FontSize if *v == nil { sv = &types.FontSize{} } else { sv = *v } for key, value := range shape { switch key { case "Relative": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelativeFontSize to be of type string, got %T instead", value) } sv.Relative = types.RelativeFontSize(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFontWeight(v **types.FontWeight, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FontWeight if *v == nil { sv = &types.FontWeight{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FontWeightName to be of type string, got %T instead", value) } sv.Name = types.FontWeightName(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForecastComputation(v **types.ForecastComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ForecastComputation if *v == nil { sv = &types.ForecastComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = ptr.String(jtv) } case "CustomSeasonalityValue": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ForecastComputationCustomSeasonalityValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CustomSeasonalityValue = ptr.Int32(int32(i64)) } case "LowerBoundary": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LowerBoundary = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.LowerBoundary = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } 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 "PeriodsBackward": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PeriodsBackward to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PeriodsBackward = ptr.Int32(int32(i64)) } case "PeriodsForward": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PeriodsForward to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PeriodsForward = ptr.Int32(int32(i64)) } case "PredictionInterval": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PredictionInterval to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PredictionInterval = ptr.Int32(int32(i64)) } case "Seasonality": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ForecastComputationSeasonality to be of type string, got %T instead", value) } sv.Seasonality = types.ForecastComputationSeasonality(jtv) } case "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } case "UpperBoundary": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpperBoundary = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.UpperBoundary = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForecastConfiguration(v **types.ForecastConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ForecastConfiguration if *v == nil { sv = &types.ForecastConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ForecastProperties": if err := awsRestjson1_deserializeDocumentTimeBasedForecastProperties(&sv.ForecastProperties, value); err != nil { return err } case "Scenario": if err := awsRestjson1_deserializeDocumentForecastScenario(&sv.Scenario, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForecastConfigurationList(v *[]types.ForecastConfiguration, 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.ForecastConfiguration if *v == nil { cv = []types.ForecastConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ForecastConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentForecastConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentForecastScenario(v **types.ForecastScenario, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ForecastScenario if *v == nil { sv = &types.ForecastScenario{} } else { sv = *v } for key, value := range shape { switch key { case "WhatIfPointScenario": if err := awsRestjson1_deserializeDocumentWhatIfPointScenario(&sv.WhatIfPointScenario, value); err != nil { return err } case "WhatIfRangeScenario": if err := awsRestjson1_deserializeDocumentWhatIfRangeScenario(&sv.WhatIfRangeScenario, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFormatConfiguration(v **types.FormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FormatConfiguration if *v == nil { sv = &types.FormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeFormatConfiguration": if err := awsRestjson1_deserializeDocumentDateTimeFormatConfiguration(&sv.DateTimeFormatConfiguration, value); err != nil { return err } case "NumberFormatConfiguration": if err := awsRestjson1_deserializeDocumentNumberFormatConfiguration(&sv.NumberFormatConfiguration, value); err != nil { return err } case "StringFormatConfiguration": if err := awsRestjson1_deserializeDocumentStringFormatConfiguration(&sv.StringFormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormLayoutCanvasSizeOptions(v **types.FreeFormLayoutCanvasSizeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormLayoutCanvasSizeOptions if *v == nil { sv = &types.FreeFormLayoutCanvasSizeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ScreenCanvasSizeOptions": if err := awsRestjson1_deserializeDocumentFreeFormLayoutScreenCanvasSizeOptions(&sv.ScreenCanvasSizeOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormLayoutConfiguration(v **types.FreeFormLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormLayoutConfiguration if *v == nil { sv = &types.FreeFormLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CanvasSizeOptions": if err := awsRestjson1_deserializeDocumentFreeFormLayoutCanvasSizeOptions(&sv.CanvasSizeOptions, value); err != nil { return err } case "Elements": if err := awsRestjson1_deserializeDocumentFreeFromLayoutElementList(&sv.Elements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormLayoutElement(v **types.FreeFormLayoutElement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormLayoutElement if *v == nil { sv = &types.FreeFormLayoutElement{} } else { sv = *v } for key, value := range shape { switch key { case "BackgroundStyle": if err := awsRestjson1_deserializeDocumentFreeFormLayoutElementBackgroundStyle(&sv.BackgroundStyle, value); err != nil { return err } case "BorderStyle": if err := awsRestjson1_deserializeDocumentFreeFormLayoutElementBorderStyle(&sv.BorderStyle, value); err != nil { return err } case "ElementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ElementId = ptr.String(jtv) } case "ElementType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LayoutElementType to be of type string, got %T instead", value) } sv.ElementType = types.LayoutElementType(jtv) } case "Height": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Height = ptr.String(jtv) } case "LoadingAnimation": if err := awsRestjson1_deserializeDocumentLoadingAnimation(&sv.LoadingAnimation, value); err != nil { return err } case "RenderingRules": if err := awsRestjson1_deserializeDocumentSheetElementRenderingRuleList(&sv.RenderingRules, value); err != nil { return err } case "SelectedBorderStyle": if err := awsRestjson1_deserializeDocumentFreeFormLayoutElementBorderStyle(&sv.SelectedBorderStyle, value); err != nil { return err } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } case "Width": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Width = ptr.String(jtv) } case "XAxisLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.XAxisLocation = ptr.String(jtv) } case "YAxisLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UnlimitedPixelLength to be of type string, got %T instead", value) } sv.YAxisLocation = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormLayoutElementBackgroundStyle(v **types.FreeFormLayoutElementBackgroundStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormLayoutElementBackgroundStyle if *v == nil { sv = &types.FreeFormLayoutElementBackgroundStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColorWithTransparency to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormLayoutElementBorderStyle(v **types.FreeFormLayoutElementBorderStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormLayoutElementBorderStyle if *v == nil { sv = &types.FreeFormLayoutElementBorderStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColorWithTransparency to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormLayoutScreenCanvasSizeOptions(v **types.FreeFormLayoutScreenCanvasSizeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormLayoutScreenCanvasSizeOptions if *v == nil { sv = &types.FreeFormLayoutScreenCanvasSizeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "OptimizedViewPortWidth": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.OptimizedViewPortWidth = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFormSectionLayoutConfiguration(v **types.FreeFormSectionLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FreeFormSectionLayoutConfiguration if *v == nil { sv = &types.FreeFormSectionLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Elements": if err := awsRestjson1_deserializeDocumentFreeFromLayoutElementList(&sv.Elements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFreeFromLayoutElementList(v *[]types.FreeFormLayoutElement, 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.FreeFormLayoutElement if *v == nil { cv = []types.FreeFormLayoutElement{} } else { cv = *v } for _, value := range shape { var col types.FreeFormLayoutElement destAddr := &col if err := awsRestjson1_deserializeDocumentFreeFormLayoutElement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFunnelChartAggregatedFieldWells(v **types.FunnelChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FunnelChartAggregatedFieldWells if *v == nil { sv = &types.FunnelChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentFunnelChartDimensionFieldList(&sv.Category, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentFunnelChartMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFunnelChartConfiguration(v **types.FunnelChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FunnelChartConfiguration if *v == nil { sv = &types.FunnelChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "DataLabelOptions": if err := awsRestjson1_deserializeDocumentFunnelChartDataLabelOptions(&sv.DataLabelOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentFunnelChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentFunnelChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "ValueLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ValueLabelOptions, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFunnelChartDataLabelOptions(v **types.FunnelChartDataLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FunnelChartDataLabelOptions if *v == nil { sv = &types.FunnelChartDataLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryLabelVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.CategoryLabelVisibility = types.Visibility(jtv) } case "LabelColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.LabelColor = ptr.String(jtv) } case "LabelFontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.LabelFontConfiguration, value); err != nil { return err } case "MeasureDataLabelStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FunnelChartMeasureDataLabelStyle to be of type string, got %T instead", value) } sv.MeasureDataLabelStyle = types.FunnelChartMeasureDataLabelStyle(jtv) } case "MeasureLabelVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.MeasureLabelVisibility = types.Visibility(jtv) } case "Position": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataLabelPosition to be of type string, got %T instead", value) } sv.Position = types.DataLabelPosition(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFunnelChartDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFunnelChartFieldWells(v **types.FunnelChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FunnelChartFieldWells if *v == nil { sv = &types.FunnelChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "FunnelChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentFunnelChartAggregatedFieldWells(&sv.FunnelChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFunnelChartMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFunnelChartSortConfiguration(v **types.FunnelChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FunnelChartSortConfiguration if *v == nil { sv = &types.FunnelChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFunnelChartVisual(v **types.FunnelChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.FunnelChartVisual if *v == nil { sv = &types.FunnelChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentFunnelChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartArcConditionalFormatting(v **types.GaugeChartArcConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartArcConditionalFormatting if *v == nil { sv = &types.GaugeChartArcConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ForegroundColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.ForegroundColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartConditionalFormatting(v **types.GaugeChartConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartConditionalFormatting if *v == nil { sv = &types.GaugeChartConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ConditionalFormattingOptions": if err := awsRestjson1_deserializeDocumentGaugeChartConditionalFormattingOptionList(&sv.ConditionalFormattingOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartConditionalFormattingOption(v **types.GaugeChartConditionalFormattingOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartConditionalFormattingOption if *v == nil { sv = &types.GaugeChartConditionalFormattingOption{} } else { sv = *v } for key, value := range shape { switch key { case "Arc": if err := awsRestjson1_deserializeDocumentGaugeChartArcConditionalFormatting(&sv.Arc, value); err != nil { return err } case "PrimaryValue": if err := awsRestjson1_deserializeDocumentGaugeChartPrimaryValueConditionalFormatting(&sv.PrimaryValue, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartConditionalFormattingOptionList(v *[]types.GaugeChartConditionalFormattingOption, 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.GaugeChartConditionalFormattingOption if *v == nil { cv = []types.GaugeChartConditionalFormattingOption{} } else { cv = *v } for _, value := range shape { var col types.GaugeChartConditionalFormattingOption destAddr := &col if err := awsRestjson1_deserializeDocumentGaugeChartConditionalFormattingOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGaugeChartConfiguration(v **types.GaugeChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartConfiguration if *v == nil { sv = &types.GaugeChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentGaugeChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "GaugeChartOptions": if err := awsRestjson1_deserializeDocumentGaugeChartOptions(&sv.GaugeChartOptions, value); err != nil { return err } case "TooltipOptions": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.TooltipOptions, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartFieldWells(v **types.GaugeChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartFieldWells if *v == nil { sv = &types.GaugeChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "TargetValues": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.TargetValues, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartOptions(v **types.GaugeChartOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartOptions if *v == nil { sv = &types.GaugeChartOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Arc": if err := awsRestjson1_deserializeDocumentArcConfiguration(&sv.Arc, value); err != nil { return err } case "ArcAxis": if err := awsRestjson1_deserializeDocumentArcAxisConfiguration(&sv.ArcAxis, value); err != nil { return err } case "Comparison": if err := awsRestjson1_deserializeDocumentComparisonConfiguration(&sv.Comparison, value); err != nil { return err } case "PrimaryValueDisplayType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PrimaryValueDisplayType to be of type string, got %T instead", value) } sv.PrimaryValueDisplayType = types.PrimaryValueDisplayType(jtv) } case "PrimaryValueFontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.PrimaryValueFontConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartPrimaryValueConditionalFormatting(v **types.GaugeChartPrimaryValueConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartPrimaryValueConditionalFormatting if *v == nil { sv = &types.GaugeChartPrimaryValueConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "Icon": if err := awsRestjson1_deserializeDocumentConditionalFormattingIcon(&sv.Icon, value); err != nil { return err } case "TextColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.TextColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGaugeChartVisual(v **types.GaugeChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GaugeChartVisual if *v == nil { sv = &types.GaugeChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentGaugeChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ConditionalFormatting": if err := awsRestjson1_deserializeDocumentGaugeChartConditionalFormatting(&sv.ConditionalFormatting, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeoSpatialColumnGroup(v **types.GeoSpatialColumnGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeoSpatialColumnGroup if *v == nil { sv = &types.GeoSpatialColumnGroup{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentColumnList(&sv.Columns, value); err != nil { return err } case "CountryCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GeoSpatialCountryCode to be of type string, got %T instead", value) } sv.CountryCode = types.GeoSpatialCountryCode(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnGroupName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialCoordinateBounds(v **types.GeospatialCoordinateBounds, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialCoordinateBounds if *v == nil { sv = &types.GeospatialCoordinateBounds{} } else { sv = *v } for key, value := range shape { switch key { case "East": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.East = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.East = ptr.Float64(f64) default: return fmt.Errorf("expected Longitude to be a JSON Number, got %T instead", value) } } case "North": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.North = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.North = ptr.Float64(f64) default: return fmt.Errorf("expected Latitude to be a JSON Number, got %T instead", value) } } case "South": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.South = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.South = ptr.Float64(f64) default: return fmt.Errorf("expected Latitude to be a JSON Number, got %T instead", value) } } case "West": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.West = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.West = ptr.Float64(f64) default: return fmt.Errorf("expected Longitude to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialHeatmapColorScale(v **types.GeospatialHeatmapColorScale, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialHeatmapColorScale if *v == nil { sv = &types.GeospatialHeatmapColorScale{} } else { sv = *v } for key, value := range shape { switch key { case "Colors": if err := awsRestjson1_deserializeDocumentGeospatialHeatmapDataColorList(&sv.Colors, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialHeatmapConfiguration(v **types.GeospatialHeatmapConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialHeatmapConfiguration if *v == nil { sv = &types.GeospatialHeatmapConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "HeatmapColor": if err := awsRestjson1_deserializeDocumentGeospatialHeatmapColorScale(&sv.HeatmapColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialHeatmapDataColor(v **types.GeospatialHeatmapDataColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialHeatmapDataColor if *v == nil { sv = &types.GeospatialHeatmapDataColor{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialHeatmapDataColorList(v *[]types.GeospatialHeatmapDataColor, 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.GeospatialHeatmapDataColor if *v == nil { cv = []types.GeospatialHeatmapDataColor{} } else { cv = *v } for _, value := range shape { var col types.GeospatialHeatmapDataColor destAddr := &col if err := awsRestjson1_deserializeDocumentGeospatialHeatmapDataColor(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGeospatialMapAggregatedFieldWells(v **types.GeospatialMapAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialMapAggregatedFieldWells if *v == nil { sv = &types.GeospatialMapAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Colors": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Colors, value); err != nil { return err } case "Geospatial": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Geospatial, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialMapConfiguration(v **types.GeospatialMapConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialMapConfiguration if *v == nil { sv = &types.GeospatialMapConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FieldWells": if err := awsRestjson1_deserializeDocumentGeospatialMapFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "MapStyleOptions": if err := awsRestjson1_deserializeDocumentGeospatialMapStyleOptions(&sv.MapStyleOptions, value); err != nil { return err } case "PointStyleOptions": if err := awsRestjson1_deserializeDocumentGeospatialPointStyleOptions(&sv.PointStyleOptions, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } case "WindowOptions": if err := awsRestjson1_deserializeDocumentGeospatialWindowOptions(&sv.WindowOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialMapFieldWells(v **types.GeospatialMapFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialMapFieldWells if *v == nil { sv = &types.GeospatialMapFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "GeospatialMapAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentGeospatialMapAggregatedFieldWells(&sv.GeospatialMapAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialMapStyleOptions(v **types.GeospatialMapStyleOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialMapStyleOptions if *v == nil { sv = &types.GeospatialMapStyleOptions{} } else { sv = *v } for key, value := range shape { switch key { case "BaseMapStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BaseMapStyleType to be of type string, got %T instead", value) } sv.BaseMapStyle = types.BaseMapStyleType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialMapVisual(v **types.GeospatialMapVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialMapVisual if *v == nil { sv = &types.GeospatialMapVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentGeospatialMapConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialPointStyleOptions(v **types.GeospatialPointStyleOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialPointStyleOptions if *v == nil { sv = &types.GeospatialPointStyleOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterMarkerConfiguration": if err := awsRestjson1_deserializeDocumentClusterMarkerConfiguration(&sv.ClusterMarkerConfiguration, value); err != nil { return err } case "HeatmapConfiguration": if err := awsRestjson1_deserializeDocumentGeospatialHeatmapConfiguration(&sv.HeatmapConfiguration, value); err != nil { return err } case "SelectedPointStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GeospatialSelectedPointStyle to be of type string, got %T instead", value) } sv.SelectedPointStyle = types.GeospatialSelectedPointStyle(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGeospatialWindowOptions(v **types.GeospatialWindowOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GeospatialWindowOptions if *v == nil { sv = &types.GeospatialWindowOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Bounds": if err := awsRestjson1_deserializeDocumentGeospatialCoordinateBounds(&sv.Bounds, value); err != nil { return err } case "MapZoomMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MapZoomMode to be of type string, got %T instead", value) } sv.MapZoomMode = types.MapZoomMode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGlobalTableBorderOptions(v **types.GlobalTableBorderOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GlobalTableBorderOptions if *v == nil { sv = &types.GlobalTableBorderOptions{} } else { sv = *v } for key, value := range shape { switch key { case "SideSpecificBorder": if err := awsRestjson1_deserializeDocumentTableSideBorderOptions(&sv.SideSpecificBorder, value); err != nil { return err } case "UniformBorder": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.UniformBorder, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGradientColor(v **types.GradientColor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GradientColor if *v == nil { sv = &types.GradientColor{} } else { sv = *v } for key, value := range shape { switch key { case "Stops": if err := awsRestjson1_deserializeDocumentGradientStopList(&sv.Stops, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGradientStop(v **types.GradientStop, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GradientStop if *v == nil { sv = &types.GradientStop{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "DataValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.DataValue = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.DataValue = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "GradientOffset": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.GradientOffset = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.GradientOffset = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGradientStopList(v *[]types.GradientStop, 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.GradientStop if *v == nil { cv = []types.GradientStop{} } else { cv = *v } for _, value := range shape { var col types.GradientStop destAddr := &col if err := awsRestjson1_deserializeDocumentGradientStop(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGridLayoutCanvasSizeOptions(v **types.GridLayoutCanvasSizeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GridLayoutCanvasSizeOptions if *v == nil { sv = &types.GridLayoutCanvasSizeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ScreenCanvasSizeOptions": if err := awsRestjson1_deserializeDocumentGridLayoutScreenCanvasSizeOptions(&sv.ScreenCanvasSizeOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGridLayoutConfiguration(v **types.GridLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GridLayoutConfiguration if *v == nil { sv = &types.GridLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CanvasSizeOptions": if err := awsRestjson1_deserializeDocumentGridLayoutCanvasSizeOptions(&sv.CanvasSizeOptions, value); err != nil { return err } case "Elements": if err := awsRestjson1_deserializeDocumentGridLayoutElementList(&sv.Elements, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGridLayoutElement(v **types.GridLayoutElement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GridLayoutElement if *v == nil { sv = &types.GridLayoutElement{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GridLayoutElementColumnIndex to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ColumnIndex = ptr.Int32(int32(i64)) } case "ColumnSpan": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GridLayoutElementColumnSpan to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ColumnSpan = ptr.Int32(int32(i64)) } case "ElementId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ElementId = ptr.String(jtv) } case "ElementType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LayoutElementType to be of type string, got %T instead", value) } sv.ElementType = types.LayoutElementType(jtv) } case "RowIndex": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GridLayoutElementRowIndex to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowIndex = ptr.Int32(int32(i64)) } case "RowSpan": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GridLayoutElementRowSpan to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowSpan = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGridLayoutElementList(v *[]types.GridLayoutElement, 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.GridLayoutElement if *v == nil { cv = []types.GridLayoutElement{} } else { cv = *v } for _, value := range shape { var col types.GridLayoutElement destAddr := &col if err := awsRestjson1_deserializeDocumentGridLayoutElement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGridLayoutScreenCanvasSizeOptions(v **types.GridLayoutScreenCanvasSizeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GridLayoutScreenCanvasSizeOptions if *v == nil { sv = &types.GridLayoutScreenCanvasSizeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "OptimizedViewPortWidth": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.OptimizedViewPortWidth = ptr.String(jtv) } case "ResizeOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResizeOption to be of type string, got %T instead", value) } sv.ResizeOption = types.ResizeOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGroup(v **types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Group if *v == nil { sv = &types.Group{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GroupDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "GroupName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) } sv.GroupName = ptr.String(jtv) } case "PrincipalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PrincipalId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGroupList(v *[]types.Group, 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.Group if *v == nil { cv = []types.Group{} } else { cv = *v } for _, value := range shape { var col types.Group destAddr := &col if err := awsRestjson1_deserializeDocumentGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGroupMember(v **types.GroupMember, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GroupMember if *v == nil { sv = &types.GroupMember{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "MemberName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GroupMemberName to be of type string, got %T instead", value) } sv.MemberName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGroupMemberList(v *[]types.GroupMember, 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.GroupMember if *v == nil { cv = []types.GroupMember{} } else { cv = *v } for _, value := range shape { var col types.GroupMember destAddr := &col if err := awsRestjson1_deserializeDocumentGroupMember(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentGrowthRateComputation(v **types.GrowthRateComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GrowthRateComputation if *v == nil { sv = &types.GrowthRateComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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 "PeriodSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected GrowthRatePeriodSize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PeriodSize = int32(i64) } case "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGutterStyle(v **types.GutterStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.GutterStyle if *v == nil { sv = &types.GutterStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Show": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Show = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHeaderFooterSectionConfiguration(v **types.HeaderFooterSectionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HeaderFooterSectionConfiguration if *v == nil { sv = &types.HeaderFooterSectionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Layout": if err := awsRestjson1_deserializeDocumentSectionLayoutConfiguration(&sv.Layout, value); err != nil { return err } case "SectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SectionId = ptr.String(jtv) } case "Style": if err := awsRestjson1_deserializeDocumentSectionStyle(&sv.Style, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHeaderFooterSectionConfigurationList(v *[]types.HeaderFooterSectionConfiguration, 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.HeaderFooterSectionConfiguration if *v == nil { cv = []types.HeaderFooterSectionConfiguration{} } else { cv = *v } for _, value := range shape { var col types.HeaderFooterSectionConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentHeaderFooterSectionConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentHeatMapAggregatedFieldWells(v **types.HeatMapAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HeatMapAggregatedFieldWells if *v == nil { sv = &types.HeatMapAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentHeatMapDimensionFieldList(&sv.Columns, value); err != nil { return err } case "Rows": if err := awsRestjson1_deserializeDocumentHeatMapDimensionFieldList(&sv.Rows, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentHeatMapMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHeatMapConfiguration(v **types.HeatMapConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HeatMapConfiguration if *v == nil { sv = &types.HeatMapConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ColorScale": if err := awsRestjson1_deserializeDocumentColorScale(&sv.ColorScale, value); err != nil { return err } case "ColumnLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ColumnLabelOptions, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentHeatMapFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "RowLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.RowLabelOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentHeatMapSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHeatMapDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentHeatMapFieldWells(v **types.HeatMapFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HeatMapFieldWells if *v == nil { sv = &types.HeatMapFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "HeatMapAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentHeatMapAggregatedFieldWells(&sv.HeatMapAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHeatMapMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentHeatMapSortConfiguration(v **types.HeatMapSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HeatMapSortConfiguration if *v == nil { sv = &types.HeatMapSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "HeatMapColumnItemsLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.HeatMapColumnItemsLimitConfiguration, value); err != nil { return err } case "HeatMapColumnSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.HeatMapColumnSort, value); err != nil { return err } case "HeatMapRowItemsLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.HeatMapRowItemsLimitConfiguration, value); err != nil { return err } case "HeatMapRowSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.HeatMapRowSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHeatMapVisual(v **types.HeatMapVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HeatMapVisual if *v == nil { sv = &types.HeatMapVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentHeatMapConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHistogramAggregatedFieldWells(v **types.HistogramAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HistogramAggregatedFieldWells if *v == nil { sv = &types.HistogramAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Values": if err := awsRestjson1_deserializeDocumentHistogramMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHistogramBinOptions(v **types.HistogramBinOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HistogramBinOptions if *v == nil { sv = &types.HistogramBinOptions{} } else { sv = *v } for key, value := range shape { switch key { case "BinCount": if err := awsRestjson1_deserializeDocumentBinCountOptions(&sv.BinCount, value); err != nil { return err } case "BinWidth": if err := awsRestjson1_deserializeDocumentBinWidthOptions(&sv.BinWidth, value); err != nil { return err } case "SelectedBinType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HistogramBinType to be of type string, got %T instead", value) } sv.SelectedBinType = types.HistogramBinType(jtv) } case "StartValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartValue = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.StartValue = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHistogramConfiguration(v **types.HistogramConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HistogramConfiguration if *v == nil { sv = &types.HistogramConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BinOptions": if err := awsRestjson1_deserializeDocumentHistogramBinOptions(&sv.BinOptions, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentHistogramFieldWells(&sv.FieldWells, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } case "XAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.XAxisDisplayOptions, value); err != nil { return err } case "XAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.XAxisLabelOptions, value); err != nil { return err } case "YAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.YAxisDisplayOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHistogramFieldWells(v **types.HistogramFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HistogramFieldWells if *v == nil { sv = &types.HistogramFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "HistogramAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentHistogramAggregatedFieldWells(&sv.HistogramAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHistogramMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentHistogramVisual(v **types.HistogramVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.HistogramVisual if *v == nil { sv = &types.HistogramVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentHistogramConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIAMPolicyAssignment(v **types.IAMPolicyAssignment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IAMPolicyAssignment if *v == nil { sv = &types.IAMPolicyAssignment{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AssignmentId = ptr.String(jtv) } case "AssignmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) } sv.AssignmentName = ptr.String(jtv) } case "AssignmentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) } sv.AssignmentStatus = types.AssignmentStatus(jtv) } case "AwsAccountId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) } sv.AwsAccountId = ptr.String(jtv) } case "Identities": if err := awsRestjson1_deserializeDocumentIdentityMap(&sv.Identities, value); err != nil { return err } case "PolicyArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.PolicyArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummary(v **types.IAMPolicyAssignmentSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IAMPolicyAssignmentSummary if *v == nil { sv = &types.IAMPolicyAssignmentSummary{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IAMPolicyAssignmentName to be of type string, got %T instead", value) } sv.AssignmentName = ptr.String(jtv) } case "AssignmentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) } sv.AssignmentStatus = types.AssignmentStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummaryList(v *[]types.IAMPolicyAssignmentSummary, 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.IAMPolicyAssignmentSummary if *v == nil { cv = []types.IAMPolicyAssignmentSummary{} } else { cv = *v } for _, value := range shape { var col types.IAMPolicyAssignmentSummary destAddr := &col if err := awsRestjson1_deserializeDocumentIAMPolicyAssignmentSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIdentityMap(v *map[string][]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string][]string if *v == nil { mv = map[string][]string{} } else { mv = *v } for key, value := range shape { var parsedVal []string mapVar := parsedVal if err := awsRestjson1_deserializeDocumentIdentityNameList(&mapVar, value); err != nil { return err } parsedVal = mapVar mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentIdentityNameList(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 IdentityName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIdentityTypeNotSupportedException(v **types.IdentityTypeNotSupportedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IdentityTypeNotSupportedException if *v == nil { sv = &types.IdentityTypeNotSupportedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIncrementalRefresh(v **types.IncrementalRefresh, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IncrementalRefresh if *v == nil { sv = &types.IncrementalRefresh{} } else { sv = *v } for key, value := range shape { switch key { case "LookbackWindow": if err := awsRestjson1_deserializeDocumentLookbackWindow(&sv.LookbackWindow, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIngestion(v **types.Ingestion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Ingestion if *v == nil { sv = &types.Ingestion{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ErrorInfo": if err := awsRestjson1_deserializeDocumentErrorInfo(&sv.ErrorInfo, value); err != nil { return err } case "IngestionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionId to be of type string, got %T instead", value) } sv.IngestionId = ptr.String(jtv) } case "IngestionSizeInBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IngestionSizeInBytes = ptr.Int64(i64) } case "IngestionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionStatus to be of type string, got %T instead", value) } sv.IngestionStatus = types.IngestionStatus(jtv) } case "IngestionTimeInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.IngestionTimeInSeconds = ptr.Int64(i64) } case "QueueInfo": if err := awsRestjson1_deserializeDocumentQueueInfo(&sv.QueueInfo, value); err != nil { return err } case "RequestSource": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionRequestSource to be of type string, got %T instead", value) } sv.RequestSource = types.IngestionRequestSource(jtv) } case "RequestType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionRequestType to be of type string, got %T instead", value) } sv.RequestType = types.IngestionRequestType(jtv) } case "RowInfo": if err := awsRestjson1_deserializeDocumentRowInfo(&sv.RowInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIngestions(v *[]types.Ingestion, 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.Ingestion if *v == nil { cv = []types.Ingestion{} } else { cv = *v } for _, value := range shape { var col types.Ingestion destAddr := &col if err := awsRestjson1_deserializeDocumentIngestion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInputColumn(v **types.InputColumn, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InputColumn if *v == nil { sv = &types.InputColumn{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InputColumnDataType to be of type string, got %T instead", value) } sv.Type = types.InputColumnDataType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInputColumnList(v *[]types.InputColumn, 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.InputColumn if *v == nil { cv = []types.InputColumn{} } else { cv = *v } for _, value := range shape { var col types.InputColumn destAddr := &col if err := awsRestjson1_deserializeDocumentInputColumn(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInsightConfiguration(v **types.InsightConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InsightConfiguration if *v == nil { sv = &types.InsightConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Computations": if err := awsRestjson1_deserializeDocumentComputationList(&sv.Computations, value); err != nil { return err } case "CustomNarrative": if err := awsRestjson1_deserializeDocumentCustomNarrativeOptions(&sv.CustomNarrative, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInsightVisual(v **types.InsightVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InsightVisual if *v == nil { sv = &types.InsightVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } case "InsightConfiguration": if err := awsRestjson1_deserializeDocumentInsightConfiguration(&sv.InsightConfiguration, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIntegerDatasetParameter(v **types.IntegerDatasetParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IntegerDatasetParameter if *v == nil { sv = &types.IntegerDatasetParameter{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentIntegerDatasetParameterDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterValueType to be of type string, got %T instead", value) } sv.ValueType = types.DatasetParameterValueType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIntegerDatasetParameterDefaultValues(v **types.IntegerDatasetParameterDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IntegerDatasetParameterDefaultValues if *v == nil { sv = &types.IntegerDatasetParameterDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "StaticValues": if err := awsRestjson1_deserializeDocumentIntegerDatasetParameterValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIntegerDatasetParameterValueList(v *[]int64, 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 []int64 if *v == nil { cv = []int64{} } else { cv = *v } for _, value := range shape { var col int64 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerDatasetParameterDefaultValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = i64 } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIntegerDefaultValueList(v *[]int64, 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 []int64 if *v == nil { cv = []int64{} } else { cv = *v } for _, value := range shape { var col int64 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SensitiveLongObject to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = i64 } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIntegerDefaultValues(v **types.IntegerDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IntegerDefaultValues if *v == nil { sv = &types.IntegerDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "DynamicValue": if err := awsRestjson1_deserializeDocumentDynamicDefaultValue(&sv.DynamicValue, value); err != nil { return err } case "StaticValues": if err := awsRestjson1_deserializeDocumentIntegerDefaultValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIntegerParameter(v **types.IntegerParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IntegerParameter if *v == nil { sv = &types.IntegerParameter{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Values": if err := awsRestjson1_deserializeDocumentSensitiveLongList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIntegerParameterDeclaration(v **types.IntegerParameterDeclaration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IntegerParameterDeclaration if *v == nil { sv = &types.IntegerParameterDeclaration{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentIntegerDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "MappedDataSetParameters": if err := awsRestjson1_deserializeDocumentMappedDataSetParameters(&sv.MappedDataSetParameters, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ParameterValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterValueType to be of type string, got %T instead", value) } sv.ParameterValueType = types.ParameterValueType(jtv) } case "ValueWhenUnset": if err := awsRestjson1_deserializeDocumentIntegerValueWhenUnsetConfiguration(&sv.ValueWhenUnset, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIntegerParameterList(v *[]types.IntegerParameter, 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.IntegerParameter if *v == nil { cv = []types.IntegerParameter{} } else { cv = *v } for _, value := range shape { var col types.IntegerParameter destAddr := &col if err := awsRestjson1_deserializeDocumentIntegerParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentIntegerValueWhenUnsetConfiguration(v **types.IntegerValueWhenUnsetConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.IntegerValueWhenUnsetConfiguration if *v == nil { sv = &types.IntegerValueWhenUnsetConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomValue": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SensitiveLong to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CustomValue = ptr.Int64(i64) } case "ValueWhenUnsetOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValueWhenUnsetOption to be of type string, got %T instead", value) } sv.ValueWhenUnsetOption = types.ValueWhenUnsetOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InternalFailureException if *v == nil { sv = &types.InternalFailureException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidNextTokenException if *v == nil { sv = &types.InvalidNextTokenException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.InvalidParameterValueException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidParameterValueException if *v == nil { sv = &types.InvalidParameterValueException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidRequestException if *v == nil { sv = &types.InvalidRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIpRestrictionRuleMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IpRestrictionRuleDescription to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentItemsLimitConfiguration(v **types.ItemsLimitConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ItemsLimitConfiguration if *v == nil { sv = &types.ItemsLimitConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ItemsLimit": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ItemsLimit = ptr.Int64(i64) } case "OtherCategories": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OtherCategories to be of type string, got %T instead", value) } sv.OtherCategories = types.OtherCategories(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJiraParameters(v **types.JiraParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JiraParameters if *v == nil { sv = &types.JiraParameters{} } else { sv = *v } for key, value := range shape { switch key { case "SiteBaseUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SiteBaseUrl to be of type string, got %T instead", value) } sv.SiteBaseUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJoinInstruction(v **types.JoinInstruction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JoinInstruction if *v == nil { sv = &types.JoinInstruction{} } else { sv = *v } for key, value := range shape { switch key { case "LeftJoinKeyProperties": if err := awsRestjson1_deserializeDocumentJoinKeyProperties(&sv.LeftJoinKeyProperties, value); err != nil { return err } case "LeftOperand": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogicalTableId to be of type string, got %T instead", value) } sv.LeftOperand = ptr.String(jtv) } case "OnClause": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OnClause to be of type string, got %T instead", value) } sv.OnClause = ptr.String(jtv) } case "RightJoinKeyProperties": if err := awsRestjson1_deserializeDocumentJoinKeyProperties(&sv.RightJoinKeyProperties, value); err != nil { return err } case "RightOperand": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogicalTableId to be of type string, got %T instead", value) } sv.RightOperand = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected JoinType to be of type string, got %T instead", value) } sv.Type = types.JoinType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJoinKeyProperties(v **types.JoinKeyProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.JoinKeyProperties if *v == nil { sv = &types.JoinKeyProperties{} } else { sv = *v } for key, value := range shape { switch key { case "UniqueKey": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.UniqueKey = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIConditionalFormatting(v **types.KPIConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIConditionalFormatting if *v == nil { sv = &types.KPIConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ConditionalFormattingOptions": if err := awsRestjson1_deserializeDocumentKPIConditionalFormattingOptionList(&sv.ConditionalFormattingOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIConditionalFormattingOption(v **types.KPIConditionalFormattingOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIConditionalFormattingOption if *v == nil { sv = &types.KPIConditionalFormattingOption{} } else { sv = *v } for key, value := range shape { switch key { case "PrimaryValue": if err := awsRestjson1_deserializeDocumentKPIPrimaryValueConditionalFormatting(&sv.PrimaryValue, value); err != nil { return err } case "ProgressBar": if err := awsRestjson1_deserializeDocumentKPIProgressBarConditionalFormatting(&sv.ProgressBar, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIConditionalFormattingOptionList(v *[]types.KPIConditionalFormattingOption, 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.KPIConditionalFormattingOption if *v == nil { cv = []types.KPIConditionalFormattingOption{} } else { cv = *v } for _, value := range shape { var col types.KPIConditionalFormattingOption destAddr := &col if err := awsRestjson1_deserializeDocumentKPIConditionalFormattingOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentKPIConfiguration(v **types.KPIConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIConfiguration if *v == nil { sv = &types.KPIConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FieldWells": if err := awsRestjson1_deserializeDocumentKPIFieldWells(&sv.FieldWells, value); err != nil { return err } case "KPIOptions": if err := awsRestjson1_deserializeDocumentKPIOptions(&sv.KPIOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentKPISortConfiguration(&sv.SortConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIFieldWells(v **types.KPIFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIFieldWells if *v == nil { sv = &types.KPIFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "TargetValues": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.TargetValues, value); err != nil { return err } case "TrendGroups": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.TrendGroups, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIOptions(v **types.KPIOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIOptions if *v == nil { sv = &types.KPIOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Comparison": if err := awsRestjson1_deserializeDocumentComparisonConfiguration(&sv.Comparison, value); err != nil { return err } case "PrimaryValueDisplayType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PrimaryValueDisplayType to be of type string, got %T instead", value) } sv.PrimaryValueDisplayType = types.PrimaryValueDisplayType(jtv) } case "PrimaryValueFontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.PrimaryValueFontConfiguration, value); err != nil { return err } case "ProgressBar": if err := awsRestjson1_deserializeDocumentProgressBarOptions(&sv.ProgressBar, value); err != nil { return err } case "SecondaryValue": if err := awsRestjson1_deserializeDocumentSecondaryValueOptions(&sv.SecondaryValue, value); err != nil { return err } case "SecondaryValueFontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.SecondaryValueFontConfiguration, value); err != nil { return err } case "TrendArrows": if err := awsRestjson1_deserializeDocumentTrendArrowOptions(&sv.TrendArrows, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIPrimaryValueConditionalFormatting(v **types.KPIPrimaryValueConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIPrimaryValueConditionalFormatting if *v == nil { sv = &types.KPIPrimaryValueConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "Icon": if err := awsRestjson1_deserializeDocumentConditionalFormattingIcon(&sv.Icon, value); err != nil { return err } case "TextColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.TextColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIProgressBarConditionalFormatting(v **types.KPIProgressBarConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIProgressBarConditionalFormatting if *v == nil { sv = &types.KPIProgressBarConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ForegroundColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.ForegroundColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPISortConfiguration(v **types.KPISortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPISortConfiguration if *v == nil { sv = &types.KPISortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TrendGroupSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.TrendGroupSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKPIVisual(v **types.KPIVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.KPIVisual if *v == nil { sv = &types.KPIVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentKPIConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "ConditionalFormatting": if err := awsRestjson1_deserializeDocumentKPIConditionalFormatting(&sv.ConditionalFormatting, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLabelOptions(v **types.LabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LabelOptions if *v == nil { sv = &types.LabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "FontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.FontConfiguration, value); err != nil { return err } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLayout(v **types.Layout, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Layout if *v == nil { sv = &types.Layout{} } else { sv = *v } for key, value := range shape { switch key { case "Configuration": if err := awsRestjson1_deserializeDocumentLayoutConfiguration(&sv.Configuration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLayoutConfiguration(v **types.LayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LayoutConfiguration if *v == nil { sv = &types.LayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FreeFormLayout": if err := awsRestjson1_deserializeDocumentFreeFormLayoutConfiguration(&sv.FreeFormLayout, value); err != nil { return err } case "GridLayout": if err := awsRestjson1_deserializeDocumentGridLayoutConfiguration(&sv.GridLayout, value); err != nil { return err } case "SectionBasedLayout": if err := awsRestjson1_deserializeDocumentSectionBasedLayoutConfiguration(&sv.SectionBasedLayout, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLayoutList(v *[]types.Layout, 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.Layout if *v == nil { cv = []types.Layout{} } else { cv = *v } for _, value := range shape { var col types.Layout destAddr := &col if err := awsRestjson1_deserializeDocumentLayout(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLegendOptions(v **types.LegendOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LegendOptions if *v == nil { sv = &types.LegendOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Height": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Height = ptr.String(jtv) } case "Position": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LegendPosition to be of type string, got %T instead", value) } sv.Position = types.LegendPosition(jtv) } case "Title": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.Title, value); err != nil { return err } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } case "Width": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Width = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.ExceptionResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartAggregatedFieldWells(v **types.LineChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartAggregatedFieldWells if *v == nil { sv = &types.LineChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Category, value); err != nil { return err } case "Colors": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Colors, value); err != nil { return err } case "SmallMultiples": if err := awsRestjson1_deserializeDocumentSmallMultiplesDimensionFieldList(&sv.SmallMultiples, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartConfiguration(v **types.LineChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartConfiguration if *v == nil { sv = &types.LineChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ContributionAnalysisDefaults": if err := awsRestjson1_deserializeDocumentContributionAnalysisDefaultList(&sv.ContributionAnalysisDefaults, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "DefaultSeriesSettings": if err := awsRestjson1_deserializeDocumentLineChartDefaultSeriesSettings(&sv.DefaultSeriesSettings, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentLineChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "ForecastConfigurations": if err := awsRestjson1_deserializeDocumentForecastConfigurationList(&sv.ForecastConfigurations, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "PrimaryYAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentLineSeriesAxisDisplayOptions(&sv.PrimaryYAxisDisplayOptions, value); err != nil { return err } case "PrimaryYAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.PrimaryYAxisLabelOptions, value); err != nil { return err } case "ReferenceLines": if err := awsRestjson1_deserializeDocumentReferenceLineList(&sv.ReferenceLines, value); err != nil { return err } case "SecondaryYAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentLineSeriesAxisDisplayOptions(&sv.SecondaryYAxisDisplayOptions, value); err != nil { return err } case "SecondaryYAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.SecondaryYAxisLabelOptions, value); err != nil { return err } case "Series": if err := awsRestjson1_deserializeDocumentSeriesItemList(&sv.Series, value); err != nil { return err } case "SmallMultiplesOptions": if err := awsRestjson1_deserializeDocumentSmallMultiplesOptions(&sv.SmallMultiplesOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentLineChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LineChartType to be of type string, got %T instead", value) } sv.Type = types.LineChartType(jtv) } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } case "XAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.XAxisDisplayOptions, value); err != nil { return err } case "XAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.XAxisLabelOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartDefaultSeriesSettings(v **types.LineChartDefaultSeriesSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartDefaultSeriesSettings if *v == nil { sv = &types.LineChartDefaultSeriesSettings{} } else { sv = *v } for key, value := range shape { switch key { case "AxisBinding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AxisBinding to be of type string, got %T instead", value) } sv.AxisBinding = types.AxisBinding(jtv) } case "LineStyleSettings": if err := awsRestjson1_deserializeDocumentLineChartLineStyleSettings(&sv.LineStyleSettings, value); err != nil { return err } case "MarkerStyleSettings": if err := awsRestjson1_deserializeDocumentLineChartMarkerStyleSettings(&sv.MarkerStyleSettings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartFieldWells(v **types.LineChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartFieldWells if *v == nil { sv = &types.LineChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "LineChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentLineChartAggregatedFieldWells(&sv.LineChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartLineStyleSettings(v **types.LineChartLineStyleSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartLineStyleSettings if *v == nil { sv = &types.LineChartLineStyleSettings{} } else { sv = *v } for key, value := range shape { switch key { case "LineInterpolation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LineInterpolation to be of type string, got %T instead", value) } sv.LineInterpolation = types.LineInterpolation(jtv) } case "LineStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LineChartLineStyle to be of type string, got %T instead", value) } sv.LineStyle = types.LineChartLineStyle(jtv) } case "LineVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.LineVisibility = types.Visibility(jtv) } case "LineWidth": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.LineWidth = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartMarkerStyleSettings(v **types.LineChartMarkerStyleSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartMarkerStyleSettings if *v == nil { sv = &types.LineChartMarkerStyleSettings{} } else { sv = *v } for key, value := range shape { switch key { case "MarkerColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.MarkerColor = ptr.String(jtv) } case "MarkerShape": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LineChartMarkerShape to be of type string, got %T instead", value) } sv.MarkerShape = types.LineChartMarkerShape(jtv) } case "MarkerSize": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.MarkerSize = ptr.String(jtv) } case "MarkerVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.MarkerVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartSeriesSettings(v **types.LineChartSeriesSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartSeriesSettings if *v == nil { sv = &types.LineChartSeriesSettings{} } else { sv = *v } for key, value := range shape { switch key { case "LineStyleSettings": if err := awsRestjson1_deserializeDocumentLineChartLineStyleSettings(&sv.LineStyleSettings, value); err != nil { return err } case "MarkerStyleSettings": if err := awsRestjson1_deserializeDocumentLineChartMarkerStyleSettings(&sv.MarkerStyleSettings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartSortConfiguration(v **types.LineChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartSortConfiguration if *v == nil { sv = &types.LineChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimitConfiguration, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } case "ColorItemsLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.ColorItemsLimitConfiguration, value); err != nil { return err } case "SmallMultiplesLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.SmallMultiplesLimitConfiguration, value); err != nil { return err } case "SmallMultiplesSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.SmallMultiplesSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineChartVisual(v **types.LineChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineChartVisual if *v == nil { sv = &types.LineChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentLineChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLineSeriesAxisDisplayOptions(v **types.LineSeriesAxisDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LineSeriesAxisDisplayOptions if *v == nil { sv = &types.LineSeriesAxisDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "AxisOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.AxisOptions, value); err != nil { return err } case "MissingDataConfigurations": if err := awsRestjson1_deserializeDocumentMissingDataConfigurationList(&sv.MissingDataConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLinkSharingConfiguration(v **types.LinkSharingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LinkSharingConfiguration if *v == nil { sv = &types.LinkSharingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Permissions": if err := awsRestjson1_deserializeDocumentResourcePermissionList(&sv.Permissions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentListControlDisplayOptions(v **types.ListControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListControlDisplayOptions if *v == nil { sv = &types.ListControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "SearchOptions": if err := awsRestjson1_deserializeDocumentListControlSearchOptions(&sv.SearchOptions, value); err != nil { return err } case "SelectAllOptions": if err := awsRestjson1_deserializeDocumentListControlSelectAllOptions(&sv.SelectAllOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentListControlSearchOptions(v **types.ListControlSearchOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListControlSearchOptions if *v == nil { sv = &types.ListControlSearchOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentListControlSelectAllOptions(v **types.ListControlSelectAllOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ListControlSelectAllOptions if *v == nil { sv = &types.ListControlSelectAllOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLoadingAnimation(v **types.LoadingAnimation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LoadingAnimation if *v == nil { sv = &types.LoadingAnimation{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLocalNavigationConfiguration(v **types.LocalNavigationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LocalNavigationConfiguration if *v == nil { sv = &types.LocalNavigationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TargetSheetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TargetSheetId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogicalTable(v **types.LogicalTable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LogicalTable if *v == nil { sv = &types.LogicalTable{} } else { sv = *v } for key, value := range shape { switch key { case "Alias": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogicalTableAlias to be of type string, got %T instead", value) } sv.Alias = ptr.String(jtv) } case "DataTransforms": if err := awsRestjson1_deserializeDocumentTransformOperationList(&sv.DataTransforms, value); err != nil { return err } case "Source": if err := awsRestjson1_deserializeDocumentLogicalTableSource(&sv.Source, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogicalTableMap(v *map[string]types.LogicalTable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]types.LogicalTable if *v == nil { mv = map[string]types.LogicalTable{} } else { mv = *v } for key, value := range shape { var parsedVal types.LogicalTable mapVar := parsedVal destAddr := &mapVar if err := awsRestjson1_deserializeDocumentLogicalTable(&destAddr, value); err != nil { return err } parsedVal = *destAddr mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentLogicalTableSource(v **types.LogicalTableSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LogicalTableSource if *v == nil { sv = &types.LogicalTableSource{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSetArn = ptr.String(jtv) } case "JoinInstruction": if err := awsRestjson1_deserializeDocumentJoinInstruction(&sv.JoinInstruction, value); err != nil { return err } case "PhysicalTableId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PhysicalTableId to be of type string, got %T instead", value) } sv.PhysicalTableId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLongFormatText(v **types.LongFormatText, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LongFormatText if *v == nil { sv = &types.LongFormatText{} } else { sv = *v } for key, value := range shape { switch key { case "PlainText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LongPlainText to be of type string, got %T instead", value) } sv.PlainText = ptr.String(jtv) } case "RichText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LongRichText to be of type string, got %T instead", value) } sv.RichText = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLookbackWindow(v **types.LookbackWindow, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LookbackWindow if *v == nil { sv = &types.LookbackWindow{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "Size": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveLong to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Size = i64 } case "SizeUnit": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LookbackWindowSizeUnit to be of type string, got %T instead", value) } sv.SizeUnit = types.LookbackWindowSizeUnit(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentManifestFileLocation(v **types.ManifestFileLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ManifestFileLocation if *v == nil { sv = &types.ManifestFileLocation{} } else { sv = *v } for key, value := range shape { switch key { case "Bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Bucket to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Key to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMappedDataSetParameter(v **types.MappedDataSetParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MappedDataSetParameter if *v == nil { sv = &types.MappedDataSetParameter{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } case "DataSetParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.DataSetParameterName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMappedDataSetParameters(v *[]types.MappedDataSetParameter, 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.MappedDataSetParameter if *v == nil { cv = []types.MappedDataSetParameter{} } else { cv = *v } for _, value := range shape { var col types.MappedDataSetParameter destAddr := &col if err := awsRestjson1_deserializeDocumentMappedDataSetParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMarginStyle(v **types.MarginStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MarginStyle if *v == nil { sv = &types.MarginStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Show": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Show = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMariaDbParameters(v **types.MariaDbParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MariaDbParameters if *v == nil { sv = &types.MariaDbParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMaximumLabelType(v **types.MaximumLabelType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MaximumLabelType if *v == nil { sv = &types.MaximumLabelType{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMaximumMinimumComputation(v **types.MaximumMinimumComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MaximumMinimumComputation if *v == nil { sv = &types.MaximumMinimumComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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 "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MaximumMinimumComputationType to be of type string, got %T instead", value) } sv.Type = types.MaximumMinimumComputationType(jtv) } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMeasureField(v **types.MeasureField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MeasureField if *v == nil { sv = &types.MeasureField{} } else { sv = *v } for key, value := range shape { switch key { case "CalculatedMeasureField": if err := awsRestjson1_deserializeDocumentCalculatedMeasureField(&sv.CalculatedMeasureField, value); err != nil { return err } case "CategoricalMeasureField": if err := awsRestjson1_deserializeDocumentCategoricalMeasureField(&sv.CategoricalMeasureField, value); err != nil { return err } case "DateMeasureField": if err := awsRestjson1_deserializeDocumentDateMeasureField(&sv.DateMeasureField, value); err != nil { return err } case "NumericalMeasureField": if err := awsRestjson1_deserializeDocumentNumericalMeasureField(&sv.NumericalMeasureField, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMemberIdArnPair(v **types.MemberIdArnPair, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MemberIdArnPair if *v == nil { sv = &types.MemberIdArnPair{} } else { sv = *v } for key, value := range shape { switch key { case "MemberArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.MemberArn = ptr.String(jtv) } case "MemberId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RestrictiveResourceId to be of type string, got %T instead", value) } sv.MemberId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMetricComparisonComputation(v **types.MetricComparisonComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MetricComparisonComputation if *v == nil { sv = &types.MetricComparisonComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = ptr.String(jtv) } case "FromValue": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.FromValue, 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 "TargetValue": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.TargetValue, value); err != nil { return err } case "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMinimumLabelType(v **types.MinimumLabelType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MinimumLabelType if *v == nil { sv = &types.MinimumLabelType{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMissingDataConfiguration(v **types.MissingDataConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MissingDataConfiguration if *v == nil { sv = &types.MissingDataConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TreatmentOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MissingDataTreatmentOption to be of type string, got %T instead", value) } sv.TreatmentOption = types.MissingDataTreatmentOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMissingDataConfigurationList(v *[]types.MissingDataConfiguration, 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.MissingDataConfiguration if *v == nil { cv = []types.MissingDataConfiguration{} } else { cv = *v } for _, value := range shape { var col types.MissingDataConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentMissingDataConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMySqlParameters(v **types.MySqlParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MySqlParameters if *v == nil { sv = &types.MySqlParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNamedEntityDefinition(v **types.NamedEntityDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NamedEntityDefinition if *v == nil { sv = &types.NamedEntityDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "FieldName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.FieldName = ptr.String(jtv) } case "Metric": if err := awsRestjson1_deserializeDocumentNamedEntityDefinitionMetric(&sv.Metric, value); err != nil { return err } case "PropertyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.PropertyName = ptr.String(jtv) } case "PropertyRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PropertyRole to be of type string, got %T instead", value) } sv.PropertyRole = types.PropertyRole(jtv) } case "PropertyUsage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PropertyUsage to be of type string, got %T instead", value) } sv.PropertyUsage = types.PropertyUsage(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNamedEntityDefinitionMetric(v **types.NamedEntityDefinitionMetric, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NamedEntityDefinitionMetric if *v == nil { sv = &types.NamedEntityDefinitionMetric{} } else { sv = *v } for key, value := range shape { switch key { case "Aggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamedEntityAggType to be of type string, got %T instead", value) } sv.Aggregation = types.NamedEntityAggType(jtv) } case "AggregationFunctionParameters": if err := awsRestjson1_deserializeDocumentAggregationFunctionParameters(&sv.AggregationFunctionParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNamedEntityDefinitions(v *[]types.NamedEntityDefinition, 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.NamedEntityDefinition if *v == nil { cv = []types.NamedEntityDefinition{} } else { cv = *v } for _, value := range shape { var col types.NamedEntityDefinition destAddr := &col if err := awsRestjson1_deserializeDocumentNamedEntityDefinition(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNamespaceError(v **types.NamespaceError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NamespaceError if *v == nil { sv = &types.NamespaceError{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamespaceErrorType to be of type string, got %T instead", value) } sv.Type = types.NamespaceErrorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNamespaceInfoV2(v **types.NamespaceInfoV2, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NamespaceInfoV2 if *v == nil { sv = &types.NamespaceInfoV2{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CapacityRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CapacityRegion = ptr.String(jtv) } case "CreationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamespaceStatus to be of type string, got %T instead", value) } sv.CreationStatus = types.NamespaceStatus(jtv) } case "IdentityStore": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IdentityStore to be of type string, got %T instead", value) } sv.IdentityStore = types.IdentityStore(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NamespaceError": if err := awsRestjson1_deserializeDocumentNamespaceError(&sv.NamespaceError, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNamespaces(v *[]types.NamespaceInfoV2, 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.NamespaceInfoV2 if *v == nil { cv = []types.NamespaceInfoV2{} } else { cv = *v } for _, value := range shape { var col types.NamespaceInfoV2 destAddr := &col if err := awsRestjson1_deserializeDocumentNamespaceInfoV2(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNegativeFormat(v **types.NegativeFormat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NegativeFormat if *v == nil { sv = &types.NegativeFormat{} } else { sv = *v } for key, value := range shape { switch key { case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "Suffix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Suffix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNegativeValueConfiguration(v **types.NegativeValueConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NegativeValueConfiguration if *v == nil { sv = &types.NegativeValueConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NegativeValueDisplayMode to be of type string, got %T instead", value) } sv.DisplayMode = types.NegativeValueDisplayMode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkInterface(v **types.NetworkInterface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NetworkInterface if *v == nil { sv = &types.NetworkInterface{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityZone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AvailabilityZone = ptr.String(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "NetworkInterfaceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkInterfaceId to be of type string, got %T instead", value) } sv.NetworkInterfaceId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NetworkInterfaceStatus to be of type string, got %T instead", value) } sv.Status = types.NetworkInterfaceStatus(jtv) } case "SubnetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) } sv.SubnetId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkInterfaceList(v *[]types.NetworkInterface, 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.NetworkInterface if *v == nil { cv = []types.NetworkInterface{} } else { cv = *v } for _, value := range shape { var col types.NetworkInterface destAddr := &col if err := awsRestjson1_deserializeDocumentNetworkInterface(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentNewDefaultValues(v **types.NewDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NewDefaultValues if *v == nil { sv = &types.NewDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeStaticValues": if err := awsRestjson1_deserializeDocumentDateTimeDatasetParameterValueList(&sv.DateTimeStaticValues, value); err != nil { return err } case "DecimalStaticValues": if err := awsRestjson1_deserializeDocumentDecimalDatasetParameterValueList(&sv.DecimalStaticValues, value); err != nil { return err } case "IntegerStaticValues": if err := awsRestjson1_deserializeDocumentIntegerDatasetParameterValueList(&sv.IntegerStaticValues, value); err != nil { return err } case "StringStaticValues": if err := awsRestjson1_deserializeDocumentStringDatasetParameterValueList(&sv.StringStaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNullValueFormatConfiguration(v **types.NullValueFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NullValueFormatConfiguration if *v == nil { sv = &types.NullValueFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "NullString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NullString to be of type string, got %T instead", value) } sv.NullString = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumberDisplayFormatConfiguration(v **types.NumberDisplayFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumberDisplayFormatConfiguration if *v == nil { sv = &types.NumberDisplayFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DecimalPlacesConfiguration": if err := awsRestjson1_deserializeDocumentDecimalPlacesConfiguration(&sv.DecimalPlacesConfiguration, value); err != nil { return err } case "NegativeValueConfiguration": if err := awsRestjson1_deserializeDocumentNegativeValueConfiguration(&sv.NegativeValueConfiguration, value); err != nil { return err } case "NullValueFormatConfiguration": if err := awsRestjson1_deserializeDocumentNullValueFormatConfiguration(&sv.NullValueFormatConfiguration, value); err != nil { return err } case "NumberScale": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumberScale to be of type string, got %T instead", value) } sv.NumberScale = types.NumberScale(jtv) } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "SeparatorConfiguration": if err := awsRestjson1_deserializeDocumentNumericSeparatorConfiguration(&sv.SeparatorConfiguration, value); err != nil { return err } case "Suffix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Suffix to be of type string, got %T instead", value) } sv.Suffix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumberFormatConfiguration(v **types.NumberFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumberFormatConfiguration if *v == nil { sv = &types.NumberFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentNumericFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericalAggregationFunction(v **types.NumericalAggregationFunction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericalAggregationFunction if *v == nil { sv = &types.NumericalAggregationFunction{} } else { sv = *v } for key, value := range shape { switch key { case "PercentileAggregation": if err := awsRestjson1_deserializeDocumentPercentileAggregation(&sv.PercentileAggregation, value); err != nil { return err } case "SimpleNumericalAggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimpleNumericalAggregationFunction to be of type string, got %T instead", value) } sv.SimpleNumericalAggregation = types.SimpleNumericalAggregationFunction(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericalDimensionField(v **types.NumericalDimensionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericalDimensionField if *v == nil { sv = &types.NumericalDimensionField{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentNumberFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } case "HierarchyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HierarchyId to be of type string, got %T instead", value) } sv.HierarchyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericalMeasureField(v **types.NumericalMeasureField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericalMeasureField if *v == nil { sv = &types.NumericalMeasureField{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if err := awsRestjson1_deserializeDocumentNumericalAggregationFunction(&sv.AggregationFunction, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentNumberFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericAxisOptions(v **types.NumericAxisOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericAxisOptions if *v == nil { sv = &types.NumericAxisOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Range": if err := awsRestjson1_deserializeDocumentAxisDisplayRange(&sv.Range, value); err != nil { return err } case "Scale": if err := awsRestjson1_deserializeDocumentAxisScale(&sv.Scale, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericEqualityDrillDownFilter(v **types.NumericEqualityDrillDownFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericEqualityDrillDownFilter if *v == nil { sv = &types.NumericEqualityDrillDownFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Value = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericEqualityFilter(v **types.NumericEqualityFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericEqualityFilter if *v == nil { sv = &types.NumericEqualityFilter{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if err := awsRestjson1_deserializeDocumentAggregationFunction(&sv.AggregationFunction, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } case "MatchOperator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumericEqualityMatchOperator to be of type string, got %T instead", value) } sv.MatchOperator = types.NumericEqualityMatchOperator(jtv) } case "NullOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterNullOption to be of type string, got %T instead", value) } sv.NullOption = types.FilterNullOption(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "SelectAllOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumericFilterSelectAllOptions to be of type string, got %T instead", value) } sv.SelectAllOptions = types.NumericFilterSelectAllOptions(jtv) } case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Value = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericFormatConfiguration(v **types.NumericFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericFormatConfiguration if *v == nil { sv = &types.NumericFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CurrencyDisplayFormatConfiguration": if err := awsRestjson1_deserializeDocumentCurrencyDisplayFormatConfiguration(&sv.CurrencyDisplayFormatConfiguration, value); err != nil { return err } case "NumberDisplayFormatConfiguration": if err := awsRestjson1_deserializeDocumentNumberDisplayFormatConfiguration(&sv.NumberDisplayFormatConfiguration, value); err != nil { return err } case "PercentageDisplayFormatConfiguration": if err := awsRestjson1_deserializeDocumentPercentageDisplayFormatConfiguration(&sv.PercentageDisplayFormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericRangeFilter(v **types.NumericRangeFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericRangeFilter if *v == nil { sv = &types.NumericRangeFilter{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationFunction": if err := awsRestjson1_deserializeDocumentAggregationFunction(&sv.AggregationFunction, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } case "IncludeMaximum": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeMaximum = ptr.Bool(jtv) } case "IncludeMinimum": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeMinimum = ptr.Bool(jtv) } case "NullOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterNullOption to be of type string, got %T instead", value) } sv.NullOption = types.FilterNullOption(jtv) } case "RangeMaximum": if err := awsRestjson1_deserializeDocumentNumericRangeFilterValue(&sv.RangeMaximum, value); err != nil { return err } case "RangeMinimum": if err := awsRestjson1_deserializeDocumentNumericRangeFilterValue(&sv.RangeMinimum, value); err != nil { return err } case "SelectAllOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumericFilterSelectAllOptions to be of type string, got %T instead", value) } sv.SelectAllOptions = types.NumericFilterSelectAllOptions(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericRangeFilterValue(v **types.NumericRangeFilterValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericRangeFilterValue if *v == nil { sv = &types.NumericRangeFilterValue{} } else { sv = *v } for key, value := range shape { switch key { case "Parameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.Parameter = ptr.String(jtv) } case "StaticValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StaticValue = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.StaticValue = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNumericSeparatorConfiguration(v **types.NumericSeparatorConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NumericSeparatorConfiguration if *v == nil { sv = &types.NumericSeparatorConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DecimalSeparator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumericSeparatorSymbol to be of type string, got %T instead", value) } sv.DecimalSeparator = types.NumericSeparatorSymbol(jtv) } case "ThousandsSeparator": if err := awsRestjson1_deserializeDocumentThousandSeparatorOptions(&sv.ThousandsSeparator, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOracleParameters(v **types.OracleParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OracleParameters if *v == nil { sv = &types.OracleParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOutputColumn(v **types.OutputColumn, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OutputColumn if *v == nil { sv = &types.OutputColumn{} } else { sv = *v } for key, value := range shape { switch key { case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnDescriptiveText to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnDataType to be of type string, got %T instead", value) } sv.Type = types.ColumnDataType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOutputColumnList(v *[]types.OutputColumn, 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.OutputColumn if *v == nil { cv = []types.OutputColumn{} } else { cv = *v } for _, value := range shape { var col types.OutputColumn destAddr := &col if err := awsRestjson1_deserializeDocumentOutputColumn(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentOverrideDatasetParameterOperation(v **types.OverrideDatasetParameterOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OverrideDatasetParameterOperation if *v == nil { sv = &types.OverrideDatasetParameterOperation{} } else { sv = *v } for key, value := range shape { switch key { case "NewDefaultValues": if err := awsRestjson1_deserializeDocumentNewDefaultValues(&sv.NewDefaultValues, value); err != nil { return err } case "NewParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterName to be of type string, got %T instead", value) } sv.NewParameterName = ptr.String(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPaginationConfiguration(v **types.PaginationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PaginationConfiguration if *v == nil { sv = &types.PaginationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "PageNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PageNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PageNumber = ptr.Int64(i64) } case "PageSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PageSize = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPanelConfiguration(v **types.PanelConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PanelConfiguration if *v == nil { sv = &types.PanelConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BackgroundColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColorWithTransparency to be of type string, got %T instead", value) } sv.BackgroundColor = ptr.String(jtv) } case "BackgroundVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.BackgroundVisibility = types.Visibility(jtv) } case "BorderColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColorWithTransparency to be of type string, got %T instead", value) } sv.BorderColor = ptr.String(jtv) } case "BorderStyle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PanelBorderStyle to be of type string, got %T instead", value) } sv.BorderStyle = types.PanelBorderStyle(jtv) } case "BorderThickness": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.BorderThickness = ptr.String(jtv) } case "BorderVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.BorderVisibility = types.Visibility(jtv) } case "GutterSpacing": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.GutterSpacing = ptr.String(jtv) } case "GutterVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.GutterVisibility = types.Visibility(jtv) } case "Title": if err := awsRestjson1_deserializeDocumentPanelTitleOptions(&sv.Title, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPanelTitleOptions(v **types.PanelTitleOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PanelTitleOptions if *v == nil { sv = &types.PanelTitleOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.FontConfiguration, value); err != nil { return err } case "HorizontalTextAlignment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HorizontalTextAlignment to be of type string, got %T instead", value) } sv.HorizontalTextAlignment = types.HorizontalTextAlignment(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterControl(v **types.ParameterControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterControl if *v == nil { sv = &types.ParameterControl{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimePicker": if err := awsRestjson1_deserializeDocumentParameterDateTimePickerControl(&sv.DateTimePicker, value); err != nil { return err } case "Dropdown": if err := awsRestjson1_deserializeDocumentParameterDropDownControl(&sv.Dropdown, value); err != nil { return err } case "List": if err := awsRestjson1_deserializeDocumentParameterListControl(&sv.List, value); err != nil { return err } case "Slider": if err := awsRestjson1_deserializeDocumentParameterSliderControl(&sv.Slider, value); err != nil { return err } case "TextArea": if err := awsRestjson1_deserializeDocumentParameterTextAreaControl(&sv.TextArea, value); err != nil { return err } case "TextField": if err := awsRestjson1_deserializeDocumentParameterTextFieldControl(&sv.TextField, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterControlList(v *[]types.ParameterControl, 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.ParameterControl if *v == nil { cv = []types.ParameterControl{} } else { cv = *v } for _, value := range shape { var col types.ParameterControl destAddr := &col if err := awsRestjson1_deserializeDocumentParameterControl(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentParameterDateTimePickerControl(v **types.ParameterDateTimePickerControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterDateTimePickerControl if *v == nil { sv = &types.ParameterDateTimePickerControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentDateTimePickerControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "ParameterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ParameterControlId = ptr.String(jtv) } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterDeclaration(v **types.ParameterDeclaration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterDeclaration if *v == nil { sv = &types.ParameterDeclaration{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeParameterDeclaration": if err := awsRestjson1_deserializeDocumentDateTimeParameterDeclaration(&sv.DateTimeParameterDeclaration, value); err != nil { return err } case "DecimalParameterDeclaration": if err := awsRestjson1_deserializeDocumentDecimalParameterDeclaration(&sv.DecimalParameterDeclaration, value); err != nil { return err } case "IntegerParameterDeclaration": if err := awsRestjson1_deserializeDocumentIntegerParameterDeclaration(&sv.IntegerParameterDeclaration, value); err != nil { return err } case "StringParameterDeclaration": if err := awsRestjson1_deserializeDocumentStringParameterDeclaration(&sv.StringParameterDeclaration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterDeclarationList(v *[]types.ParameterDeclaration, 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.ParameterDeclaration if *v == nil { cv = []types.ParameterDeclaration{} } else { cv = *v } for _, value := range shape { var col types.ParameterDeclaration destAddr := &col if err := awsRestjson1_deserializeDocumentParameterDeclaration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentParameterDropDownControl(v **types.ParameterDropDownControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterDropDownControl if *v == nil { sv = &types.ParameterDropDownControl{} } else { sv = *v } for key, value := range shape { switch key { case "CascadingControlConfiguration": if err := awsRestjson1_deserializeDocumentCascadingControlConfiguration(&sv.CascadingControlConfiguration, value); err != nil { return err } case "DisplayOptions": if err := awsRestjson1_deserializeDocumentDropDownControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "ParameterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ParameterControlId = ptr.String(jtv) } case "SelectableValues": if err := awsRestjson1_deserializeDocumentParameterSelectableValues(&sv.SelectableValues, value); err != nil { return err } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlListType to be of type string, got %T instead", value) } sv.Type = types.SheetControlListType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterListControl(v **types.ParameterListControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterListControl if *v == nil { sv = &types.ParameterListControl{} } else { sv = *v } for key, value := range shape { switch key { case "CascadingControlConfiguration": if err := awsRestjson1_deserializeDocumentCascadingControlConfiguration(&sv.CascadingControlConfiguration, value); err != nil { return err } case "DisplayOptions": if err := awsRestjson1_deserializeDocumentListControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "ParameterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ParameterControlId = ptr.String(jtv) } case "SelectableValues": if err := awsRestjson1_deserializeDocumentParameterSelectableValues(&sv.SelectableValues, value); err != nil { return err } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlListType to be of type string, got %T instead", value) } sv.Type = types.SheetControlListType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameters(v **types.Parameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Parameters if *v == nil { sv = &types.Parameters{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeParameters": if err := awsRestjson1_deserializeDocumentDateTimeParameterList(&sv.DateTimeParameters, value); err != nil { return err } case "DecimalParameters": if err := awsRestjson1_deserializeDocumentDecimalParameterList(&sv.DecimalParameters, value); err != nil { return err } case "IntegerParameters": if err := awsRestjson1_deserializeDocumentIntegerParameterList(&sv.IntegerParameters, value); err != nil { return err } case "StringParameters": if err := awsRestjson1_deserializeDocumentStringParameterList(&sv.StringParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterSelectableValueList(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_deserializeDocumentParameterSelectableValues(v **types.ParameterSelectableValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterSelectableValues if *v == nil { sv = &types.ParameterSelectableValues{} } else { sv = *v } for key, value := range shape { switch key { case "LinkToDataSetColumn": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.LinkToDataSetColumn, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentParameterSelectableValueList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterSliderControl(v **types.ParameterSliderControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterSliderControl if *v == nil { sv = &types.ParameterSliderControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentSliderControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "MaximumValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.MaximumValue = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.MaximumValue = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "MinimumValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.MinimumValue = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.MinimumValue = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "ParameterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ParameterControlId = ptr.String(jtv) } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } case "StepSize": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StepSize = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.StepSize = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterTextAreaControl(v **types.ParameterTextAreaControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterTextAreaControl if *v == nil { sv = &types.ParameterTextAreaControl{} } else { sv = *v } for key, value := range shape { switch key { case "Delimiter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TextAreaControlDelimiter to be of type string, got %T instead", value) } sv.Delimiter = ptr.String(jtv) } case "DisplayOptions": if err := awsRestjson1_deserializeDocumentTextAreaControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "ParameterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ParameterControlId = ptr.String(jtv) } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentParameterTextFieldControl(v **types.ParameterTextFieldControl, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ParameterTextFieldControl if *v == nil { sv = &types.ParameterTextFieldControl{} } else { sv = *v } for key, value := range shape { switch key { case "DisplayOptions": if err := awsRestjson1_deserializeDocumentTextFieldControlDisplayOptions(&sv.DisplayOptions, value); err != nil { return err } case "ParameterControlId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ParameterControlId = ptr.String(jtv) } case "SourceParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.SourceParameterName = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPath(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 Arn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPercentageDisplayFormatConfiguration(v **types.PercentageDisplayFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PercentageDisplayFormatConfiguration if *v == nil { sv = &types.PercentageDisplayFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DecimalPlacesConfiguration": if err := awsRestjson1_deserializeDocumentDecimalPlacesConfiguration(&sv.DecimalPlacesConfiguration, value); err != nil { return err } case "NegativeValueConfiguration": if err := awsRestjson1_deserializeDocumentNegativeValueConfiguration(&sv.NegativeValueConfiguration, value); err != nil { return err } case "NullValueFormatConfiguration": if err := awsRestjson1_deserializeDocumentNullValueFormatConfiguration(&sv.NullValueFormatConfiguration, value); err != nil { return err } case "Prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } case "SeparatorConfiguration": if err := awsRestjson1_deserializeDocumentNumericSeparatorConfiguration(&sv.SeparatorConfiguration, value); err != nil { return err } case "Suffix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Suffix to be of type string, got %T instead", value) } sv.Suffix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPercentileAggregation(v **types.PercentileAggregation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PercentileAggregation if *v == nil { sv = &types.PercentileAggregation{} } else { sv = *v } for key, value := range shape { switch key { case "PercentileValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.PercentileValue = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.PercentileValue = ptr.Float64(f64) default: return fmt.Errorf("expected PercentileValue to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPercentVisibleRange(v **types.PercentVisibleRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PercentVisibleRange if *v == nil { sv = &types.PercentVisibleRange{} } else { sv = *v } for key, value := range shape { switch key { case "From": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.From = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.From = ptr.Float64(f64) default: return fmt.Errorf("expected PercentNumber to be a JSON Number, got %T instead", value) } } case "To": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.To = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.To = ptr.Float64(f64) default: return fmt.Errorf("expected PercentNumber to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPeriodOverPeriodComputation(v **types.PeriodOverPeriodComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PeriodOverPeriodComputation if *v == nil { sv = &types.PeriodOverPeriodComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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 "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPeriodToDateComputation(v **types.PeriodToDateComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PeriodToDateComputation if *v == nil { sv = &types.PeriodToDateComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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 "PeriodTimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.PeriodTimeGranularity = types.TimeGranularity(jtv) } case "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPhysicalTable(v *types.PhysicalTable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var uv types.PhysicalTable loop: for key, value := range shape { if value == nil { continue } switch key { case "CustomSql": var mv types.CustomSql destAddr := &mv if err := awsRestjson1_deserializeDocumentCustomSql(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.PhysicalTableMemberCustomSql{Value: mv} break loop case "RelationalTable": var mv types.RelationalTable destAddr := &mv if err := awsRestjson1_deserializeDocumentRelationalTable(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.PhysicalTableMemberRelationalTable{Value: mv} break loop case "S3Source": var mv types.S3Source destAddr := &mv if err := awsRestjson1_deserializeDocumentS3Source(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.PhysicalTableMemberS3Source{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentPhysicalTableMap(v *map[string]types.PhysicalTable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]types.PhysicalTable if *v == nil { mv = map[string]types.PhysicalTable{} } else { mv = *v } for key, value := range shape { var parsedVal types.PhysicalTable mapVar := parsedVal if err := awsRestjson1_deserializeDocumentPhysicalTable(&mapVar, value); err != nil { return err } parsedVal = mapVar mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentPieChartAggregatedFieldWells(v **types.PieChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PieChartAggregatedFieldWells if *v == nil { sv = &types.PieChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Category, value); err != nil { return err } case "SmallMultiples": if err := awsRestjson1_deserializeDocumentSmallMultiplesDimensionFieldList(&sv.SmallMultiples, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPieChartConfiguration(v **types.PieChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PieChartConfiguration if *v == nil { sv = &types.PieChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "ContributionAnalysisDefaults": if err := awsRestjson1_deserializeDocumentContributionAnalysisDefaultList(&sv.ContributionAnalysisDefaults, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "DonutOptions": if err := awsRestjson1_deserializeDocumentDonutOptions(&sv.DonutOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentPieChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "SmallMultiplesOptions": if err := awsRestjson1_deserializeDocumentSmallMultiplesOptions(&sv.SmallMultiplesOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentPieChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "ValueLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ValueLabelOptions, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPieChartFieldWells(v **types.PieChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PieChartFieldWells if *v == nil { sv = &types.PieChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "PieChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentPieChartAggregatedFieldWells(&sv.PieChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPieChartSortConfiguration(v **types.PieChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PieChartSortConfiguration if *v == nil { sv = &types.PieChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } case "SmallMultiplesLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.SmallMultiplesLimitConfiguration, value); err != nil { return err } case "SmallMultiplesSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.SmallMultiplesSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPieChartVisual(v **types.PieChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PieChartVisual if *v == nil { sv = &types.PieChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentPieChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotFieldSortOptions(v **types.PivotFieldSortOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotFieldSortOptions if *v == nil { sv = &types.PivotFieldSortOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "SortBy": if err := awsRestjson1_deserializeDocumentPivotTableSortBy(&sv.SortBy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotFieldSortOptionsList(v *[]types.PivotFieldSortOptions, 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.PivotFieldSortOptions if *v == nil { cv = []types.PivotFieldSortOptions{} } else { cv = *v } for _, value := range shape { var col types.PivotFieldSortOptions destAddr := &col if err := awsRestjson1_deserializeDocumentPivotFieldSortOptions(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableAggregatedFieldWells(v **types.PivotTableAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableAggregatedFieldWells if *v == nil { sv = &types.PivotTableAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentPivotTableDimensionList(&sv.Columns, value); err != nil { return err } case "Rows": if err := awsRestjson1_deserializeDocumentPivotTableDimensionList(&sv.Rows, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentPivotMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableCellConditionalFormatting(v **types.PivotTableCellConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableCellConditionalFormatting if *v == nil { sv = &types.PivotTableCellConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "Scope": if err := awsRestjson1_deserializeDocumentPivotTableConditionalFormattingScope(&sv.Scope, value); err != nil { return err } case "Scopes": if err := awsRestjson1_deserializeDocumentPivotTableConditionalFormattingScopeList(&sv.Scopes, value); err != nil { return err } case "TextFormat": if err := awsRestjson1_deserializeDocumentTextConditionalFormat(&sv.TextFormat, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableConditionalFormatting(v **types.PivotTableConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableConditionalFormatting if *v == nil { sv = &types.PivotTableConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ConditionalFormattingOptions": if err := awsRestjson1_deserializeDocumentPivotTableConditionalFormattingOptionList(&sv.ConditionalFormattingOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableConditionalFormattingOption(v **types.PivotTableConditionalFormattingOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableConditionalFormattingOption if *v == nil { sv = &types.PivotTableConditionalFormattingOption{} } else { sv = *v } for key, value := range shape { switch key { case "Cell": if err := awsRestjson1_deserializeDocumentPivotTableCellConditionalFormatting(&sv.Cell, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableConditionalFormattingOptionList(v *[]types.PivotTableConditionalFormattingOption, 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.PivotTableConditionalFormattingOption if *v == nil { cv = []types.PivotTableConditionalFormattingOption{} } else { cv = *v } for _, value := range shape { var col types.PivotTableConditionalFormattingOption destAddr := &col if err := awsRestjson1_deserializeDocumentPivotTableConditionalFormattingOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableConditionalFormattingScope(v **types.PivotTableConditionalFormattingScope, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableConditionalFormattingScope if *v == nil { sv = &types.PivotTableConditionalFormattingScope{} } else { sv = *v } for key, value := range shape { switch key { case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PivotTableConditionalFormattingScopeRole to be of type string, got %T instead", value) } sv.Role = types.PivotTableConditionalFormattingScopeRole(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableConditionalFormattingScopeList(v *[]types.PivotTableConditionalFormattingScope, 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.PivotTableConditionalFormattingScope if *v == nil { cv = []types.PivotTableConditionalFormattingScope{} } else { cv = *v } for _, value := range shape { var col types.PivotTableConditionalFormattingScope destAddr := &col if err := awsRestjson1_deserializeDocumentPivotTableConditionalFormattingScope(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableConfiguration(v **types.PivotTableConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableConfiguration if *v == nil { sv = &types.PivotTableConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FieldOptions": if err := awsRestjson1_deserializeDocumentPivotTableFieldOptions(&sv.FieldOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentPivotTableFieldWells(&sv.FieldWells, value); err != nil { return err } case "PaginatedReportOptions": if err := awsRestjson1_deserializeDocumentPivotTablePaginatedReportOptions(&sv.PaginatedReportOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentPivotTableSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "TableOptions": if err := awsRestjson1_deserializeDocumentPivotTableOptions(&sv.TableOptions, value); err != nil { return err } case "TotalOptions": if err := awsRestjson1_deserializeDocumentPivotTableTotalOptions(&sv.TotalOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableDataPathOption(v **types.PivotTableDataPathOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableDataPathOption if *v == nil { sv = &types.PivotTableDataPathOption{} } else { sv = *v } for key, value := range shape { switch key { case "DataPathList": if err := awsRestjson1_deserializeDocumentDataPathValueList(&sv.DataPathList, value); err != nil { return err } case "Width": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Width = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableDataPathOptionList(v *[]types.PivotTableDataPathOption, 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.PivotTableDataPathOption if *v == nil { cv = []types.PivotTableDataPathOption{} } else { cv = *v } for _, value := range shape { var col types.PivotTableDataPathOption destAddr := &col if err := awsRestjson1_deserializeDocumentPivotTableDataPathOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableDimensionList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldCollapseStateOption(v **types.PivotTableFieldCollapseStateOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableFieldCollapseStateOption if *v == nil { sv = &types.PivotTableFieldCollapseStateOption{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PivotTableFieldCollapseState to be of type string, got %T instead", value) } sv.State = types.PivotTableFieldCollapseState(jtv) } case "Target": if err := awsRestjson1_deserializeDocumentPivotTableFieldCollapseStateTarget(&sv.Target, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldCollapseStateOptionList(v *[]types.PivotTableFieldCollapseStateOption, 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.PivotTableFieldCollapseStateOption if *v == nil { cv = []types.PivotTableFieldCollapseStateOption{} } else { cv = *v } for _, value := range shape { var col types.PivotTableFieldCollapseStateOption destAddr := &col if err := awsRestjson1_deserializeDocumentPivotTableFieldCollapseStateOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldCollapseStateTarget(v **types.PivotTableFieldCollapseStateTarget, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableFieldCollapseStateTarget if *v == nil { sv = &types.PivotTableFieldCollapseStateTarget{} } else { sv = *v } for key, value := range shape { switch key { case "FieldDataPathValues": if err := awsRestjson1_deserializeDocumentDataPathValueList(&sv.FieldDataPathValues, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldOption(v **types.PivotTableFieldOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableFieldOption if *v == nil { sv = &types.PivotTableFieldOption{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomLabel to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldOptionList(v *[]types.PivotTableFieldOption, 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.PivotTableFieldOption if *v == nil { cv = []types.PivotTableFieldOption{} } else { cv = *v } for _, value := range shape { var col types.PivotTableFieldOption destAddr := &col if err := awsRestjson1_deserializeDocumentPivotTableFieldOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldOptions(v **types.PivotTableFieldOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableFieldOptions if *v == nil { sv = &types.PivotTableFieldOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CollapseStateOptions": if err := awsRestjson1_deserializeDocumentPivotTableFieldCollapseStateOptionList(&sv.CollapseStateOptions, value); err != nil { return err } case "DataPathOptions": if err := awsRestjson1_deserializeDocumentPivotTableDataPathOptionList(&sv.DataPathOptions, value); err != nil { return err } case "SelectedFieldOptions": if err := awsRestjson1_deserializeDocumentPivotTableFieldOptionList(&sv.SelectedFieldOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldSubtotalOptions(v **types.PivotTableFieldSubtotalOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableFieldSubtotalOptions if *v == nil { sv = &types.PivotTableFieldSubtotalOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldSubtotalOptionsList(v *[]types.PivotTableFieldSubtotalOptions, 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.PivotTableFieldSubtotalOptions if *v == nil { cv = []types.PivotTableFieldSubtotalOptions{} } else { cv = *v } for _, value := range shape { var col types.PivotTableFieldSubtotalOptions destAddr := &col if err := awsRestjson1_deserializeDocumentPivotTableFieldSubtotalOptions(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPivotTableFieldWells(v **types.PivotTableFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableFieldWells if *v == nil { sv = &types.PivotTableFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "PivotTableAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentPivotTableAggregatedFieldWells(&sv.PivotTableAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableOptions(v **types.PivotTableOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableOptions if *v == nil { sv = &types.PivotTableOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.CellStyle, value); err != nil { return err } case "CollapsedRowDimensionsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.CollapsedRowDimensionsVisibility = types.Visibility(jtv) } case "ColumnHeaderStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.ColumnHeaderStyle, value); err != nil { return err } case "ColumnNamesVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.ColumnNamesVisibility = types.Visibility(jtv) } case "MetricPlacement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PivotTableMetricPlacement to be of type string, got %T instead", value) } sv.MetricPlacement = types.PivotTableMetricPlacement(jtv) } case "RowAlternateColorOptions": if err := awsRestjson1_deserializeDocumentRowAlternateColorOptions(&sv.RowAlternateColorOptions, value); err != nil { return err } case "RowFieldNamesStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.RowFieldNamesStyle, value); err != nil { return err } case "RowHeaderStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.RowHeaderStyle, value); err != nil { return err } case "SingleMetricVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.SingleMetricVisibility = types.Visibility(jtv) } case "ToggleButtonsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.ToggleButtonsVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTablePaginatedReportOptions(v **types.PivotTablePaginatedReportOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTablePaginatedReportOptions if *v == nil { sv = &types.PivotTablePaginatedReportOptions{} } else { sv = *v } for key, value := range shape { switch key { case "OverflowColumnHeaderVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.OverflowColumnHeaderVisibility = types.Visibility(jtv) } case "VerticalOverflowVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.VerticalOverflowVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableSortBy(v **types.PivotTableSortBy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableSortBy if *v == nil { sv = &types.PivotTableSortBy{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnSort(&sv.Column, value); err != nil { return err } case "DataPath": if err := awsRestjson1_deserializeDocumentDataPathSort(&sv.DataPath, value); err != nil { return err } case "Field": if err := awsRestjson1_deserializeDocumentFieldSort(&sv.Field, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableSortConfiguration(v **types.PivotTableSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableSortConfiguration if *v == nil { sv = &types.PivotTableSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FieldSortOptions": if err := awsRestjson1_deserializeDocumentPivotFieldSortOptionsList(&sv.FieldSortOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableTotalOptions(v **types.PivotTableTotalOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableTotalOptions if *v == nil { sv = &types.PivotTableTotalOptions{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnSubtotalOptions": if err := awsRestjson1_deserializeDocumentSubtotalOptions(&sv.ColumnSubtotalOptions, value); err != nil { return err } case "ColumnTotalOptions": if err := awsRestjson1_deserializeDocumentPivotTotalOptions(&sv.ColumnTotalOptions, value); err != nil { return err } case "RowSubtotalOptions": if err := awsRestjson1_deserializeDocumentSubtotalOptions(&sv.RowSubtotalOptions, value); err != nil { return err } case "RowTotalOptions": if err := awsRestjson1_deserializeDocumentPivotTotalOptions(&sv.RowTotalOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTableVisual(v **types.PivotTableVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTableVisual if *v == nil { sv = &types.PivotTableVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentPivotTableConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ConditionalFormatting": if err := awsRestjson1_deserializeDocumentPivotTableConditionalFormatting(&sv.ConditionalFormatting, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPivotTotalOptions(v **types.PivotTotalOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PivotTotalOptions if *v == nil { sv = &types.PivotTotalOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "MetricHeaderCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.MetricHeaderCellStyle, value); err != nil { return err } case "Placement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableTotalsPlacement to be of type string, got %T instead", value) } sv.Placement = types.TableTotalsPlacement(jtv) } case "ScrollStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableTotalsScrollStatus to be of type string, got %T instead", value) } sv.ScrollStatus = types.TableTotalsScrollStatus(jtv) } case "TotalCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.TotalCellStyle, value); err != nil { return err } case "TotalsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.TotalsVisibility = types.Visibility(jtv) } case "ValueCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.ValueCellStyle, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPostgreSqlParameters(v **types.PostgreSqlParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PostgreSqlParameters if *v == nil { sv = &types.PostgreSqlParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPreconditionNotMetException(v **types.PreconditionNotMetException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PreconditionNotMetException if *v == nil { sv = &types.PreconditionNotMetException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPredefinedHierarchy(v **types.PredefinedHierarchy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PredefinedHierarchy if *v == nil { sv = &types.PredefinedHierarchy{} } else { sv = *v } for key, value := range shape { switch key { case "Columns": if err := awsRestjson1_deserializeDocumentPredefinedHierarchyColumnList(&sv.Columns, value); err != nil { return err } case "DrillDownFilters": if err := awsRestjson1_deserializeDocumentDrillDownFilterList(&sv.DrillDownFilters, value); err != nil { return err } case "HierarchyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HierarchyId to be of type string, got %T instead", value) } sv.HierarchyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPredefinedHierarchyColumnList(v *[]types.ColumnIdentifier, 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.ColumnIdentifier if *v == nil { cv = []types.ColumnIdentifier{} } else { cv = *v } for _, value := range shape { var col types.ColumnIdentifier destAddr := &col if err := awsRestjson1_deserializeDocumentColumnIdentifier(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPrestoParameters(v **types.PrestoParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.PrestoParameters if *v == nil { sv = &types.PrestoParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Catalog": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Catalog to be of type string, got %T instead", value) } sv.Catalog = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPrincipalList(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_deserializeDocumentProgressBarOptions(v **types.ProgressBarOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ProgressBarOptions if *v == nil { sv = &types.ProgressBarOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProjectedColumnList(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_deserializeDocumentProjectOperation(v **types.ProjectOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ProjectOperation if *v == nil { sv = &types.ProjectOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ProjectedColumns": if err := awsRestjson1_deserializeDocumentProjectedColumnList(&sv.ProjectedColumns, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentQueueInfo(v **types.QueueInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.QueueInfo if *v == nil { sv = &types.QueueInfo{} } else { sv = *v } for key, value := range shape { switch key { case "QueuedIngestion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QueuedIngestion = ptr.String(jtv) } case "WaitingOnIngestion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.WaitingOnIngestion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentQuickSightUserNotFoundException(v **types.QuickSightUserNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.QuickSightUserNotFoundException if *v == nil { sv = &types.QuickSightUserNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartAggregatedFieldWells(v **types.RadarChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartAggregatedFieldWells if *v == nil { sv = &types.RadarChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentRadarChartCategoryFieldList(&sv.Category, value); err != nil { return err } case "Color": if err := awsRestjson1_deserializeDocumentRadarChartColorFieldList(&sv.Color, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentRadarChartValuesFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartAreaStyleSettings(v **types.RadarChartAreaStyleSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartAreaStyleSettings if *v == nil { sv = &types.RadarChartAreaStyleSettings{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartCategoryFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRadarChartColorFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRadarChartConfiguration(v **types.RadarChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartConfiguration if *v == nil { sv = &types.RadarChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AlternateBandColorsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.AlternateBandColorsVisibility = types.Visibility(jtv) } case "AlternateBandEvenColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.AlternateBandEvenColor = ptr.String(jtv) } case "AlternateBandOddColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.AlternateBandOddColor = ptr.String(jtv) } case "AxesRangeScale": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RadarChartAxesRangeScale to be of type string, got %T instead", value) } sv.AxesRangeScale = types.RadarChartAxesRangeScale(jtv) } case "BaseSeriesSettings": if err := awsRestjson1_deserializeDocumentRadarChartSeriesSettings(&sv.BaseSeriesSettings, value); err != nil { return err } case "CategoryAxis": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.CategoryAxis, value); err != nil { return err } case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "ColorAxis": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.ColorAxis, value); err != nil { return err } case "ColorLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ColorLabelOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentRadarChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "Shape": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RadarChartShape to be of type string, got %T instead", value) } sv.Shape = types.RadarChartShape(jtv) } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentRadarChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "StartAngle": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartAngle = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.StartAngle = ptr.Float64(f64) default: return fmt.Errorf("expected RadarChartStartAngle to be a JSON Number, got %T instead", value) } } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartFieldWells(v **types.RadarChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartFieldWells if *v == nil { sv = &types.RadarChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "RadarChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentRadarChartAggregatedFieldWells(&sv.RadarChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartSeriesSettings(v **types.RadarChartSeriesSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartSeriesSettings if *v == nil { sv = &types.RadarChartSeriesSettings{} } else { sv = *v } for key, value := range shape { switch key { case "AreaStyleSettings": if err := awsRestjson1_deserializeDocumentRadarChartAreaStyleSettings(&sv.AreaStyleSettings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartSortConfiguration(v **types.RadarChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartSortConfiguration if *v == nil { sv = &types.RadarChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } case "ColorItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.ColorItemsLimit, value); err != nil { return err } case "ColorSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.ColorSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRadarChartValuesFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRadarChartVisual(v **types.RadarChartVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RadarChartVisual if *v == nil { sv = &types.RadarChartVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentRadarChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRangeConstant(v **types.RangeConstant, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RangeConstant if *v == nil { sv = &types.RangeConstant{} } else { sv = *v } for key, value := range shape { switch key { case "Maximum": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Maximum = ptr.String(jtv) } case "Minimum": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Minimum = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRangeEndsLabelType(v **types.RangeEndsLabelType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RangeEndsLabelType if *v == nil { sv = &types.RangeEndsLabelType{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRdsParameters(v **types.RdsParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RdsParameters if *v == nil { sv = &types.RdsParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "InstanceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) } sv.InstanceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRedshiftParameters(v **types.RedshiftParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RedshiftParameters if *v == nil { sv = &types.RedshiftParameters{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterId to be of type string, got %T instead", value) } sv.ClusterId = ptr.String(jtv) } case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected OptionalPort to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLine(v **types.ReferenceLine, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLine if *v == nil { sv = &types.ReferenceLine{} } else { sv = *v } for key, value := range shape { switch key { case "DataConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineDataConfiguration(&sv.DataConfiguration, value); err != nil { return err } case "LabelConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineLabelConfiguration(&sv.LabelConfiguration, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WidgetStatus to be of type string, got %T instead", value) } sv.Status = types.WidgetStatus(jtv) } case "StyleConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineStyleConfiguration(&sv.StyleConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineCustomLabelConfiguration(v **types.ReferenceLineCustomLabelConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineCustomLabelConfiguration if *v == nil { sv = &types.ReferenceLineCustomLabelConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineDataConfiguration(v **types.ReferenceLineDataConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineDataConfiguration if *v == nil { sv = &types.ReferenceLineDataConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AxisBinding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AxisBinding to be of type string, got %T instead", value) } sv.AxisBinding = types.AxisBinding(jtv) } case "DynamicConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineDynamicDataConfiguration(&sv.DynamicConfiguration, value); err != nil { return err } case "StaticConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineStaticDataConfiguration(&sv.StaticConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineDynamicDataConfiguration(v **types.ReferenceLineDynamicDataConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineDynamicDataConfiguration if *v == nil { sv = &types.ReferenceLineDynamicDataConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Calculation": if err := awsRestjson1_deserializeDocumentNumericalAggregationFunction(&sv.Calculation, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "MeasureAggregationFunction": if err := awsRestjson1_deserializeDocumentAggregationFunction(&sv.MeasureAggregationFunction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineLabelConfiguration(v **types.ReferenceLineLabelConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineLabelConfiguration if *v == nil { sv = &types.ReferenceLineLabelConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabelConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineCustomLabelConfiguration(&sv.CustomLabelConfiguration, value); err != nil { return err } case "FontColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.FontColor = ptr.String(jtv) } case "FontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.FontConfiguration, value); err != nil { return err } case "HorizontalPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReferenceLineLabelHorizontalPosition to be of type string, got %T instead", value) } sv.HorizontalPosition = types.ReferenceLineLabelHorizontalPosition(jtv) } case "ValueLabelConfiguration": if err := awsRestjson1_deserializeDocumentReferenceLineValueLabelConfiguration(&sv.ValueLabelConfiguration, value); err != nil { return err } case "VerticalPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReferenceLineLabelVerticalPosition to be of type string, got %T instead", value) } sv.VerticalPosition = types.ReferenceLineLabelVerticalPosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineList(v *[]types.ReferenceLine, 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.ReferenceLine if *v == nil { cv = []types.ReferenceLine{} } else { cv = *v } for _, value := range shape { var col types.ReferenceLine destAddr := &col if err := awsRestjson1_deserializeDocumentReferenceLine(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentReferenceLineStaticDataConfiguration(v **types.ReferenceLineStaticDataConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineStaticDataConfiguration if *v == nil { sv = &types.ReferenceLineStaticDataConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Value = f64 default: return fmt.Errorf("expected SensitiveDouble to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineStyleConfiguration(v **types.ReferenceLineStyleConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineStyleConfiguration if *v == nil { sv = &types.ReferenceLineStyleConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "Pattern": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReferenceLinePatternType to be of type string, got %T instead", value) } sv.Pattern = types.ReferenceLinePatternType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentReferenceLineValueLabelConfiguration(v **types.ReferenceLineValueLabelConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReferenceLineValueLabelConfiguration if *v == nil { sv = &types.ReferenceLineValueLabelConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentNumericFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } case "RelativePosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReferenceLineValueLabelRelativePosition to be of type string, got %T instead", value) } sv.RelativePosition = types.ReferenceLineValueLabelRelativePosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRefreshConfiguration(v **types.RefreshConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RefreshConfiguration if *v == nil { sv = &types.RefreshConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "IncrementalRefresh": if err := awsRestjson1_deserializeDocumentIncrementalRefresh(&sv.IncrementalRefresh, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRefreshFrequency(v **types.RefreshFrequency, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RefreshFrequency if *v == nil { sv = &types.RefreshFrequency{} } else { sv = *v } for key, value := range shape { switch key { case "Interval": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RefreshInterval to be of type string, got %T instead", value) } sv.Interval = types.RefreshInterval(jtv) } case "RefreshOnDay": if err := awsRestjson1_deserializeDocumentScheduleRefreshOnEntity(&sv.RefreshOnDay, value); err != nil { return err } case "TimeOfTheDay": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.TimeOfTheDay = ptr.String(jtv) } case "Timezone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Timezone = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRefreshSchedule(v **types.RefreshSchedule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RefreshSchedule if *v == nil { sv = &types.RefreshSchedule{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "RefreshType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IngestionType to be of type string, got %T instead", value) } sv.RefreshType = types.IngestionType(jtv) } case "ScheduleFrequency": if err := awsRestjson1_deserializeDocumentRefreshFrequency(&sv.ScheduleFrequency, value); err != nil { return err } case "ScheduleId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScheduleId = ptr.String(jtv) } case "StartAfterDateTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartAfterDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRefreshSchedules(v *[]types.RefreshSchedule, 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.RefreshSchedule if *v == nil { cv = []types.RefreshSchedule{} } else { cv = *v } for _, value := range shape { var col types.RefreshSchedule destAddr := &col if err := awsRestjson1_deserializeDocumentRefreshSchedule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRelationalTable(v **types.RelationalTable, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RelationalTable if *v == nil { sv = &types.RelationalTable{} } else { sv = *v } for key, value := range shape { switch key { case "Catalog": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelationalTableCatalog to be of type string, got %T instead", value) } sv.Catalog = ptr.String(jtv) } case "DataSourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSourceArn = ptr.String(jtv) } case "InputColumns": if err := awsRestjson1_deserializeDocumentInputColumnList(&sv.InputColumns, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelationalTableName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Schema": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelationalTableSchema to be of type string, got %T instead", value) } sv.Schema = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRelativeDatesFilter(v **types.RelativeDatesFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RelativeDatesFilter if *v == nil { sv = &types.RelativeDatesFilter{} } else { sv = *v } for key, value := range shape { switch key { case "AnchorDateConfiguration": if err := awsRestjson1_deserializeDocumentAnchorDateConfiguration(&sv.AnchorDateConfiguration, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "ExcludePeriodConfiguration": if err := awsRestjson1_deserializeDocumentExcludePeriodConfiguration(&sv.ExcludePeriodConfiguration, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } case "MinimumGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.MinimumGranularity = types.TimeGranularity(jtv) } case "NullOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterNullOption to be of type string, got %T instead", value) } sv.NullOption = types.FilterNullOption(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "RelativeDateType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelativeDateType to be of type string, got %T instead", value) } sv.RelativeDateType = types.RelativeDateType(jtv) } case "RelativeDateValue": 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.RelativeDateValue = ptr.Int32(int32(i64)) } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRelativeDateTimeControlDisplayOptions(v **types.RelativeDateTimeControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RelativeDateTimeControlDisplayOptions if *v == nil { sv = &types.RelativeDateTimeControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "DateTimeFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DateTimeFormat to be of type string, got %T instead", value) } sv.DateTimeFormat = ptr.String(jtv) } case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRenameColumnOperation(v **types.RenameColumnOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RenameColumnOperation if *v == nil { sv = &types.RenameColumnOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "NewColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.NewColumnName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceExistsException(v **types.ResourceExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourceExistsException if *v == nil { sv = &types.ResourceExistsException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.ExceptionResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.ExceptionResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourcePermission(v **types.ResourcePermission, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourcePermission if *v == nil { sv = &types.ResourcePermission{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentActionList(&sv.Actions, value); err != nil { return err } case "Principal": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Principal to be of type string, got %T instead", value) } sv.Principal = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourcePermissionList(v *[]types.ResourcePermission, 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.ResourcePermission if *v == nil { cv = []types.ResourcePermission{} } else { cv = *v } for _, value := range shape { var col types.ResourcePermission destAddr := &col if err := awsRestjson1_deserializeDocumentResourcePermission(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceUnavailableException(v **types.ResourceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ResourceUnavailableException if *v == nil { sv = &types.ResourceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.ExceptionResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRollingDateConfiguration(v **types.RollingDateConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RollingDateConfiguration if *v == nil { sv = &types.RollingDateConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DataSetIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetIdentifier to be of type string, got %T instead", value) } sv.DataSetIdentifier = ptr.String(jtv) } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRowAlternateColorList(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 HexColor to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRowAlternateColorOptions(v **types.RowAlternateColorOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RowAlternateColorOptions if *v == nil { sv = &types.RowAlternateColorOptions{} } else { sv = *v } for key, value := range shape { switch key { case "RowAlternateColors": if err := awsRestjson1_deserializeDocumentRowAlternateColorList(&sv.RowAlternateColors, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WidgetStatus to be of type string, got %T instead", value) } sv.Status = types.WidgetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRowInfo(v **types.RowInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RowInfo if *v == nil { sv = &types.RowInfo{} } else { sv = *v } for key, value := range shape { switch key { case "RowsDropped": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowsDropped = ptr.Int64(i64) } case "RowsIngested": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RowsIngested = ptr.Int64(i64) } case "TotalRowsInDataset": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalRowsInDataset = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRowLevelPermissionDataSet(v **types.RowLevelPermissionDataSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RowLevelPermissionDataSet if *v == nil { sv = &types.RowLevelPermissionDataSet{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "FormatVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RowLevelPermissionFormatVersion to be of type string, got %T instead", value) } sv.FormatVersion = types.RowLevelPermissionFormatVersion(jtv) } case "Namespace": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Namespace to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } case "PermissionPolicy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RowLevelPermissionPolicy to be of type string, got %T instead", value) } sv.PermissionPolicy = types.RowLevelPermissionPolicy(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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRowLevelPermissionTagConfiguration(v **types.RowLevelPermissionTagConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RowLevelPermissionTagConfiguration if *v == nil { sv = &types.RowLevelPermissionTagConfiguration{} } else { sv = *v } for key, value := range shape { switch key { 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 "TagRuleConfigurations": if err := awsRestjson1_deserializeDocumentRowLevelPermissionTagRuleConfigurationList(&sv.TagRuleConfigurations, value); err != nil { return err } case "TagRules": if err := awsRestjson1_deserializeDocumentRowLevelPermissionTagRuleList(&sv.TagRules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRowLevelPermissionTagRule(v **types.RowLevelPermissionTagRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.RowLevelPermissionTagRule if *v == nil { sv = &types.RowLevelPermissionTagRule{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "MatchAllValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SessionTagValue to be of type string, got %T instead", value) } sv.MatchAllValue = ptr.String(jtv) } case "TagKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SessionTagKey to be of type string, got %T instead", value) } sv.TagKey = ptr.String(jtv) } case "TagMultiValueDelimiter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RowLevelPermissionTagDelimiter to be of type string, got %T instead", value) } sv.TagMultiValueDelimiter = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRowLevelPermissionTagRuleConfiguration(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 SessionTagKey to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRowLevelPermissionTagRuleConfigurationList(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 err := awsRestjson1_deserializeDocumentRowLevelPermissionTagRuleConfiguration(&col, value); err != nil { return err } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRowLevelPermissionTagRuleList(v *[]types.RowLevelPermissionTagRule, 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.RowLevelPermissionTagRule if *v == nil { cv = []types.RowLevelPermissionTagRule{} } else { cv = *v } for _, value := range shape { var col types.RowLevelPermissionTagRule destAddr := &col if err := awsRestjson1_deserializeDocumentRowLevelPermissionTagRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRowSortList(v *[]types.FieldSortOptions, 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.FieldSortOptions if *v == nil { cv = []types.FieldSortOptions{} } else { cv = *v } for _, value := range shape { var col types.FieldSortOptions destAddr := &col if err := awsRestjson1_deserializeDocumentFieldSortOptions(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentS3BucketConfiguration(v **types.S3BucketConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3BucketConfiguration if *v == nil { sv = &types.S3BucketConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BucketName = ptr.String(jtv) } case "BucketPrefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BucketPrefix = ptr.String(jtv) } case "BucketRegion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.BucketRegion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3Parameters(v **types.S3Parameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3Parameters if *v == nil { sv = &types.S3Parameters{} } else { sv = *v } for key, value := range shape { switch key { case "ManifestFileLocation": if err := awsRestjson1_deserializeDocumentManifestFileLocation(&sv.ManifestFileLocation, value); err != nil { return err } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3Source(v **types.S3Source, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3Source if *v == nil { sv = &types.S3Source{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DataSourceArn = ptr.String(jtv) } case "InputColumns": if err := awsRestjson1_deserializeDocumentInputColumnList(&sv.InputColumns, value); err != nil { return err } case "UploadSettings": if err := awsRestjson1_deserializeDocumentUploadSettings(&sv.UploadSettings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSameSheetTargetVisualConfiguration(v **types.SameSheetTargetVisualConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SameSheetTargetVisualConfiguration if *v == nil { sv = &types.SameSheetTargetVisualConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TargetVisualOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TargetVisualOptions to be of type string, got %T instead", value) } sv.TargetVisualOptions = types.TargetVisualOptions(jtv) } case "TargetVisuals": if err := awsRestjson1_deserializeDocumentTargetVisualList(&sv.TargetVisuals, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSankeyDiagramAggregatedFieldWells(v **types.SankeyDiagramAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SankeyDiagramAggregatedFieldWells if *v == nil { sv = &types.SankeyDiagramAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Destination, value); err != nil { return err } case "Source": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Source, value); err != nil { return err } case "Weight": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Weight, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSankeyDiagramChartConfiguration(v **types.SankeyDiagramChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SankeyDiagramChartConfiguration if *v == nil { sv = &types.SankeyDiagramChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentSankeyDiagramFieldWells(&sv.FieldWells, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentSankeyDiagramSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSankeyDiagramFieldWells(v **types.SankeyDiagramFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SankeyDiagramFieldWells if *v == nil { sv = &types.SankeyDiagramFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "SankeyDiagramAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentSankeyDiagramAggregatedFieldWells(&sv.SankeyDiagramAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSankeyDiagramSortConfiguration(v **types.SankeyDiagramSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SankeyDiagramSortConfiguration if *v == nil { sv = &types.SankeyDiagramSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.DestinationItemsLimit, value); err != nil { return err } case "SourceItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.SourceItemsLimit, value); err != nil { return err } case "WeightSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.WeightSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSankeyDiagramVisual(v **types.SankeyDiagramVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SankeyDiagramVisual if *v == nil { sv = &types.SankeyDiagramVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentSankeyDiagramChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScatterPlotCategoricallyAggregatedFieldWells(v **types.ScatterPlotCategoricallyAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScatterPlotCategoricallyAggregatedFieldWells if *v == nil { sv = &types.ScatterPlotCategoricallyAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Category, value); err != nil { return err } case "Label": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Label, value); err != nil { return err } case "Size": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Size, value); err != nil { return err } case "XAxis": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.XAxis, value); err != nil { return err } case "YAxis": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.YAxis, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScatterPlotConfiguration(v **types.ScatterPlotConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScatterPlotConfiguration if *v == nil { sv = &types.ScatterPlotConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentScatterPlotFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } case "XAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.XAxisDisplayOptions, value); err != nil { return err } case "XAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.XAxisLabelOptions, value); err != nil { return err } case "YAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.YAxisDisplayOptions, value); err != nil { return err } case "YAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.YAxisLabelOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScatterPlotFieldWells(v **types.ScatterPlotFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScatterPlotFieldWells if *v == nil { sv = &types.ScatterPlotFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "ScatterPlotCategoricallyAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentScatterPlotCategoricallyAggregatedFieldWells(&sv.ScatterPlotCategoricallyAggregatedFieldWells, value); err != nil { return err } case "ScatterPlotUnaggregatedFieldWells": if err := awsRestjson1_deserializeDocumentScatterPlotUnaggregatedFieldWells(&sv.ScatterPlotUnaggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScatterPlotUnaggregatedFieldWells(v **types.ScatterPlotUnaggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScatterPlotUnaggregatedFieldWells if *v == nil { sv = &types.ScatterPlotUnaggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Category, value); err != nil { return err } case "Label": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Label, value); err != nil { return err } case "Size": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Size, value); err != nil { return err } case "XAxis": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.XAxis, value); err != nil { return err } case "YAxis": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.YAxis, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScatterPlotVisual(v **types.ScatterPlotVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScatterPlotVisual if *v == nil { sv = &types.ScatterPlotVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentScatterPlotConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScheduleRefreshOnEntity(v **types.ScheduleRefreshOnEntity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScheduleRefreshOnEntity if *v == nil { sv = &types.ScheduleRefreshOnEntity{} } else { sv = *v } for key, value := range shape { switch key { case "DayOfMonth": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DayOfMonth to be of type string, got %T instead", value) } sv.DayOfMonth = ptr.String(jtv) } case "DayOfWeek": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DayOfWeek to be of type string, got %T instead", value) } sv.DayOfWeek = types.DayOfWeek(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScrollBarOptions(v **types.ScrollBarOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ScrollBarOptions if *v == nil { sv = &types.ScrollBarOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } case "VisibleRange": if err := awsRestjson1_deserializeDocumentVisibleRangeOptions(&sv.VisibleRange, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecondaryValueOptions(v **types.SecondaryValueOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SecondaryValueOptions if *v == nil { sv = &types.SecondaryValueOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionAfterPageBreak(v **types.SectionAfterPageBreak, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionAfterPageBreak if *v == nil { sv = &types.SectionAfterPageBreak{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SectionPageBreakStatus to be of type string, got %T instead", value) } sv.Status = types.SectionPageBreakStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionBasedLayoutCanvasSizeOptions(v **types.SectionBasedLayoutCanvasSizeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionBasedLayoutCanvasSizeOptions if *v == nil { sv = &types.SectionBasedLayoutCanvasSizeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "PaperCanvasSizeOptions": if err := awsRestjson1_deserializeDocumentSectionBasedLayoutPaperCanvasSizeOptions(&sv.PaperCanvasSizeOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionBasedLayoutConfiguration(v **types.SectionBasedLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionBasedLayoutConfiguration if *v == nil { sv = &types.SectionBasedLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BodySections": if err := awsRestjson1_deserializeDocumentBodySectionConfigurationList(&sv.BodySections, value); err != nil { return err } case "CanvasSizeOptions": if err := awsRestjson1_deserializeDocumentSectionBasedLayoutCanvasSizeOptions(&sv.CanvasSizeOptions, value); err != nil { return err } case "FooterSections": if err := awsRestjson1_deserializeDocumentHeaderFooterSectionConfigurationList(&sv.FooterSections, value); err != nil { return err } case "HeaderSections": if err := awsRestjson1_deserializeDocumentHeaderFooterSectionConfigurationList(&sv.HeaderSections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionBasedLayoutPaperCanvasSizeOptions(v **types.SectionBasedLayoutPaperCanvasSizeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionBasedLayoutPaperCanvasSizeOptions if *v == nil { sv = &types.SectionBasedLayoutPaperCanvasSizeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "PaperMargin": if err := awsRestjson1_deserializeDocumentSpacing(&sv.PaperMargin, value); err != nil { return err } case "PaperOrientation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaperOrientation to be of type string, got %T instead", value) } sv.PaperOrientation = types.PaperOrientation(jtv) } case "PaperSize": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaperSize to be of type string, got %T instead", value) } sv.PaperSize = types.PaperSize(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionLayoutConfiguration(v **types.SectionLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionLayoutConfiguration if *v == nil { sv = &types.SectionLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FreeFormLayout": if err := awsRestjson1_deserializeDocumentFreeFormSectionLayoutConfiguration(&sv.FreeFormLayout, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionPageBreakConfiguration(v **types.SectionPageBreakConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionPageBreakConfiguration if *v == nil { sv = &types.SectionPageBreakConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "After": if err := awsRestjson1_deserializeDocumentSectionAfterPageBreak(&sv.After, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSectionStyle(v **types.SectionStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SectionStyle if *v == nil { sv = &types.SectionStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Height": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Height = ptr.String(jtv) } case "Padding": if err := awsRestjson1_deserializeDocumentSpacing(&sv.Padding, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroupIdList(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 SecurityGroupId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSelectedFieldList(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 FieldId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSelectedSheetsFilterScopeConfiguration(v **types.SelectedSheetsFilterScopeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SelectedSheetsFilterScopeConfiguration if *v == nil { sv = &types.SelectedSheetsFilterScopeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SheetVisualScopingConfigurations": if err := awsRestjson1_deserializeDocumentSheetVisualScopingConfigurations(&sv.SheetVisualScopingConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSemanticEntityType(v **types.SemanticEntityType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SemanticEntityType if *v == nil { sv = &types.SemanticEntityType{} } else { sv = *v } for key, value := range shape { switch key { case "SubTypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.SubTypeName = ptr.String(jtv) } case "TypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.TypeName = ptr.String(jtv) } case "TypeParameters": if err := awsRestjson1_deserializeDocumentTypeParameters(&sv.TypeParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSemanticType(v **types.SemanticType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SemanticType if *v == nil { sv = &types.SemanticType{} } else { sv = *v } for key, value := range shape { switch key { case "FalseyCellValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) } sv.FalseyCellValue = ptr.String(jtv) } case "FalseyCellValueSynonyms": if err := awsRestjson1_deserializeDocumentSensitiveStringList(&sv.FalseyCellValueSynonyms, value); err != nil { return err } case "SubTypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.SubTypeName = ptr.String(jtv) } case "TruthyCellValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) } sv.TruthyCellValue = ptr.String(jtv) } case "TruthyCellValueSynonyms": if err := awsRestjson1_deserializeDocumentSensitiveStringList(&sv.TruthyCellValueSynonyms, value); err != nil { return err } case "TypeName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.TypeName = ptr.String(jtv) } case "TypeParameters": if err := awsRestjson1_deserializeDocumentTypeParameters(&sv.TypeParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSensitiveDoubleList(v *[]float64, 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 []float64 if *v == nil { cv = []float64{} } else { cv = *v } for _, value := range shape { var col float64 if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } col = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } col = f64 default: return fmt.Errorf("expected SensitiveDouble to be a JSON Number, got %T instead", value) } } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSensitiveLongList(v *[]int64, 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 []int64 if *v == nil { cv = []int64{} } else { cv = *v } for _, value := range shape { var col int64 if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SensitiveLong to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } col = i64 } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSensitiveStringList(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 SensitiveString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSensitiveTimestampList(v *[]time.Time, 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 []time.Time if *v == nil { cv = []time.Time{} } else { cv = *v } for _, value := range shape { var col time.Time if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } col = smithytime.ParseEpochSeconds(f64) default: return fmt.Errorf("expected SensitiveTimestamp to be a JSON Number, got %T instead", value) } } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSeriesItem(v **types.SeriesItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SeriesItem if *v == nil { sv = &types.SeriesItem{} } else { sv = *v } for key, value := range shape { switch key { case "DataFieldSeriesItem": if err := awsRestjson1_deserializeDocumentDataFieldSeriesItem(&sv.DataFieldSeriesItem, value); err != nil { return err } case "FieldSeriesItem": if err := awsRestjson1_deserializeDocumentFieldSeriesItem(&sv.FieldSeriesItem, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSeriesItemList(v *[]types.SeriesItem, 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.SeriesItem if *v == nil { cv = []types.SeriesItem{} } else { cv = *v } for _, value := range shape { var col types.SeriesItem destAddr := &col if err := awsRestjson1_deserializeDocumentSeriesItem(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentServiceNowParameters(v **types.ServiceNowParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServiceNowParameters if *v == nil { sv = &types.ServiceNowParameters{} } else { sv = *v } for key, value := range shape { switch key { case "SiteBaseUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SiteBaseUrl to be of type string, got %T instead", value) } sv.SiteBaseUrl = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSessionLifetimeInMinutesInvalidException(v **types.SessionLifetimeInMinutesInvalidException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SessionLifetimeInMinutesInvalidException if *v == nil { sv = &types.SessionLifetimeInMinutesInvalidException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSessionTagKeyList(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 SessionTagKey to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSetParameterValueConfiguration(v **types.SetParameterValueConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SetParameterValueConfiguration if *v == nil { sv = &types.SetParameterValueConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.DestinationParameterName = ptr.String(jtv) } case "Value": if err := awsRestjson1_deserializeDocumentDestinationParameterValueConfiguration(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSetParameterValueConfigurationList(v *[]types.SetParameterValueConfiguration, 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.SetParameterValueConfiguration if *v == nil { cv = []types.SetParameterValueConfiguration{} } else { cv = *v } for _, value := range shape { var col types.SetParameterValueConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentSetParameterValueConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentShapeConditionalFormat(v **types.ShapeConditionalFormat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ShapeConditionalFormat if *v == nil { sv = &types.ShapeConditionalFormat{} } else { sv = *v } for key, value := range shape { switch key { case "BackgroundColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.BackgroundColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheet(v **types.Sheet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Sheet if *v == nil { sv = &types.Sheet{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "SheetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SheetId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(v **types.SheetControlInfoIconLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetControlInfoIconLabelOptions if *v == nil { sv = &types.SheetControlInfoIconLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "InfoIconText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetControlInfoIconText to be of type string, got %T instead", value) } sv.InfoIconText = ptr.String(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetControlLayout(v **types.SheetControlLayout, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetControlLayout if *v == nil { sv = &types.SheetControlLayout{} } else { sv = *v } for key, value := range shape { switch key { case "Configuration": if err := awsRestjson1_deserializeDocumentSheetControlLayoutConfiguration(&sv.Configuration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetControlLayoutConfiguration(v **types.SheetControlLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetControlLayoutConfiguration if *v == nil { sv = &types.SheetControlLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "GridLayout": if err := awsRestjson1_deserializeDocumentGridLayoutConfiguration(&sv.GridLayout, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetControlLayoutList(v *[]types.SheetControlLayout, 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.SheetControlLayout if *v == nil { cv = []types.SheetControlLayout{} } else { cv = *v } for _, value := range shape { var col types.SheetControlLayout destAddr := &col if err := awsRestjson1_deserializeDocumentSheetControlLayout(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSheetControlsOption(v **types.SheetControlsOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetControlsOption if *v == nil { sv = &types.SheetControlsOption{} } else { sv = *v } for key, value := range shape { switch key { case "VisibilityState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardUIState to be of type string, got %T instead", value) } sv.VisibilityState = types.DashboardUIState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetDefinition(v **types.SheetDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetDefinition if *v == nil { sv = &types.SheetDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "ContentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetContentType to be of type string, got %T instead", value) } sv.ContentType = types.SheetContentType(jtv) } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "FilterControls": if err := awsRestjson1_deserializeDocumentFilterControlList(&sv.FilterControls, value); err != nil { return err } case "Layouts": if err := awsRestjson1_deserializeDocumentLayoutList(&sv.Layouts, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ParameterControls": if err := awsRestjson1_deserializeDocumentParameterControlList(&sv.ParameterControls, value); err != nil { return err } case "SheetControlLayouts": if err := awsRestjson1_deserializeDocumentSheetControlLayoutList(&sv.SheetControlLayouts, value); err != nil { return err } case "SheetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SheetId = ptr.String(jtv) } case "TextBoxes": if err := awsRestjson1_deserializeDocumentSheetTextBoxList(&sv.TextBoxes, value); err != nil { return err } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetTitle to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } case "Visuals": if err := awsRestjson1_deserializeDocumentVisualList(&sv.Visuals, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetDefinitionList(v *[]types.SheetDefinition, 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.SheetDefinition if *v == nil { cv = []types.SheetDefinition{} } else { cv = *v } for _, value := range shape { var col types.SheetDefinition destAddr := &col if err := awsRestjson1_deserializeDocumentSheetDefinition(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSheetElementConfigurationOverrides(v **types.SheetElementConfigurationOverrides, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetElementConfigurationOverrides if *v == nil { sv = &types.SheetElementConfigurationOverrides{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetElementRenderingRule(v **types.SheetElementRenderingRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetElementRenderingRule if *v == nil { sv = &types.SheetElementRenderingRule{} } else { sv = *v } for key, value := range shape { switch key { case "ConfigurationOverrides": if err := awsRestjson1_deserializeDocumentSheetElementConfigurationOverrides(&sv.ConfigurationOverrides, value); err != nil { return err } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetElementRenderingRuleList(v *[]types.SheetElementRenderingRule, 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.SheetElementRenderingRule if *v == nil { cv = []types.SheetElementRenderingRule{} } else { cv = *v } for _, value := range shape { var col types.SheetElementRenderingRule destAddr := &col if err := awsRestjson1_deserializeDocumentSheetElementRenderingRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSheetLayoutElementMaximizationOption(v **types.SheetLayoutElementMaximizationOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetLayoutElementMaximizationOption if *v == nil { sv = &types.SheetLayoutElementMaximizationOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetList(v *[]types.Sheet, 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.Sheet if *v == nil { cv = []types.Sheet{} } else { cv = *v } for _, value := range shape { var col types.Sheet destAddr := &col if err := awsRestjson1_deserializeDocumentSheet(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSheetStyle(v **types.SheetStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetStyle if *v == nil { sv = &types.SheetStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Tile": if err := awsRestjson1_deserializeDocumentTileStyle(&sv.Tile, value); err != nil { return err } case "TileLayout": if err := awsRestjson1_deserializeDocumentTileLayoutStyle(&sv.TileLayout, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetTextBox(v **types.SheetTextBox, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetTextBox if *v == nil { sv = &types.SheetTextBox{} } else { sv = *v } for key, value := range shape { switch key { case "Content": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SheetTextBoxContent to be of type string, got %T instead", value) } sv.Content = ptr.String(jtv) } case "SheetTextBoxId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SheetTextBoxId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetTextBoxList(v *[]types.SheetTextBox, 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.SheetTextBox if *v == nil { cv = []types.SheetTextBox{} } else { cv = *v } for _, value := range shape { var col types.SheetTextBox destAddr := &col if err := awsRestjson1_deserializeDocumentSheetTextBox(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSheetVisualScopingConfiguration(v **types.SheetVisualScopingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SheetVisualScopingConfiguration if *v == nil { sv = &types.SheetVisualScopingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Scope": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterVisualScope to be of type string, got %T instead", value) } sv.Scope = types.FilterVisualScope(jtv) } case "SheetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SheetId = ptr.String(jtv) } case "VisualIds": if err := awsRestjson1_deserializeDocumentFilteredVisualsList(&sv.VisualIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSheetVisualScopingConfigurations(v *[]types.SheetVisualScopingConfiguration, 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.SheetVisualScopingConfiguration if *v == nil { cv = []types.SheetVisualScopingConfiguration{} } else { cv = *v } for _, value := range shape { var col types.SheetVisualScopingConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentSheetVisualScopingConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentShortFormatText(v **types.ShortFormatText, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ShortFormatText if *v == nil { sv = &types.ShortFormatText{} } else { sv = *v } for key, value := range shape { switch key { case "PlainText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortPlainText to be of type string, got %T instead", value) } sv.PlainText = ptr.String(jtv) } case "RichText": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRichText to be of type string, got %T instead", value) } sv.RichText = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSignupResponse(v **types.SignupResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SignupResponse if *v == nil { sv = &types.SignupResponse{} } else { sv = *v } for key, value := range shape { switch key { case "accountName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AccountName = ptr.String(jtv) } case "directoryType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DirectoryType = ptr.String(jtv) } case "IAMUser": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IAMUser = jtv } case "userLoginName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.UserLoginName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimpleClusterMarker(v **types.SimpleClusterMarker, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SimpleClusterMarker if *v == nil { sv = &types.SimpleClusterMarker{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSliderControlDisplayOptions(v **types.SliderControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SliderControlDisplayOptions if *v == nil { sv = &types.SliderControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSmallMultiplesAxisProperties(v **types.SmallMultiplesAxisProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SmallMultiplesAxisProperties if *v == nil { sv = &types.SmallMultiplesAxisProperties{} } else { sv = *v } for key, value := range shape { switch key { case "Placement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallMultiplesAxisPlacement to be of type string, got %T instead", value) } sv.Placement = types.SmallMultiplesAxisPlacement(jtv) } case "Scale": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SmallMultiplesAxisScale to be of type string, got %T instead", value) } sv.Scale = types.SmallMultiplesAxisScale(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSmallMultiplesDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSmallMultiplesOptions(v **types.SmallMultiplesOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SmallMultiplesOptions if *v == nil { sv = &types.SmallMultiplesOptions{} } else { sv = *v } for key, value := range shape { switch key { case "MaxVisibleColumns": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VisiblePanelColumns to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxVisibleColumns = ptr.Int64(i64) } case "MaxVisibleRows": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VisiblePanelRows to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxVisibleRows = ptr.Int64(i64) } case "PanelConfiguration": if err := awsRestjson1_deserializeDocumentPanelConfiguration(&sv.PanelConfiguration, value); err != nil { return err } case "XAxis": if err := awsRestjson1_deserializeDocumentSmallMultiplesAxisProperties(&sv.XAxis, value); err != nil { return err } case "YAxis": if err := awsRestjson1_deserializeDocumentSmallMultiplesAxisProperties(&sv.YAxis, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotAnonymousUserRedacted(v **types.SnapshotAnonymousUserRedacted, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotAnonymousUserRedacted if *v == nil { sv = &types.SnapshotAnonymousUserRedacted{} } else { sv = *v } for key, value := range shape { switch key { case "RowLevelPermissionTagKeys": if err := awsRestjson1_deserializeDocumentSessionTagKeyList(&sv.RowLevelPermissionTagKeys, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotAnonymousUserRedactedList(v *[]types.SnapshotAnonymousUserRedacted, 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.SnapshotAnonymousUserRedacted if *v == nil { cv = []types.SnapshotAnonymousUserRedacted{} } else { cv = *v } for _, value := range shape { var col types.SnapshotAnonymousUserRedacted destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotAnonymousUserRedacted(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotConfiguration(v **types.SnapshotConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotConfiguration if *v == nil { sv = &types.SnapshotConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DestinationConfiguration": if err := awsRestjson1_deserializeDocumentSnapshotDestinationConfiguration(&sv.DestinationConfiguration, value); err != nil { return err } case "FileGroups": if err := awsRestjson1_deserializeDocumentSnapshotFileGroupList(&sv.FileGroups, value); err != nil { return err } case "Parameters": if err := awsRestjson1_deserializeDocumentParameters(&sv.Parameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotDestinationConfiguration(v **types.SnapshotDestinationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotDestinationConfiguration if *v == nil { sv = &types.SnapshotDestinationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "S3Destinations": if err := awsRestjson1_deserializeDocumentSnapshotS3DestinationConfigurationList(&sv.S3Destinations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotFile(v **types.SnapshotFile, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotFile if *v == nil { sv = &types.SnapshotFile{} } else { sv = *v } for key, value := range shape { switch key { case "FormatType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SnapshotFileFormatType to be of type string, got %T instead", value) } sv.FormatType = types.SnapshotFileFormatType(jtv) } case "SheetSelections": if err := awsRestjson1_deserializeDocumentSnapshotFileSheetSelectionList(&sv.SheetSelections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotFileGroup(v **types.SnapshotFileGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotFileGroup if *v == nil { sv = &types.SnapshotFileGroup{} } else { sv = *v } for key, value := range shape { switch key { case "Files": if err := awsRestjson1_deserializeDocumentSnapshotFileList(&sv.Files, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotFileGroupList(v *[]types.SnapshotFileGroup, 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.SnapshotFileGroup if *v == nil { cv = []types.SnapshotFileGroup{} } else { cv = *v } for _, value := range shape { var col types.SnapshotFileGroup destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotFileGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotFileList(v *[]types.SnapshotFile, 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.SnapshotFile if *v == nil { cv = []types.SnapshotFile{} } else { cv = *v } for _, value := range shape { var col types.SnapshotFile destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotFile(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotFileSheetSelection(v **types.SnapshotFileSheetSelection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotFileSheetSelection if *v == nil { sv = &types.SnapshotFileSheetSelection{} } else { sv = *v } for key, value := range shape { switch key { case "SelectionScope": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SnapshotFileSheetSelectionScope to be of type string, got %T instead", value) } sv.SelectionScope = types.SnapshotFileSheetSelectionScope(jtv) } case "SheetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.SheetId = ptr.String(jtv) } case "VisualIds": if err := awsRestjson1_deserializeDocumentSnapshotFileSheetSelectionVisualIdList(&sv.VisualIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotFileSheetSelectionList(v *[]types.SnapshotFileSheetSelection, 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.SnapshotFileSheetSelection if *v == nil { cv = []types.SnapshotFileSheetSelection{} } else { cv = *v } for _, value := range shape { var col types.SnapshotFileSheetSelection destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotFileSheetSelection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotFileSheetSelectionVisualIdList(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 ShortRestrictiveResourceId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotJobErrorInfo(v **types.SnapshotJobErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotJobErrorInfo if *v == nil { sv = &types.SnapshotJobErrorInfo{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "ErrorType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotJobResult(v **types.SnapshotJobResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotJobResult if *v == nil { sv = &types.SnapshotJobResult{} } else { sv = *v } for key, value := range shape { switch key { case "AnonymousUsers": if err := awsRestjson1_deserializeDocumentAnonymousUserSnapshotJobResultList(&sv.AnonymousUsers, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotJobResultErrorInfo(v **types.SnapshotJobResultErrorInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotJobResultErrorInfo if *v == nil { sv = &types.SnapshotJobResultErrorInfo{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "ErrorType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotJobResultErrorInfoList(v *[]types.SnapshotJobResultErrorInfo, 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.SnapshotJobResultErrorInfo if *v == nil { cv = []types.SnapshotJobResultErrorInfo{} } else { cv = *v } for _, value := range shape { var col types.SnapshotJobResultErrorInfo destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotJobResultErrorInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotJobResultFileGroup(v **types.SnapshotJobResultFileGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotJobResultFileGroup if *v == nil { sv = &types.SnapshotJobResultFileGroup{} } else { sv = *v } for key, value := range shape { switch key { case "Files": if err := awsRestjson1_deserializeDocumentSnapshotFileList(&sv.Files, value); err != nil { return err } case "S3Results": if err := awsRestjson1_deserializeDocumentSnapshotJobS3ResultList(&sv.S3Results, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotJobResultFileGroupList(v *[]types.SnapshotJobResultFileGroup, 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.SnapshotJobResultFileGroup if *v == nil { cv = []types.SnapshotJobResultFileGroup{} } else { cv = *v } for _, value := range shape { var col types.SnapshotJobResultFileGroup destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotJobResultFileGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotJobS3Result(v **types.SnapshotJobS3Result, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotJobS3Result if *v == nil { sv = &types.SnapshotJobS3Result{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorInfo": if err := awsRestjson1_deserializeDocumentSnapshotJobResultErrorInfoList(&sv.ErrorInfo, value); err != nil { return err } case "S3DestinationConfiguration": if err := awsRestjson1_deserializeDocumentSnapshotS3DestinationConfiguration(&sv.S3DestinationConfiguration, value); err != nil { return err } case "S3Uri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SensitiveS3Uri to be of type string, got %T instead", value) } sv.S3Uri = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotJobS3ResultList(v *[]types.SnapshotJobS3Result, 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.SnapshotJobS3Result if *v == nil { cv = []types.SnapshotJobS3Result{} } else { cv = *v } for _, value := range shape { var col types.SnapshotJobS3Result destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotJobS3Result(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotS3DestinationConfiguration(v **types.SnapshotS3DestinationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotS3DestinationConfiguration if *v == nil { sv = &types.SnapshotS3DestinationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BucketConfiguration": if err := awsRestjson1_deserializeDocumentS3BucketConfiguration(&sv.BucketConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnapshotS3DestinationConfigurationList(v *[]types.SnapshotS3DestinationConfiguration, 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.SnapshotS3DestinationConfiguration if *v == nil { cv = []types.SnapshotS3DestinationConfiguration{} } else { cv = *v } for _, value := range shape { var col types.SnapshotS3DestinationConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentSnapshotS3DestinationConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSnapshotUserConfigurationRedacted(v **types.SnapshotUserConfigurationRedacted, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnapshotUserConfigurationRedacted if *v == nil { sv = &types.SnapshotUserConfigurationRedacted{} } else { sv = *v } for key, value := range shape { switch key { case "AnonymousUsers": if err := awsRestjson1_deserializeDocumentSnapshotAnonymousUserRedactedList(&sv.AnonymousUsers, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnowflakeParameters(v **types.SnowflakeParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SnowflakeParameters if *v == nil { sv = &types.SnowflakeParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Warehouse": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Warehouse to be of type string, got %T instead", value) } sv.Warehouse = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSpacing(v **types.Spacing, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Spacing if *v == nil { sv = &types.Spacing{} } else { sv = *v } for key, value := range shape { switch key { case "Bottom": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Length to be of type string, got %T instead", value) } sv.Bottom = ptr.String(jtv) } case "Left": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Length to be of type string, got %T instead", value) } sv.Left = ptr.String(jtv) } case "Right": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Length to be of type string, got %T instead", value) } sv.Right = ptr.String(jtv) } case "Top": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Length to be of type string, got %T instead", value) } sv.Top = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSparkParameters(v **types.SparkParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SparkParameters if *v == nil { sv = &types.SparkParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSqlServerParameters(v **types.SqlServerParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SqlServerParameters if *v == nil { sv = &types.SqlServerParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSslProperties(v **types.SslProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SslProperties if *v == nil { sv = &types.SslProperties{} } else { sv = *v } for key, value := range shape { switch key { case "DisableSsl": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.DisableSsl = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringDatasetParameter(v **types.StringDatasetParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringDatasetParameter if *v == nil { sv = &types.StringDatasetParameter{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentStringDatasetParameterDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "Id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DatasetParameterValueType to be of type string, got %T instead", value) } sv.ValueType = types.DatasetParameterValueType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringDatasetParameterDefaultValues(v **types.StringDatasetParameterDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringDatasetParameterDefaultValues if *v == nil { sv = &types.StringDatasetParameterDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "StaticValues": if err := awsRestjson1_deserializeDocumentStringDatasetParameterValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringDatasetParameterValueList(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 StringDatasetParameterDefaultValue to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringDefaultValueList(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 SensitiveStringObject to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringDefaultValues(v **types.StringDefaultValues, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringDefaultValues if *v == nil { sv = &types.StringDefaultValues{} } else { sv = *v } for key, value := range shape { switch key { case "DynamicValue": if err := awsRestjson1_deserializeDocumentDynamicDefaultValue(&sv.DynamicValue, value); err != nil { return err } case "StaticValues": if err := awsRestjson1_deserializeDocumentStringDefaultValueList(&sv.StaticValues, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringFormatConfiguration(v **types.StringFormatConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringFormatConfiguration if *v == nil { sv = &types.StringFormatConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "NullValueFormatConfiguration": if err := awsRestjson1_deserializeDocumentNullValueFormatConfiguration(&sv.NullValueFormatConfiguration, value); err != nil { return err } case "NumericFormatConfiguration": if err := awsRestjson1_deserializeDocumentNumericFormatConfiguration(&sv.NumericFormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringParameter(v **types.StringParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringParameter if *v == nil { sv = &types.StringParameter{} } else { sv = *v } for key, value := range shape { switch key { case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Values": if err := awsRestjson1_deserializeDocumentSensitiveStringList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringParameterDeclaration(v **types.StringParameterDeclaration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringParameterDeclaration if *v == nil { sv = &types.StringParameterDeclaration{} } else { sv = *v } for key, value := range shape { switch key { case "DefaultValues": if err := awsRestjson1_deserializeDocumentStringDefaultValues(&sv.DefaultValues, value); err != nil { return err } case "MappedDataSetParameters": if err := awsRestjson1_deserializeDocumentMappedDataSetParameters(&sv.MappedDataSetParameters, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ParameterValueType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterValueType to be of type string, got %T instead", value) } sv.ParameterValueType = types.ParameterValueType(jtv) } case "ValueWhenUnset": if err := awsRestjson1_deserializeDocumentStringValueWhenUnsetConfiguration(&sv.ValueWhenUnset, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStringParameterList(v *[]types.StringParameter, 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.StringParameter if *v == nil { cv = []types.StringParameter{} } else { cv = *v } for _, value := range shape { var col types.StringParameter destAddr := &col if err := awsRestjson1_deserializeDocumentStringParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentStringValueWhenUnsetConfiguration(v **types.StringValueWhenUnsetConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.StringValueWhenUnsetConfiguration if *v == nil { sv = &types.StringValueWhenUnsetConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomValue": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) } sv.CustomValue = ptr.String(jtv) } case "ValueWhenUnsetOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValueWhenUnsetOption to be of type string, got %T instead", value) } sv.ValueWhenUnsetOption = types.ValueWhenUnsetOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSubnetIdList(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 SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubtotalOptions(v **types.SubtotalOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SubtotalOptions if *v == nil { sv = &types.SubtotalOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "FieldLevel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PivotTableSubtotalLevel to be of type string, got %T instead", value) } sv.FieldLevel = types.PivotTableSubtotalLevel(jtv) } case "FieldLevelOptions": if err := awsRestjson1_deserializeDocumentPivotTableFieldSubtotalOptionsList(&sv.FieldLevelOptions, value); err != nil { return err } case "MetricHeaderCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.MetricHeaderCellStyle, value); err != nil { return err } case "TotalCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.TotalCellStyle, value); err != nil { return err } case "TotalsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.TotalsVisibility = types.Visibility(jtv) } case "ValueCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.ValueCellStyle, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSynonyms(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 LimitedString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTableAggregatedFieldWells(v **types.TableAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableAggregatedFieldWells if *v == nil { sv = &types.TableAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "GroupBy": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.GroupBy, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableBorderOptions(v **types.TableBorderOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableBorderOptions if *v == nil { sv = &types.TableBorderOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Color": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Color = ptr.String(jtv) } case "Style": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableBorderStyle to be of type string, got %T instead", value) } sv.Style = types.TableBorderStyle(jtv) } case "Thickness": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TableBorderThickness to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Thickness = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableCellConditionalFormatting(v **types.TableCellConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableCellConditionalFormatting if *v == nil { sv = &types.TableCellConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "TextFormat": if err := awsRestjson1_deserializeDocumentTextConditionalFormat(&sv.TextFormat, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableCellImageSizingConfiguration(v **types.TableCellImageSizingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableCellImageSizingConfiguration if *v == nil { sv = &types.TableCellImageSizingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TableCellImageScalingConfiguration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableCellImageScalingConfiguration to be of type string, got %T instead", value) } sv.TableCellImageScalingConfiguration = types.TableCellImageScalingConfiguration(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableCellStyle(v **types.TableCellStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableCellStyle if *v == nil { sv = &types.TableCellStyle{} } else { sv = *v } for key, value := range shape { switch key { case "BackgroundColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.BackgroundColor = ptr.String(jtv) } case "Border": if err := awsRestjson1_deserializeDocumentGlobalTableBorderOptions(&sv.Border, value); err != nil { return err } case "FontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.FontConfiguration, value); err != nil { return err } case "Height": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TableFieldHeight to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Height = ptr.Int32(int32(i64)) } case "HorizontalTextAlignment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HorizontalTextAlignment to be of type string, got %T instead", value) } sv.HorizontalTextAlignment = types.HorizontalTextAlignment(jtv) } case "TextWrap": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TextWrap to be of type string, got %T instead", value) } sv.TextWrap = types.TextWrap(jtv) } case "VerticalTextAlignment": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VerticalTextAlignment to be of type string, got %T instead", value) } sv.VerticalTextAlignment = types.VerticalTextAlignment(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableConditionalFormatting(v **types.TableConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableConditionalFormatting if *v == nil { sv = &types.TableConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "ConditionalFormattingOptions": if err := awsRestjson1_deserializeDocumentTableConditionalFormattingOptionList(&sv.ConditionalFormattingOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableConditionalFormattingOption(v **types.TableConditionalFormattingOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableConditionalFormattingOption if *v == nil { sv = &types.TableConditionalFormattingOption{} } else { sv = *v } for key, value := range shape { switch key { case "Cell": if err := awsRestjson1_deserializeDocumentTableCellConditionalFormatting(&sv.Cell, value); err != nil { return err } case "Row": if err := awsRestjson1_deserializeDocumentTableRowConditionalFormatting(&sv.Row, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableConditionalFormattingOptionList(v *[]types.TableConditionalFormattingOption, 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.TableConditionalFormattingOption if *v == nil { cv = []types.TableConditionalFormattingOption{} } else { cv = *v } for _, value := range shape { var col types.TableConditionalFormattingOption destAddr := &col if err := awsRestjson1_deserializeDocumentTableConditionalFormattingOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTableConfiguration(v **types.TableConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableConfiguration if *v == nil { sv = &types.TableConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FieldOptions": if err := awsRestjson1_deserializeDocumentTableFieldOptions(&sv.FieldOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentTableFieldWells(&sv.FieldWells, value); err != nil { return err } case "PaginatedReportOptions": if err := awsRestjson1_deserializeDocumentTablePaginatedReportOptions(&sv.PaginatedReportOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentTableSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "TableInlineVisualizations": if err := awsRestjson1_deserializeDocumentTableInlineVisualizationList(&sv.TableInlineVisualizations, value); err != nil { return err } case "TableOptions": if err := awsRestjson1_deserializeDocumentTableOptions(&sv.TableOptions, value); err != nil { return err } case "TotalOptions": if err := awsRestjson1_deserializeDocumentTotalOptions(&sv.TotalOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldCustomIconContent(v **types.TableFieldCustomIconContent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldCustomIconContent if *v == nil { sv = &types.TableFieldCustomIconContent{} } else { sv = *v } for key, value := range shape { switch key { case "Icon": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableFieldIconSetType to be of type string, got %T instead", value) } sv.Icon = types.TableFieldIconSetType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldCustomTextContent(v **types.TableFieldCustomTextContent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldCustomTextContent if *v == nil { sv = &types.TableFieldCustomTextContent{} } else { sv = *v } for key, value := range shape { switch key { case "FontConfiguration": if err := awsRestjson1_deserializeDocumentFontConfiguration(&sv.FontConfiguration, value); err != nil { return err } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldImageConfiguration(v **types.TableFieldImageConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldImageConfiguration if *v == nil { sv = &types.TableFieldImageConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SizingOptions": if err := awsRestjson1_deserializeDocumentTableCellImageSizingConfiguration(&sv.SizingOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldLinkConfiguration(v **types.TableFieldLinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldLinkConfiguration if *v == nil { sv = &types.TableFieldLinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Content": if err := awsRestjson1_deserializeDocumentTableFieldLinkContentConfiguration(&sv.Content, value); err != nil { return err } case "Target": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected URLTargetConfiguration to be of type string, got %T instead", value) } sv.Target = types.URLTargetConfiguration(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldLinkContentConfiguration(v **types.TableFieldLinkContentConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldLinkContentConfiguration if *v == nil { sv = &types.TableFieldLinkContentConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CustomIconContent": if err := awsRestjson1_deserializeDocumentTableFieldCustomIconContent(&sv.CustomIconContent, value); err != nil { return err } case "CustomTextContent": if err := awsRestjson1_deserializeDocumentTableFieldCustomTextContent(&sv.CustomTextContent, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldOption(v **types.TableFieldOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldOption if *v == nil { sv = &types.TableFieldOption{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomLabel to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "URLStyling": if err := awsRestjson1_deserializeDocumentTableFieldURLConfiguration(&sv.URLStyling, value); err != nil { return err } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } case "Width": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PixelLength to be of type string, got %T instead", value) } sv.Width = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldOptionList(v *[]types.TableFieldOption, 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.TableFieldOption if *v == nil { cv = []types.TableFieldOption{} } else { cv = *v } for _, value := range shape { var col types.TableFieldOption destAddr := &col if err := awsRestjson1_deserializeDocumentTableFieldOption(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTableFieldOptions(v **types.TableFieldOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldOptions if *v == nil { sv = &types.TableFieldOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Order": if err := awsRestjson1_deserializeDocumentFieldOrderList(&sv.Order, value); err != nil { return err } case "SelectedFieldOptions": if err := awsRestjson1_deserializeDocumentTableFieldOptionList(&sv.SelectedFieldOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldURLConfiguration(v **types.TableFieldURLConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldURLConfiguration if *v == nil { sv = &types.TableFieldURLConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ImageConfiguration": if err := awsRestjson1_deserializeDocumentTableFieldImageConfiguration(&sv.ImageConfiguration, value); err != nil { return err } case "LinkConfiguration": if err := awsRestjson1_deserializeDocumentTableFieldLinkConfiguration(&sv.LinkConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableFieldWells(v **types.TableFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableFieldWells if *v == nil { sv = &types.TableFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "TableAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentTableAggregatedFieldWells(&sv.TableAggregatedFieldWells, value); err != nil { return err } case "TableUnaggregatedFieldWells": if err := awsRestjson1_deserializeDocumentTableUnaggregatedFieldWells(&sv.TableUnaggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableInlineVisualization(v **types.TableInlineVisualization, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableInlineVisualization if *v == nil { sv = &types.TableInlineVisualization{} } else { sv = *v } for key, value := range shape { switch key { case "DataBars": if err := awsRestjson1_deserializeDocumentDataBarsOptions(&sv.DataBars, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableInlineVisualizationList(v *[]types.TableInlineVisualization, 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.TableInlineVisualization if *v == nil { cv = []types.TableInlineVisualization{} } else { cv = *v } for _, value := range shape { var col types.TableInlineVisualization destAddr := &col if err := awsRestjson1_deserializeDocumentTableInlineVisualization(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTableOptions(v **types.TableOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableOptions if *v == nil { sv = &types.TableOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.CellStyle, value); err != nil { return err } case "HeaderStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.HeaderStyle, value); err != nil { return err } case "Orientation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableOrientation to be of type string, got %T instead", value) } sv.Orientation = types.TableOrientation(jtv) } case "RowAlternateColorOptions": if err := awsRestjson1_deserializeDocumentRowAlternateColorOptions(&sv.RowAlternateColorOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTablePaginatedReportOptions(v **types.TablePaginatedReportOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TablePaginatedReportOptions if *v == nil { sv = &types.TablePaginatedReportOptions{} } else { sv = *v } for key, value := range shape { switch key { case "OverflowColumnHeaderVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.OverflowColumnHeaderVisibility = types.Visibility(jtv) } case "VerticalOverflowVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.VerticalOverflowVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableRowConditionalFormatting(v **types.TableRowConditionalFormatting, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableRowConditionalFormatting if *v == nil { sv = &types.TableRowConditionalFormatting{} } else { sv = *v } for key, value := range shape { switch key { case "BackgroundColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.BackgroundColor, value); err != nil { return err } case "TextColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.TextColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableSideBorderOptions(v **types.TableSideBorderOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableSideBorderOptions if *v == nil { sv = &types.TableSideBorderOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Bottom": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.Bottom, value); err != nil { return err } case "InnerHorizontal": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.InnerHorizontal, value); err != nil { return err } case "InnerVertical": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.InnerVertical, value); err != nil { return err } case "Left": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.Left, value); err != nil { return err } case "Right": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.Right, value); err != nil { return err } case "Top": if err := awsRestjson1_deserializeDocumentTableBorderOptions(&sv.Top, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableSortConfiguration(v **types.TableSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableSortConfiguration if *v == nil { sv = &types.TableSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "PaginationConfiguration": if err := awsRestjson1_deserializeDocumentPaginationConfiguration(&sv.PaginationConfiguration, value); err != nil { return err } case "RowSort": if err := awsRestjson1_deserializeDocumentRowSortList(&sv.RowSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableUnaggregatedFieldWells(v **types.TableUnaggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableUnaggregatedFieldWells if *v == nil { sv = &types.TableUnaggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Values": if err := awsRestjson1_deserializeDocumentUnaggregatedFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTableVisual(v **types.TableVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TableVisual if *v == nil { sv = &types.TableVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentTableConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ConditionalFormatting": if err := awsRestjson1_deserializeDocumentTableConditionalFormatting(&sv.ConditionalFormatting, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagColumnOperation(v **types.TagColumnOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TagColumnOperation if *v == nil { sv = &types.TagColumnOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentColumnTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTargetVisualList(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 ShortRestrictiveResourceId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTemplate(v **types.Template, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Template if *v == nil { sv = &types.Template{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } case "Version": if err := awsRestjson1_deserializeDocumentTemplateVersion(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateAlias(v **types.TemplateAlias, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateAlias if *v == nil { sv = &types.TemplateAlias{} } else { sv = *v } for key, value := range shape { switch key { case "AliasName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AliasName to be of type string, got %T instead", value) } sv.AliasName = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "TemplateVersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TemplateVersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateAliasList(v *[]types.TemplateAlias, 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.TemplateAlias if *v == nil { cv = []types.TemplateAlias{} } else { cv = *v } for _, value := range shape { var col types.TemplateAlias destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateAlias(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTemplateError(v **types.TemplateError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateError if *v == nil { sv = &types.TemplateError{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateErrorType to be of type string, got %T instead", value) } sv.Type = types.TemplateErrorType(jtv) } case "ViolatedEntities": if err := awsRestjson1_deserializeDocumentEntityList(&sv.ViolatedEntities, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateErrorList(v *[]types.TemplateError, 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.TemplateError if *v == nil { cv = []types.TemplateError{} } else { cv = *v } for _, value := range shape { var col types.TemplateError destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTemplateSummary(v **types.TemplateSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateSummary if *v == nil { sv = &types.TemplateSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LatestVersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LatestVersionNumber = ptr.Int64(i64) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TemplateName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "TemplateId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.TemplateId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateSummaryList(v *[]types.TemplateSummary, 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.TemplateSummary if *v == nil { cv = []types.TemplateSummary{} } else { cv = *v } for _, value := range shape { var col types.TemplateSummary destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTemplateVersion(v **types.TemplateVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateVersion if *v == nil { sv = &types.TemplateVersion{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DataSetConfigurations": if err := awsRestjson1_deserializeDocumentDataSetConfigurationList(&sv.DataSetConfigurations, value); err != nil { return err } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Errors": if err := awsRestjson1_deserializeDocumentTemplateErrorList(&sv.Errors, value); err != nil { return err } case "Sheets": if err := awsRestjson1_deserializeDocumentSheetList(&sv.Sheets, value); err != nil { return err } case "SourceEntityArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.SourceEntityArn = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "ThemeArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ThemeArn = ptr.String(jtv) } case "VersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateVersionDefinition(v **types.TemplateVersionDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateVersionDefinition if *v == nil { sv = &types.TemplateVersionDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "AnalysisDefaults": if err := awsRestjson1_deserializeDocumentAnalysisDefaults(&sv.AnalysisDefaults, value); err != nil { return err } case "CalculatedFields": if err := awsRestjson1_deserializeDocumentCalculatedFields(&sv.CalculatedFields, value); err != nil { return err } case "ColumnConfigurations": if err := awsRestjson1_deserializeDocumentColumnConfigurationList(&sv.ColumnConfigurations, value); err != nil { return err } case "DataSetConfigurations": if err := awsRestjson1_deserializeDocumentDataSetConfigurationList(&sv.DataSetConfigurations, value); err != nil { return err } case "FilterGroups": if err := awsRestjson1_deserializeDocumentFilterGroupList(&sv.FilterGroups, value); err != nil { return err } case "ParameterDeclarations": if err := awsRestjson1_deserializeDocumentParameterDeclarationList(&sv.ParameterDeclarations, value); err != nil { return err } case "Sheets": if err := awsRestjson1_deserializeDocumentSheetDefinitionList(&sv.Sheets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateVersionSummary(v **types.TemplateVersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemplateVersionSummary if *v == nil { sv = &types.TemplateVersionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "VersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTemplateVersionSummaryList(v *[]types.TemplateVersionSummary, 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.TemplateVersionSummary if *v == nil { cv = []types.TemplateVersionSummary{} } else { cv = *v } for _, value := range shape { var col types.TemplateVersionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentTemplateVersionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTeradataParameters(v **types.TeradataParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TeradataParameters if *v == nil { sv = &types.TeradataParameters{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Database to be of type string, got %T instead", value) } sv.Database = ptr.String(jtv) } case "Host": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Host to be of type string, got %T instead", value) } sv.Host = ptr.String(jtv) } case "Port": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Port to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Port = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTextAreaControlDisplayOptions(v **types.TextAreaControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TextAreaControlDisplayOptions if *v == nil { sv = &types.TextAreaControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "PlaceholderOptions": if err := awsRestjson1_deserializeDocumentTextControlPlaceholderOptions(&sv.PlaceholderOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTextConditionalFormat(v **types.TextConditionalFormat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TextConditionalFormat if *v == nil { sv = &types.TextConditionalFormat{} } else { sv = *v } for key, value := range shape { switch key { case "BackgroundColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.BackgroundColor, value); err != nil { return err } case "Icon": if err := awsRestjson1_deserializeDocumentConditionalFormattingIcon(&sv.Icon, value); err != nil { return err } case "TextColor": if err := awsRestjson1_deserializeDocumentConditionalFormattingColor(&sv.TextColor, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTextControlPlaceholderOptions(v **types.TextControlPlaceholderOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TextControlPlaceholderOptions if *v == nil { sv = &types.TextControlPlaceholderOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTextFieldControlDisplayOptions(v **types.TextFieldControlDisplayOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TextFieldControlDisplayOptions if *v == nil { sv = &types.TextFieldControlDisplayOptions{} } else { sv = *v } for key, value := range shape { switch key { case "InfoIconLabelOptions": if err := awsRestjson1_deserializeDocumentSheetControlInfoIconLabelOptions(&sv.InfoIconLabelOptions, value); err != nil { return err } case "PlaceholderOptions": if err := awsRestjson1_deserializeDocumentTextControlPlaceholderOptions(&sv.PlaceholderOptions, value); err != nil { return err } case "TitleOptions": if err := awsRestjson1_deserializeDocumentLabelOptions(&sv.TitleOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTheme(v **types.Theme, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Theme if *v == nil { sv = &types.Theme{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThemeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThemeType to be of type string, got %T instead", value) } sv.Type = types.ThemeType(jtv) } case "Version": if err := awsRestjson1_deserializeDocumentThemeVersion(&sv.Version, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeAlias(v **types.ThemeAlias, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThemeAlias if *v == nil { sv = &types.ThemeAlias{} } else { sv = *v } for key, value := range shape { switch key { case "AliasName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AliasName to be of type string, got %T instead", value) } sv.AliasName = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "ThemeVersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ThemeVersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeAliasList(v *[]types.ThemeAlias, 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.ThemeAlias if *v == nil { cv = []types.ThemeAlias{} } else { cv = *v } for _, value := range shape { var col types.ThemeAlias destAddr := &col if err := awsRestjson1_deserializeDocumentThemeAlias(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThemeConfiguration(v **types.ThemeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThemeConfiguration if *v == nil { sv = &types.ThemeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DataColorPalette": if err := awsRestjson1_deserializeDocumentDataColorPalette(&sv.DataColorPalette, value); err != nil { return err } case "Sheet": if err := awsRestjson1_deserializeDocumentSheetStyle(&sv.Sheet, value); err != nil { return err } case "Typography": if err := awsRestjson1_deserializeDocumentTypography(&sv.Typography, value); err != nil { return err } case "UIColorPalette": if err := awsRestjson1_deserializeDocumentUIColorPalette(&sv.UIColorPalette, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeError(v **types.ThemeError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThemeError if *v == nil { sv = &types.ThemeError{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThemeErrorType to be of type string, got %T instead", value) } sv.Type = types.ThemeErrorType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeErrorList(v *[]types.ThemeError, 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.ThemeError if *v == nil { cv = []types.ThemeError{} } else { cv = *v } for _, value := range shape { var col types.ThemeError destAddr := &col if err := awsRestjson1_deserializeDocumentThemeError(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThemeSummary(v **types.ThemeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThemeSummary if *v == nil { sv = &types.ThemeSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "LatestVersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LatestVersionNumber = ptr.Int64(i64) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ThemeName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ThemeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeSummaryList(v *[]types.ThemeSummary, 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.ThemeSummary if *v == nil { cv = []types.ThemeSummary{} } else { cv = *v } for _, value := range shape { var col types.ThemeSummary destAddr := &col if err := awsRestjson1_deserializeDocumentThemeSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThemeVersion(v **types.ThemeVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThemeVersion if *v == nil { sv = &types.ThemeVersion{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "BaseThemeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.BaseThemeId = ptr.String(jtv) } case "Configuration": if err := awsRestjson1_deserializeDocumentThemeConfiguration(&sv.Configuration, value); err != nil { return err } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Errors": if err := awsRestjson1_deserializeDocumentThemeErrorList(&sv.Errors, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "VersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeVersionSummary(v **types.ThemeVersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThemeVersionSummary if *v == nil { sv = &types.ThemeVersionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VersionDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceStatus to be of type string, got %T instead", value) } sv.Status = types.ResourceStatus(jtv) } case "VersionNumber": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected VersionNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VersionNumber = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThemeVersionSummaryList(v *[]types.ThemeVersionSummary, 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.ThemeVersionSummary if *v == nil { cv = []types.ThemeVersionSummary{} } else { cv = *v } for _, value := range shape { var col types.ThemeVersionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentThemeVersionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThousandSeparatorOptions(v **types.ThousandSeparatorOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThousandSeparatorOptions if *v == nil { sv = &types.ThousandSeparatorOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Symbol": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NumericSeparatorSymbol to be of type string, got %T instead", value) } sv.Symbol = types.NumericSeparatorSymbol(jtv) } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTileLayoutStyle(v **types.TileLayoutStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TileLayoutStyle if *v == nil { sv = &types.TileLayoutStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Gutter": if err := awsRestjson1_deserializeDocumentGutterStyle(&sv.Gutter, value); err != nil { return err } case "Margin": if err := awsRestjson1_deserializeDocumentMarginStyle(&sv.Margin, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTileStyle(v **types.TileStyle, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TileStyle if *v == nil { sv = &types.TileStyle{} } else { sv = *v } for key, value := range shape { switch key { case "Border": if err := awsRestjson1_deserializeDocumentBorderStyle(&sv.Border, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTimeBasedForecastProperties(v **types.TimeBasedForecastProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TimeBasedForecastProperties if *v == nil { sv = &types.TimeBasedForecastProperties{} } else { sv = *v } for key, value := range shape { switch key { case "LowerBoundary": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LowerBoundary = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.LowerBoundary = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } case "PeriodsBackward": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PeriodsBackward to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PeriodsBackward = ptr.Int32(int32(i64)) } case "PeriodsForward": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PeriodsForward to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PeriodsForward = ptr.Int32(int32(i64)) } case "PredictionInterval": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PredictionInterval to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PredictionInterval = ptr.Int32(int32(i64)) } case "Seasonality": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Seasonality to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Seasonality = ptr.Int32(int32(i64)) } case "UpperBoundary": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.UpperBoundary = ptr.Float64(f64) case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.UpperBoundary = ptr.Float64(f64) default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTimeEqualityFilter(v **types.TimeEqualityFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TimeEqualityFilter if *v == nil { sv = &types.TimeEqualityFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTimeRangeDrillDownFilter(v **types.TimeRangeDrillDownFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TimeRangeDrillDownFilter if *v == nil { sv = &types.TimeRangeDrillDownFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "RangeMaximum": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RangeMaximum = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "RangeMinimum": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RangeMinimum = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTimeRangeFilter(v **types.TimeRangeFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TimeRangeFilter if *v == nil { sv = &types.TimeRangeFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "ExcludePeriodConfiguration": if err := awsRestjson1_deserializeDocumentExcludePeriodConfiguration(&sv.ExcludePeriodConfiguration, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } case "IncludeMaximum": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeMaximum = ptr.Bool(jtv) } case "IncludeMinimum": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IncludeMinimum = ptr.Bool(jtv) } case "NullOption": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterNullOption to be of type string, got %T instead", value) } sv.NullOption = types.FilterNullOption(jtv) } case "RangeMaximumValue": if err := awsRestjson1_deserializeDocumentTimeRangeFilterValue(&sv.RangeMaximumValue, value); err != nil { return err } case "RangeMinimumValue": if err := awsRestjson1_deserializeDocumentTimeRangeFilterValue(&sv.RangeMinimumValue, value); err != nil { return err } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTimeRangeFilterValue(v **types.TimeRangeFilterValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TimeRangeFilterValue if *v == nil { sv = &types.TimeRangeFilterValue{} } else { sv = *v } for key, value := range shape { switch key { case "Parameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.Parameter = ptr.String(jtv) } case "RollingDate": if err := awsRestjson1_deserializeDocumentRollingDateConfiguration(&sv.RollingDate, value); err != nil { return err } case "StaticValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StaticValue = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTooltipItem(v **types.TooltipItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TooltipItem if *v == nil { sv = &types.TooltipItem{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnTooltipItem": if err := awsRestjson1_deserializeDocumentColumnTooltipItem(&sv.ColumnTooltipItem, value); err != nil { return err } case "FieldTooltipItem": if err := awsRestjson1_deserializeDocumentFieldTooltipItem(&sv.FieldTooltipItem, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTooltipItemList(v *[]types.TooltipItem, 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.TooltipItem if *v == nil { cv = []types.TooltipItem{} } else { cv = *v } for _, value := range shape { var col types.TooltipItem destAddr := &col if err := awsRestjson1_deserializeDocumentTooltipItem(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTooltipOptions(v **types.TooltipOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TooltipOptions if *v == nil { sv = &types.TooltipOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FieldBasedTooltip": if err := awsRestjson1_deserializeDocumentFieldBasedTooltip(&sv.FieldBasedTooltip, value); err != nil { return err } case "SelectedTooltipType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SelectedTooltipType to be of type string, got %T instead", value) } sv.SelectedTooltipType = types.SelectedTooltipType(jtv) } case "TooltipVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.TooltipVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopBottomFilter(v **types.TopBottomFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopBottomFilter if *v == nil { sv = &types.TopBottomFilter{} } else { sv = *v } for key, value := range shape { switch key { case "AggregationSortConfigurations": if err := awsRestjson1_deserializeDocumentAggregationSortConfigurationList(&sv.AggregationSortConfigurations, value); err != nil { return err } case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FilterId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.FilterId = ptr.String(jtv) } case "Limit": 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.Limit = ptr.Int32(int32(i64)) } case "ParameterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParameterName to be of type string, got %T instead", value) } sv.ParameterName = ptr.String(jtv) } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopBottomMoversComputation(v **types.TopBottomMoversComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopBottomMoversComputation if *v == nil { sv = &types.TopBottomMoversComputation{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Category, value); err != nil { return err } case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = ptr.String(jtv) } case "MoverSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TopBottomMoversComputationMoverSize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MoverSize = 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 "SortOrder": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopBottomSortOrder to be of type string, got %T instead", value) } sv.SortOrder = types.TopBottomSortOrder(jtv) } case "Time": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Time, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopBottomComputationType to be of type string, got %T instead", value) } sv.Type = types.TopBottomComputationType(jtv) } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopBottomRankedComputation(v **types.TopBottomRankedComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopBottomRankedComputation if *v == nil { sv = &types.TopBottomRankedComputation{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Category, value); err != nil { return err } case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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 "ResultSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TopBottomRankedComputationResultSize to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ResultSize = int32(i64) } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopBottomComputationType to be of type string, got %T instead", value) } sv.Type = types.TopBottomComputationType(jtv) } case "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicCalculatedField(v **types.TopicCalculatedField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicCalculatedField if *v == nil { sv = &types.TopicCalculatedField{} } else { sv = *v } for key, value := range shape { switch key { case "Aggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DefaultAggregation to be of type string, got %T instead", value) } sv.Aggregation = types.DefaultAggregation(jtv) } case "AllowedAggregations": if err := awsRestjson1_deserializeDocumentAuthorSpecifiedAggregations(&sv.AllowedAggregations, value); err != nil { return err } case "CalculatedFieldDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.CalculatedFieldDescription = ptr.String(jtv) } case "CalculatedFieldName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.CalculatedFieldName = ptr.String(jtv) } case "CalculatedFieldSynonyms": if err := awsRestjson1_deserializeDocumentSynonyms(&sv.CalculatedFieldSynonyms, value); err != nil { return err } case "CellValueSynonyms": if err := awsRestjson1_deserializeDocumentCellValueSynonyms(&sv.CellValueSynonyms, value); err != nil { return err } case "ColumnDataRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnDataRole to be of type string, got %T instead", value) } sv.ColumnDataRole = types.ColumnDataRole(jtv) } case "ComparativeOrder": if err := awsRestjson1_deserializeDocumentComparativeOrder(&sv.ComparativeOrder, value); err != nil { return err } case "DefaultFormatting": if err := awsRestjson1_deserializeDocumentDefaultFormatting(&sv.DefaultFormatting, value); err != nil { return err } case "DisableIndexing": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.DisableIndexing = ptr.Bool(jtv) } case "Expression": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Expression to be of type string, got %T instead", value) } sv.Expression = ptr.String(jtv) } case "IsIncludedInTopic": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsIncludedInTopic = jtv } case "NeverAggregateInFilter": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.NeverAggregateInFilter = jtv } case "NotAllowedAggregations": if err := awsRestjson1_deserializeDocumentAuthorSpecifiedAggregations(&sv.NotAllowedAggregations, value); err != nil { return err } case "SemanticType": if err := awsRestjson1_deserializeDocumentSemanticType(&sv.SemanticType, value); err != nil { return err } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicTimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TopicTimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicCalculatedFields(v *[]types.TopicCalculatedField, 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.TopicCalculatedField if *v == nil { cv = []types.TopicCalculatedField{} } else { cv = *v } for _, value := range shape { var col types.TopicCalculatedField destAddr := &col if err := awsRestjson1_deserializeDocumentTopicCalculatedField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTopicCategoryFilter(v **types.TopicCategoryFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicCategoryFilter if *v == nil { sv = &types.TopicCategoryFilter{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryFilterFunction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterFunction to be of type string, got %T instead", value) } sv.CategoryFilterFunction = types.CategoryFilterFunction(jtv) } case "CategoryFilterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryFilterType to be of type string, got %T instead", value) } sv.CategoryFilterType = types.CategoryFilterType(jtv) } case "Constant": if err := awsRestjson1_deserializeDocumentTopicCategoryFilterConstant(&sv.Constant, value); err != nil { return err } case "Inverse": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Inverse = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicCategoryFilterConstant(v **types.TopicCategoryFilterConstant, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicCategoryFilterConstant if *v == nil { sv = &types.TopicCategoryFilterConstant{} } else { sv = *v } for key, value := range shape { switch key { case "CollectiveConstant": if err := awsRestjson1_deserializeDocumentCollectiveConstant(&sv.CollectiveConstant, value); err != nil { return err } case "ConstantType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConstantType to be of type string, got %T instead", value) } sv.ConstantType = types.ConstantType(jtv) } case "SingularConstant": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.SingularConstant = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicColumn(v **types.TopicColumn, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicColumn if *v == nil { sv = &types.TopicColumn{} } else { sv = *v } for key, value := range shape { switch key { case "Aggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DefaultAggregation to be of type string, got %T instead", value) } sv.Aggregation = types.DefaultAggregation(jtv) } case "AllowedAggregations": if err := awsRestjson1_deserializeDocumentAuthorSpecifiedAggregations(&sv.AllowedAggregations, value); err != nil { return err } case "CellValueSynonyms": if err := awsRestjson1_deserializeDocumentCellValueSynonyms(&sv.CellValueSynonyms, value); err != nil { return err } case "ColumnDataRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnDataRole to be of type string, got %T instead", value) } sv.ColumnDataRole = types.ColumnDataRole(jtv) } case "ColumnDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.ColumnDescription = ptr.String(jtv) } case "ColumnFriendlyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.ColumnFriendlyName = ptr.String(jtv) } case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "ColumnSynonyms": if err := awsRestjson1_deserializeDocumentSynonyms(&sv.ColumnSynonyms, value); err != nil { return err } case "ComparativeOrder": if err := awsRestjson1_deserializeDocumentComparativeOrder(&sv.ComparativeOrder, value); err != nil { return err } case "DefaultFormatting": if err := awsRestjson1_deserializeDocumentDefaultFormatting(&sv.DefaultFormatting, value); err != nil { return err } case "DisableIndexing": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.DisableIndexing = ptr.Bool(jtv) } case "IsIncludedInTopic": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsIncludedInTopic = jtv } case "NeverAggregateInFilter": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.NeverAggregateInFilter = jtv } case "NotAllowedAggregations": if err := awsRestjson1_deserializeDocumentAuthorSpecifiedAggregations(&sv.NotAllowedAggregations, value); err != nil { return err } case "SemanticType": if err := awsRestjson1_deserializeDocumentSemanticType(&sv.SemanticType, value); err != nil { return err } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicTimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TopicTimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicColumns(v *[]types.TopicColumn, 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.TopicColumn if *v == nil { cv = []types.TopicColumn{} } else { cv = *v } for _, value := range shape { var col types.TopicColumn destAddr := &col if err := awsRestjson1_deserializeDocumentTopicColumn(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTopicDateRangeFilter(v **types.TopicDateRangeFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicDateRangeFilter if *v == nil { sv = &types.TopicDateRangeFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Constant": if err := awsRestjson1_deserializeDocumentTopicRangeFilterConstant(&sv.Constant, value); err != nil { return err } case "Inclusive": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Inclusive = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicDetails(v **types.TopicDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicDetails if *v == nil { sv = &types.TopicDetails{} } else { sv = *v } for key, value := range shape { switch key { case "DataSets": if err := awsRestjson1_deserializeDocumentDatasets(&sv.DataSets, value); err != nil { return err } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicFilter(v **types.TopicFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicFilter if *v == nil { sv = &types.TopicFilter{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryFilter": if err := awsRestjson1_deserializeDocumentTopicCategoryFilter(&sv.CategoryFilter, value); err != nil { return err } case "DateRangeFilter": if err := awsRestjson1_deserializeDocumentTopicDateRangeFilter(&sv.DateRangeFilter, value); err != nil { return err } case "FilterClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FilterClass to be of type string, got %T instead", value) } sv.FilterClass = types.FilterClass(jtv) } case "FilterDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.FilterDescription = ptr.String(jtv) } case "FilterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.FilterName = ptr.String(jtv) } case "FilterSynonyms": if err := awsRestjson1_deserializeDocumentSynonyms(&sv.FilterSynonyms, value); err != nil { return err } case "FilterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamedFilterType to be of type string, got %T instead", value) } sv.FilterType = types.NamedFilterType(jtv) } case "NumericEqualityFilter": if err := awsRestjson1_deserializeDocumentTopicNumericEqualityFilter(&sv.NumericEqualityFilter, value); err != nil { return err } case "NumericRangeFilter": if err := awsRestjson1_deserializeDocumentTopicNumericRangeFilter(&sv.NumericRangeFilter, value); err != nil { return err } case "OperandFieldName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.OperandFieldName = ptr.String(jtv) } case "RelativeDateFilter": if err := awsRestjson1_deserializeDocumentTopicRelativeDateFilter(&sv.RelativeDateFilter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicFilters(v *[]types.TopicFilter, 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.TopicFilter if *v == nil { cv = []types.TopicFilter{} } else { cv = *v } for _, value := range shape { var col types.TopicFilter destAddr := &col if err := awsRestjson1_deserializeDocumentTopicFilter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTopicNamedEntities(v *[]types.TopicNamedEntity, 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.TopicNamedEntity if *v == nil { cv = []types.TopicNamedEntity{} } else { cv = *v } for _, value := range shape { var col types.TopicNamedEntity destAddr := &col if err := awsRestjson1_deserializeDocumentTopicNamedEntity(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTopicNamedEntity(v **types.TopicNamedEntity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicNamedEntity if *v == nil { sv = &types.TopicNamedEntity{} } else { sv = *v } for key, value := range shape { switch key { case "Definition": if err := awsRestjson1_deserializeDocumentNamedEntityDefinitions(&sv.Definition, value); err != nil { return err } case "EntityDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.EntityDescription = ptr.String(jtv) } case "EntityName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.EntityName = ptr.String(jtv) } case "EntitySynonyms": if err := awsRestjson1_deserializeDocumentSynonyms(&sv.EntitySynonyms, value); err != nil { return err } case "SemanticEntityType": if err := awsRestjson1_deserializeDocumentSemanticEntityType(&sv.SemanticEntityType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicNumericEqualityFilter(v **types.TopicNumericEqualityFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicNumericEqualityFilter if *v == nil { sv = &types.TopicNumericEqualityFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Aggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamedFilterAggType to be of type string, got %T instead", value) } sv.Aggregation = types.NamedFilterAggType(jtv) } case "Constant": if err := awsRestjson1_deserializeDocumentTopicSingularFilterConstant(&sv.Constant, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicNumericRangeFilter(v **types.TopicNumericRangeFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicNumericRangeFilter if *v == nil { sv = &types.TopicNumericRangeFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Aggregation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NamedFilterAggType to be of type string, got %T instead", value) } sv.Aggregation = types.NamedFilterAggType(jtv) } case "Constant": if err := awsRestjson1_deserializeDocumentTopicRangeFilterConstant(&sv.Constant, value); err != nil { return err } case "Inclusive": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Inclusive = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicRangeFilterConstant(v **types.TopicRangeFilterConstant, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicRangeFilterConstant if *v == nil { sv = &types.TopicRangeFilterConstant{} } else { sv = *v } for key, value := range shape { switch key { case "ConstantType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConstantType to be of type string, got %T instead", value) } sv.ConstantType = types.ConstantType(jtv) } case "RangeConstant": if err := awsRestjson1_deserializeDocumentRangeConstant(&sv.RangeConstant, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicRefreshDetails(v **types.TopicRefreshDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicRefreshDetails if *v == nil { sv = &types.TopicRefreshDetails{} } else { sv = *v } for key, value := range shape { switch key { case "RefreshArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RefreshArn = ptr.String(jtv) } case "RefreshId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) } sv.RefreshId = ptr.String(jtv) } case "RefreshStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicRefreshStatus to be of type string, got %T instead", value) } sv.RefreshStatus = types.TopicRefreshStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicRefreshSchedule(v **types.TopicRefreshSchedule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicRefreshSchedule if *v == nil { sv = &types.TopicRefreshSchedule{} } else { sv = *v } for key, value := range shape { switch key { case "BasedOnSpiceSchedule": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.BasedOnSpiceSchedule = jtv } case "IsEnabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } sv.IsEnabled = ptr.Bool(jtv) } case "RepeatAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.RepeatAt = ptr.String(jtv) } case "StartingAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartingAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Timezone": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.Timezone = ptr.String(jtv) } case "TopicScheduleType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicScheduleType to be of type string, got %T instead", value) } sv.TopicScheduleType = types.TopicScheduleType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicRefreshScheduleSummaries(v *[]types.TopicRefreshScheduleSummary, 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.TopicRefreshScheduleSummary if *v == nil { cv = []types.TopicRefreshScheduleSummary{} } else { cv = *v } for _, value := range shape { var col types.TopicRefreshScheduleSummary destAddr := &col if err := awsRestjson1_deserializeDocumentTopicRefreshScheduleSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTopicRefreshScheduleSummary(v **types.TopicRefreshScheduleSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicRefreshScheduleSummary if *v == nil { sv = &types.TopicRefreshScheduleSummary{} } else { sv = *v } for key, value := range shape { switch key { case "DatasetArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.DatasetArn = ptr.String(jtv) } case "DatasetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.DatasetId = ptr.String(jtv) } case "DatasetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.DatasetName = ptr.String(jtv) } case "RefreshSchedule": if err := awsRestjson1_deserializeDocumentTopicRefreshSchedule(&sv.RefreshSchedule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicRelativeDateFilter(v **types.TopicRelativeDateFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicRelativeDateFilter if *v == nil { sv = &types.TopicRelativeDateFilter{} } else { sv = *v } for key, value := range shape { switch key { case "Constant": if err := awsRestjson1_deserializeDocumentTopicSingularFilterConstant(&sv.Constant, value); err != nil { return err } case "RelativeDateFilterFunction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicRelativeDateFilterFunction to be of type string, got %T instead", value) } sv.RelativeDateFilterFunction = types.TopicRelativeDateFilterFunction(jtv) } case "TimeGranularity": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicTimeGranularity to be of type string, got %T instead", value) } sv.TimeGranularity = types.TopicTimeGranularity(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicSingularFilterConstant(v **types.TopicSingularFilterConstant, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicSingularFilterConstant if *v == nil { sv = &types.TopicSingularFilterConstant{} } else { sv = *v } for key, value := range shape { switch key { case "ConstantType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConstantType to be of type string, got %T instead", value) } sv.ConstantType = types.ConstantType(jtv) } case "SingularConstant": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } sv.SingularConstant = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTopicSummaries(v *[]types.TopicSummary, 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.TopicSummary if *v == nil { cv = []types.TopicSummary{} } else { cv = *v } for _, value := range shape { var col types.TopicSummary destAddr := &col if err := awsRestjson1_deserializeDocumentTopicSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTopicSummary(v **types.TopicSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TopicSummary if *v == nil { sv = &types.TopicSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "TopicId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TopicId to be of type string, got %T instead", value) } sv.TopicId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTotalAggregationComputation(v **types.TotalAggregationComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TotalAggregationComputation if *v == nil { sv = &types.TotalAggregationComputation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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 "Value": if err := awsRestjson1_deserializeDocumentMeasureField(&sv.Value, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTotalOptions(v **types.TotalOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TotalOptions if *v == nil { sv = &types.TotalOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CustomLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.CustomLabel = ptr.String(jtv) } case "Placement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableTotalsPlacement to be of type string, got %T instead", value) } sv.Placement = types.TableTotalsPlacement(jtv) } case "ScrollStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TableTotalsScrollStatus to be of type string, got %T instead", value) } sv.ScrollStatus = types.TableTotalsScrollStatus(jtv) } case "TotalCellStyle": if err := awsRestjson1_deserializeDocumentTableCellStyle(&sv.TotalCellStyle, value); err != nil { return err } case "TotalsVisibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.TotalsVisibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTransformOperation(v *types.TransformOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var uv types.TransformOperation loop: for key, value := range shape { if value == nil { continue } switch key { case "CastColumnTypeOperation": var mv types.CastColumnTypeOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentCastColumnTypeOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberCastColumnTypeOperation{Value: mv} break loop case "CreateColumnsOperation": var mv types.CreateColumnsOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentCreateColumnsOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberCreateColumnsOperation{Value: mv} break loop case "FilterOperation": var mv types.FilterOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentFilterOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberFilterOperation{Value: mv} break loop case "OverrideDatasetParameterOperation": var mv types.OverrideDatasetParameterOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentOverrideDatasetParameterOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberOverrideDatasetParameterOperation{Value: mv} break loop case "ProjectOperation": var mv types.ProjectOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentProjectOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberProjectOperation{Value: mv} break loop case "RenameColumnOperation": var mv types.RenameColumnOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentRenameColumnOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberRenameColumnOperation{Value: mv} break loop case "TagColumnOperation": var mv types.TagColumnOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentTagColumnOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberTagColumnOperation{Value: mv} break loop case "UntagColumnOperation": var mv types.UntagColumnOperation destAddr := &mv if err := awsRestjson1_deserializeDocumentUntagColumnOperation(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.TransformOperationMemberUntagColumnOperation{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentTransformOperationList(v *[]types.TransformOperation, 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.TransformOperation if *v == nil { cv = []types.TransformOperation{} } else { cv = *v } for _, value := range shape { var col types.TransformOperation if err := awsRestjson1_deserializeDocumentTransformOperation(&col, value); err != nil { return err } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTreeMapAggregatedFieldWells(v **types.TreeMapAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TreeMapAggregatedFieldWells if *v == nil { sv = &types.TreeMapAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Colors": if err := awsRestjson1_deserializeDocumentTreeMapMeasureFieldList(&sv.Colors, value); err != nil { return err } case "Groups": if err := awsRestjson1_deserializeDocumentTreeMapDimensionFieldList(&sv.Groups, value); err != nil { return err } case "Sizes": if err := awsRestjson1_deserializeDocumentTreeMapMeasureFieldList(&sv.Sizes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTreeMapConfiguration(v **types.TreeMapConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TreeMapConfiguration if *v == nil { sv = &types.TreeMapConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ColorLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.ColorLabelOptions, value); err != nil { return err } case "ColorScale": if err := awsRestjson1_deserializeDocumentColorScale(&sv.ColorScale, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentTreeMapFieldWells(&sv.FieldWells, value); err != nil { return err } case "GroupLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.GroupLabelOptions, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "SizeLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.SizeLabelOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentTreeMapSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "Tooltip": if err := awsRestjson1_deserializeDocumentTooltipOptions(&sv.Tooltip, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTreeMapDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTreeMapFieldWells(v **types.TreeMapFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TreeMapFieldWells if *v == nil { sv = &types.TreeMapFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "TreeMapAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentTreeMapAggregatedFieldWells(&sv.TreeMapAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTreeMapMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTreeMapSortConfiguration(v **types.TreeMapSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TreeMapSortConfiguration if *v == nil { sv = &types.TreeMapSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TreeMapGroupItemsLimitConfiguration": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.TreeMapGroupItemsLimitConfiguration, value); err != nil { return err } case "TreeMapSort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.TreeMapSort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTreeMapVisual(v **types.TreeMapVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TreeMapVisual if *v == nil { sv = &types.TreeMapVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentTreeMapConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTrendArrowOptions(v **types.TrendArrowOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TrendArrowOptions if *v == nil { sv = &types.TrendArrowOptions{} } else { sv = *v } for key, value := range shape { switch key { case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTwitterParameters(v **types.TwitterParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TwitterParameters if *v == nil { sv = &types.TwitterParameters{} } else { sv = *v } for key, value := range shape { switch key { case "MaxRows": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxRows = int32(i64) } case "Query": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Query to be of type string, got %T instead", value) } sv.Query = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTypeParameters(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LimitedString to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentTypography(v **types.Typography, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Typography if *v == nil { sv = &types.Typography{} } else { sv = *v } for key, value := range shape { switch key { case "FontFamilies": if err := awsRestjson1_deserializeDocumentFontList(&sv.FontFamilies, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUIColorPalette(v **types.UIColorPalette, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UIColorPalette if *v == nil { sv = &types.UIColorPalette{} } else { sv = *v } for key, value := range shape { switch key { case "Accent": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Accent = ptr.String(jtv) } case "AccentForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.AccentForeground = ptr.String(jtv) } case "Danger": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Danger = ptr.String(jtv) } case "DangerForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.DangerForeground = ptr.String(jtv) } case "Dimension": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Dimension = ptr.String(jtv) } case "DimensionForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.DimensionForeground = ptr.String(jtv) } case "Measure": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Measure = ptr.String(jtv) } case "MeasureForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.MeasureForeground = ptr.String(jtv) } case "PrimaryBackground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.PrimaryBackground = ptr.String(jtv) } case "PrimaryForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.PrimaryForeground = ptr.String(jtv) } case "SecondaryBackground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.SecondaryBackground = ptr.String(jtv) } case "SecondaryForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.SecondaryForeground = ptr.String(jtv) } case "Success": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Success = ptr.String(jtv) } case "SuccessForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.SuccessForeground = ptr.String(jtv) } case "Warning": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.Warning = ptr.String(jtv) } case "WarningForeground": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.WarningForeground = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnaggregatedField(v **types.UnaggregatedField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnaggregatedField if *v == nil { sv = &types.UnaggregatedField{} } else { sv = *v } for key, value := range shape { switch key { case "Column": if err := awsRestjson1_deserializeDocumentColumnIdentifier(&sv.Column, value); err != nil { return err } case "FieldId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FieldId to be of type string, got %T instead", value) } sv.FieldId = ptr.String(jtv) } case "FormatConfiguration": if err := awsRestjson1_deserializeDocumentFormatConfiguration(&sv.FormatConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnaggregatedFieldList(v *[]types.UnaggregatedField, 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.UnaggregatedField if *v == nil { cv = []types.UnaggregatedField{} } else { cv = *v } for _, value := range shape { var col types.UnaggregatedField destAddr := &col if err := awsRestjson1_deserializeDocumentUnaggregatedField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentUniqueValuesComputation(v **types.UniqueValuesComputation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UniqueValuesComputation if *v == nil { sv = &types.UniqueValuesComputation{} } else { sv = *v } for key, value := range shape { switch key { case "Category": if err := awsRestjson1_deserializeDocumentDimensionField(&sv.Category, value); err != nil { return err } case "ComputationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.ComputationId = 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnsupportedPricingPlanException(v **types.UnsupportedPricingPlanException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedPricingPlanException if *v == nil { sv = &types.UnsupportedPricingPlanException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnsupportedUserEditionException(v **types.UnsupportedUserEditionException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedUserEditionException if *v == nil { sv = &types.UnsupportedUserEditionException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUntagColumnOperation(v **types.UntagColumnOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UntagColumnOperation if *v == nil { sv = &types.UntagColumnOperation{} } else { sv = *v } for key, value := range shape { switch key { case "ColumnName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value) } sv.ColumnName = ptr.String(jtv) } case "TagNames": if err := awsRestjson1_deserializeDocumentColumnTagNames(&sv.TagNames, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUploadSettings(v **types.UploadSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UploadSettings if *v == nil { sv = &types.UploadSettings{} } else { sv = *v } for key, value := range shape { switch key { case "ContainsHeader": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ContainsHeader = ptr.Bool(jtv) } case "Delimiter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Delimiter to be of type string, got %T instead", value) } sv.Delimiter = ptr.String(jtv) } case "Format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FileFormat to be of type string, got %T instead", value) } sv.Format = types.FileFormat(jtv) } case "StartFromRow": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.StartFromRow = ptr.Int32(int32(i64)) } case "TextQualifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TextQualifier to be of type string, got %T instead", value) } sv.TextQualifier = types.TextQualifier(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUser(v **types.User, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.User if *v == nil { sv = &types.User{} } else { sv = *v } for key, value := range shape { switch key { case "Active": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Active = jtv } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CustomPermissionsName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleName to be of type string, got %T instead", value) } sv.CustomPermissionsName = ptr.String(jtv) } case "Email": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Email = ptr.String(jtv) } case "ExternalLoginFederationProviderType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ExternalLoginFederationProviderType = ptr.String(jtv) } case "ExternalLoginFederationProviderUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ExternalLoginFederationProviderUrl = ptr.String(jtv) } case "ExternalLoginId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ExternalLoginId = ptr.String(jtv) } case "IdentityType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value) } sv.IdentityType = types.IdentityType(jtv) } case "PrincipalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PrincipalId = ptr.String(jtv) } case "Role": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserRole to be of type string, got %T instead", value) } sv.Role = types.UserRole(jtv) } case "UserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserName to be of type string, got %T instead", value) } sv.UserName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUserList(v *[]types.User, 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.User if *v == nil { cv = []types.User{} } else { cv = *v } for _, value := range shape { var col types.User destAddr := &col if err := awsRestjson1_deserializeDocumentUser(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVisibleRangeOptions(v **types.VisibleRangeOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisibleRangeOptions if *v == nil { sv = &types.VisibleRangeOptions{} } else { sv = *v } for key, value := range shape { switch key { case "PercentRange": if err := awsRestjson1_deserializeDocumentPercentVisibleRange(&sv.PercentRange, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisual(v **types.Visual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Visual if *v == nil { sv = &types.Visual{} } else { sv = *v } for key, value := range shape { switch key { case "BarChartVisual": if err := awsRestjson1_deserializeDocumentBarChartVisual(&sv.BarChartVisual, value); err != nil { return err } case "BoxPlotVisual": if err := awsRestjson1_deserializeDocumentBoxPlotVisual(&sv.BoxPlotVisual, value); err != nil { return err } case "ComboChartVisual": if err := awsRestjson1_deserializeDocumentComboChartVisual(&sv.ComboChartVisual, value); err != nil { return err } case "CustomContentVisual": if err := awsRestjson1_deserializeDocumentCustomContentVisual(&sv.CustomContentVisual, value); err != nil { return err } case "EmptyVisual": if err := awsRestjson1_deserializeDocumentEmptyVisual(&sv.EmptyVisual, value); err != nil { return err } case "FilledMapVisual": if err := awsRestjson1_deserializeDocumentFilledMapVisual(&sv.FilledMapVisual, value); err != nil { return err } case "FunnelChartVisual": if err := awsRestjson1_deserializeDocumentFunnelChartVisual(&sv.FunnelChartVisual, value); err != nil { return err } case "GaugeChartVisual": if err := awsRestjson1_deserializeDocumentGaugeChartVisual(&sv.GaugeChartVisual, value); err != nil { return err } case "GeospatialMapVisual": if err := awsRestjson1_deserializeDocumentGeospatialMapVisual(&sv.GeospatialMapVisual, value); err != nil { return err } case "HeatMapVisual": if err := awsRestjson1_deserializeDocumentHeatMapVisual(&sv.HeatMapVisual, value); err != nil { return err } case "HistogramVisual": if err := awsRestjson1_deserializeDocumentHistogramVisual(&sv.HistogramVisual, value); err != nil { return err } case "InsightVisual": if err := awsRestjson1_deserializeDocumentInsightVisual(&sv.InsightVisual, value); err != nil { return err } case "KPIVisual": if err := awsRestjson1_deserializeDocumentKPIVisual(&sv.KPIVisual, value); err != nil { return err } case "LineChartVisual": if err := awsRestjson1_deserializeDocumentLineChartVisual(&sv.LineChartVisual, value); err != nil { return err } case "PieChartVisual": if err := awsRestjson1_deserializeDocumentPieChartVisual(&sv.PieChartVisual, value); err != nil { return err } case "PivotTableVisual": if err := awsRestjson1_deserializeDocumentPivotTableVisual(&sv.PivotTableVisual, value); err != nil { return err } case "RadarChartVisual": if err := awsRestjson1_deserializeDocumentRadarChartVisual(&sv.RadarChartVisual, value); err != nil { return err } case "SankeyDiagramVisual": if err := awsRestjson1_deserializeDocumentSankeyDiagramVisual(&sv.SankeyDiagramVisual, value); err != nil { return err } case "ScatterPlotVisual": if err := awsRestjson1_deserializeDocumentScatterPlotVisual(&sv.ScatterPlotVisual, value); err != nil { return err } case "TableVisual": if err := awsRestjson1_deserializeDocumentTableVisual(&sv.TableVisual, value); err != nil { return err } case "TreeMapVisual": if err := awsRestjson1_deserializeDocumentTreeMapVisual(&sv.TreeMapVisual, value); err != nil { return err } case "WaterfallVisual": if err := awsRestjson1_deserializeDocumentWaterfallVisual(&sv.WaterfallVisual, value); err != nil { return err } case "WordCloudVisual": if err := awsRestjson1_deserializeDocumentWordCloudVisual(&sv.WordCloudVisual, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualAxisSortOption(v **types.VisualAxisSortOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualAxisSortOption if *v == nil { sv = &types.VisualAxisSortOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualCustomAction(v **types.VisualCustomAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualCustomAction if *v == nil { sv = &types.VisualCustomAction{} } else { sv = *v } for key, value := range shape { switch key { case "ActionOperations": if err := awsRestjson1_deserializeDocumentVisualCustomActionOperationList(&sv.ActionOperations, value); err != nil { return err } case "CustomActionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.CustomActionId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VisualCustomActionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WidgetStatus to be of type string, got %T instead", value) } sv.Status = types.WidgetStatus(jtv) } case "Trigger": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VisualCustomActionTrigger to be of type string, got %T instead", value) } sv.Trigger = types.VisualCustomActionTrigger(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualCustomActionList(v *[]types.VisualCustomAction, 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.VisualCustomAction if *v == nil { cv = []types.VisualCustomAction{} } else { cv = *v } for _, value := range shape { var col types.VisualCustomAction destAddr := &col if err := awsRestjson1_deserializeDocumentVisualCustomAction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVisualCustomActionOperation(v **types.VisualCustomActionOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualCustomActionOperation if *v == nil { sv = &types.VisualCustomActionOperation{} } else { sv = *v } for key, value := range shape { switch key { case "FilterOperation": if err := awsRestjson1_deserializeDocumentCustomActionFilterOperation(&sv.FilterOperation, value); err != nil { return err } case "NavigationOperation": if err := awsRestjson1_deserializeDocumentCustomActionNavigationOperation(&sv.NavigationOperation, value); err != nil { return err } case "SetParametersOperation": if err := awsRestjson1_deserializeDocumentCustomActionSetParametersOperation(&sv.SetParametersOperation, value); err != nil { return err } case "URLOperation": if err := awsRestjson1_deserializeDocumentCustomActionURLOperation(&sv.URLOperation, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualCustomActionOperationList(v *[]types.VisualCustomActionOperation, 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.VisualCustomActionOperation if *v == nil { cv = []types.VisualCustomActionOperation{} } else { cv = *v } for _, value := range shape { var col types.VisualCustomActionOperation destAddr := &col if err := awsRestjson1_deserializeDocumentVisualCustomActionOperation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVisualList(v *[]types.Visual, 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.Visual if *v == nil { cv = []types.Visual{} } else { cv = *v } for _, value := range shape { var col types.Visual destAddr := &col if err := awsRestjson1_deserializeDocumentVisual(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVisualMenuOption(v **types.VisualMenuOption, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualMenuOption if *v == nil { sv = &types.VisualMenuOption{} } else { sv = *v } for key, value := range shape { switch key { case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DashboardBehavior to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.DashboardBehavior(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualPalette(v **types.VisualPalette, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualPalette if *v == nil { sv = &types.VisualPalette{} } else { sv = *v } for key, value := range shape { switch key { case "ChartColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HexColor to be of type string, got %T instead", value) } sv.ChartColor = ptr.String(jtv) } case "ColorMap": if err := awsRestjson1_deserializeDocumentDataPathColorList(&sv.ColorMap, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(v **types.VisualSubtitleLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualSubtitleLabelOptions if *v == nil { sv = &types.VisualSubtitleLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FormatText": if err := awsRestjson1_deserializeDocumentLongFormatText(&sv.FormatText, value); err != nil { return err } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVisualTitleLabelOptions(v **types.VisualTitleLabelOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VisualTitleLabelOptions if *v == nil { sv = &types.VisualTitleLabelOptions{} } else { sv = *v } for key, value := range shape { switch key { case "FormatText": if err := awsRestjson1_deserializeDocumentShortFormatText(&sv.FormatText, value); err != nil { return err } case "Visibility": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Visibility to be of type string, got %T instead", value) } sv.Visibility = types.Visibility(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVPCConnection(v **types.VPCConnection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VPCConnection if *v == nil { sv = &types.VPCConnection{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionAvailabilityStatus to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.VPCConnectionAvailabilityStatus(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DnsResolvers": if err := awsRestjson1_deserializeDocumentStringList(&sv.DnsResolvers, value); err != nil { return err } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NetworkInterfaces": if err := awsRestjson1_deserializeDocumentNetworkInterfaceList(&sv.NetworkInterfaces, value); err != nil { return err } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceStatus to be of type string, got %T instead", value) } sv.Status = types.VPCConnectionResourceStatus(jtv) } case "VPCConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceIdUnrestricted to be of type string, got %T instead", value) } sv.VPCConnectionId = ptr.String(jtv) } case "VPCId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VPCId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectionProperties(v **types.VpcConnectionProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VpcConnectionProperties if *v == nil { sv = &types.VpcConnectionProperties{} } else { sv = *v } for key, value := range shape { switch key { case "VpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVPCConnectionSummary(v **types.VPCConnectionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VPCConnectionSummary if *v == nil { sv = &types.VPCConnectionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "AvailabilityStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionAvailabilityStatus to be of type string, got %T instead", value) } sv.AvailabilityStatus = types.VPCConnectionAvailabilityStatus(jtv) } case "CreatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "DnsResolvers": if err := awsRestjson1_deserializeDocumentStringList(&sv.DnsResolvers, value); err != nil { return err } case "LastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NetworkInterfaces": if err := awsRestjson1_deserializeDocumentNetworkInterfaceList(&sv.NetworkInterfaces, value); err != nil { return err } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceStatus to be of type string, got %T instead", value) } sv.Status = types.VPCConnectionResourceStatus(jtv) } case "VPCConnectionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPCConnectionResourceIdUnrestricted to be of type string, got %T instead", value) } sv.VPCConnectionId = ptr.String(jtv) } case "VPCId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.VPCId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVPCConnectionSummaryList(v *[]types.VPCConnectionSummary, 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.VPCConnectionSummary if *v == nil { cv = []types.VPCConnectionSummary{} } else { cv = *v } for _, value := range shape { var col types.VPCConnectionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentVPCConnectionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWaterfallChartAggregatedFieldWells(v **types.WaterfallChartAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaterfallChartAggregatedFieldWells if *v == nil { sv = &types.WaterfallChartAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "Breakdowns": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Breakdowns, value); err != nil { return err } case "Categories": if err := awsRestjson1_deserializeDocumentDimensionFieldList(&sv.Categories, value); err != nil { return err } case "Values": if err := awsRestjson1_deserializeDocumentMeasureFieldList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaterfallChartConfiguration(v **types.WaterfallChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaterfallChartConfiguration if *v == nil { sv = &types.WaterfallChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.CategoryAxisDisplayOptions, value); err != nil { return err } case "CategoryAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryAxisLabelOptions, value); err != nil { return err } case "DataLabels": if err := awsRestjson1_deserializeDocumentDataLabelOptions(&sv.DataLabels, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentWaterfallChartFieldWells(&sv.FieldWells, value); err != nil { return err } case "Legend": if err := awsRestjson1_deserializeDocumentLegendOptions(&sv.Legend, value); err != nil { return err } case "PrimaryYAxisDisplayOptions": if err := awsRestjson1_deserializeDocumentAxisDisplayOptions(&sv.PrimaryYAxisDisplayOptions, value); err != nil { return err } case "PrimaryYAxisLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.PrimaryYAxisLabelOptions, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentWaterfallChartSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "VisualPalette": if err := awsRestjson1_deserializeDocumentVisualPalette(&sv.VisualPalette, value); err != nil { return err } case "WaterfallChartOptions": if err := awsRestjson1_deserializeDocumentWaterfallChartOptions(&sv.WaterfallChartOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaterfallChartFieldWells(v **types.WaterfallChartFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaterfallChartFieldWells if *v == nil { sv = &types.WaterfallChartFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "WaterfallChartAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentWaterfallChartAggregatedFieldWells(&sv.WaterfallChartAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaterfallChartOptions(v **types.WaterfallChartOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaterfallChartOptions if *v == nil { sv = &types.WaterfallChartOptions{} } else { sv = *v } for key, value := range shape { switch key { case "TotalBarLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.TotalBarLabel = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaterfallChartSortConfiguration(v **types.WaterfallChartSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaterfallChartSortConfiguration if *v == nil { sv = &types.WaterfallChartSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "BreakdownItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.BreakdownItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWaterfallVisual(v **types.WaterfallVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WaterfallVisual if *v == nil { sv = &types.WaterfallVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentWaterfallChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWhatIfPointScenario(v **types.WhatIfPointScenario, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WhatIfPointScenario if *v == nil { sv = &types.WhatIfPointScenario{} } else { sv = *v } for key, value := range shape { switch key { case "Date": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Value = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWhatIfRangeScenario(v **types.WhatIfRangeScenario, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WhatIfRangeScenario if *v == nil { sv = &types.WhatIfRangeScenario{} } else { sv = *v } for key, value := range shape { switch key { case "EndDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.EndDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "StartDate": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Value": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Value = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.Value = f64 default: return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWordCloudAggregatedFieldWells(v **types.WordCloudAggregatedFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WordCloudAggregatedFieldWells if *v == nil { sv = &types.WordCloudAggregatedFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "GroupBy": if err := awsRestjson1_deserializeDocumentWordCloudDimensionFieldList(&sv.GroupBy, value); err != nil { return err } case "Size": if err := awsRestjson1_deserializeDocumentWordCloudMeasureFieldList(&sv.Size, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWordCloudChartConfiguration(v **types.WordCloudChartConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WordCloudChartConfiguration if *v == nil { sv = &types.WordCloudChartConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryLabelOptions": if err := awsRestjson1_deserializeDocumentChartAxisLabelOptions(&sv.CategoryLabelOptions, value); err != nil { return err } case "FieldWells": if err := awsRestjson1_deserializeDocumentWordCloudFieldWells(&sv.FieldWells, value); err != nil { return err } case "SortConfiguration": if err := awsRestjson1_deserializeDocumentWordCloudSortConfiguration(&sv.SortConfiguration, value); err != nil { return err } case "WordCloudOptions": if err := awsRestjson1_deserializeDocumentWordCloudOptions(&sv.WordCloudOptions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWordCloudDimensionFieldList(v *[]types.DimensionField, 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.DimensionField if *v == nil { cv = []types.DimensionField{} } else { cv = *v } for _, value := range shape { var col types.DimensionField destAddr := &col if err := awsRestjson1_deserializeDocumentDimensionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWordCloudFieldWells(v **types.WordCloudFieldWells, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WordCloudFieldWells if *v == nil { sv = &types.WordCloudFieldWells{} } else { sv = *v } for key, value := range shape { switch key { case "WordCloudAggregatedFieldWells": if err := awsRestjson1_deserializeDocumentWordCloudAggregatedFieldWells(&sv.WordCloudAggregatedFieldWells, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWordCloudMeasureFieldList(v *[]types.MeasureField, 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.MeasureField if *v == nil { cv = []types.MeasureField{} } else { cv = *v } for _, value := range shape { var col types.MeasureField destAddr := &col if err := awsRestjson1_deserializeDocumentMeasureField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentWordCloudOptions(v **types.WordCloudOptions, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WordCloudOptions if *v == nil { sv = &types.WordCloudOptions{} } else { sv = *v } for key, value := range shape { switch key { case "CloudLayout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WordCloudCloudLayout to be of type string, got %T instead", value) } sv.CloudLayout = types.WordCloudCloudLayout(jtv) } case "MaximumStringLength": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected WordCloudMaximumStringLength to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaximumStringLength = ptr.Int32(int32(i64)) } case "WordCasing": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WordCloudWordCasing to be of type string, got %T instead", value) } sv.WordCasing = types.WordCloudWordCasing(jtv) } case "WordOrientation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WordCloudWordOrientation to be of type string, got %T instead", value) } sv.WordOrientation = types.WordCloudWordOrientation(jtv) } case "WordPadding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WordCloudWordPadding to be of type string, got %T instead", value) } sv.WordPadding = types.WordCloudWordPadding(jtv) } case "WordScaling": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WordCloudWordScaling to be of type string, got %T instead", value) } sv.WordScaling = types.WordCloudWordScaling(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWordCloudSortConfiguration(v **types.WordCloudSortConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WordCloudSortConfiguration if *v == nil { sv = &types.WordCloudSortConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CategoryItemsLimit": if err := awsRestjson1_deserializeDocumentItemsLimitConfiguration(&sv.CategoryItemsLimit, value); err != nil { return err } case "CategorySort": if err := awsRestjson1_deserializeDocumentFieldSortOptionsList(&sv.CategorySort, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWordCloudVisual(v **types.WordCloudVisual, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.WordCloudVisual if *v == nil { sv = &types.WordCloudVisual{} } else { sv = *v } for key, value := range shape { switch key { case "Actions": if err := awsRestjson1_deserializeDocumentVisualCustomActionList(&sv.Actions, value); err != nil { return err } case "ChartConfiguration": if err := awsRestjson1_deserializeDocumentWordCloudChartConfiguration(&sv.ChartConfiguration, value); err != nil { return err } case "ColumnHierarchies": if err := awsRestjson1_deserializeDocumentColumnHierarchyList(&sv.ColumnHierarchies, value); err != nil { return err } case "Subtitle": if err := awsRestjson1_deserializeDocumentVisualSubtitleLabelOptions(&sv.Subtitle, value); err != nil { return err } case "Title": if err := awsRestjson1_deserializeDocumentVisualTitleLabelOptions(&sv.Title, value); err != nil { return err } case "VisualId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ShortRestrictiveResourceId to be of type string, got %T instead", value) } sv.VisualId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }