// Code generated by smithy-go-codegen DO NOT EDIT.

package computeoptimizer

import (
	"context"
	"fmt"
	smithy "github.com/aws/smithy-go"
	"github.com/aws/smithy-go/middleware"
)

type validateOpDeleteRecommendationPreferences struct {
}

func (*validateOpDeleteRecommendationPreferences) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDeleteRecommendationPreferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DeleteRecommendationPreferencesInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDeleteRecommendationPreferencesInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpExportAutoScalingGroupRecommendations struct {
}

func (*validateOpExportAutoScalingGroupRecommendations) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpExportAutoScalingGroupRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*ExportAutoScalingGroupRecommendationsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpExportAutoScalingGroupRecommendationsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpExportEBSVolumeRecommendations struct {
}

func (*validateOpExportEBSVolumeRecommendations) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpExportEBSVolumeRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*ExportEBSVolumeRecommendationsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpExportEBSVolumeRecommendationsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpExportEC2InstanceRecommendations struct {
}

func (*validateOpExportEC2InstanceRecommendations) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpExportEC2InstanceRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*ExportEC2InstanceRecommendationsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpExportEC2InstanceRecommendationsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpExportLambdaFunctionRecommendations struct {
}

func (*validateOpExportLambdaFunctionRecommendations) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpExportLambdaFunctionRecommendations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*ExportLambdaFunctionRecommendationsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpExportLambdaFunctionRecommendationsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpGetEC2RecommendationProjectedMetrics struct {
}

func (*validateOpGetEC2RecommendationProjectedMetrics) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpGetEC2RecommendationProjectedMetrics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*GetEC2RecommendationProjectedMetricsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpGetEC2RecommendationProjectedMetricsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpGetEffectiveRecommendationPreferences struct {
}

func (*validateOpGetEffectiveRecommendationPreferences) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpGetEffectiveRecommendationPreferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*GetEffectiveRecommendationPreferencesInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpGetEffectiveRecommendationPreferencesInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpGetRecommendationPreferences struct {
}

func (*validateOpGetRecommendationPreferences) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpGetRecommendationPreferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*GetRecommendationPreferencesInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpGetRecommendationPreferencesInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpPutRecommendationPreferences struct {
}

func (*validateOpPutRecommendationPreferences) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpPutRecommendationPreferences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*PutRecommendationPreferencesInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpPutRecommendationPreferencesInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpUpdateEnrollmentStatus struct {
}

func (*validateOpUpdateEnrollmentStatus) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpUpdateEnrollmentStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*UpdateEnrollmentStatusInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpUpdateEnrollmentStatusInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

func addOpDeleteRecommendationPreferencesValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDeleteRecommendationPreferences{}, middleware.After)
}

func addOpExportAutoScalingGroupRecommendationsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpExportAutoScalingGroupRecommendations{}, middleware.After)
}

func addOpExportEBSVolumeRecommendationsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpExportEBSVolumeRecommendations{}, middleware.After)
}

func addOpExportEC2InstanceRecommendationsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpExportEC2InstanceRecommendations{}, middleware.After)
}

func addOpExportLambdaFunctionRecommendationsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpExportLambdaFunctionRecommendations{}, middleware.After)
}

func addOpGetEC2RecommendationProjectedMetricsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpGetEC2RecommendationProjectedMetrics{}, middleware.After)
}

func addOpGetEffectiveRecommendationPreferencesValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpGetEffectiveRecommendationPreferences{}, middleware.After)
}

func addOpGetRecommendationPreferencesValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpGetRecommendationPreferences{}, middleware.After)
}

func addOpPutRecommendationPreferencesValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpPutRecommendationPreferences{}, middleware.After)
}

func addOpUpdateEnrollmentStatusValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpUpdateEnrollmentStatus{}, middleware.After)
}

func validateOpDeleteRecommendationPreferencesInput(v *DeleteRecommendationPreferencesInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DeleteRecommendationPreferencesInput"}
	if len(v.ResourceType) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
	}
	if v.RecommendationPreferenceNames == nil {
		invalidParams.Add(smithy.NewErrParamRequired("RecommendationPreferenceNames"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpExportAutoScalingGroupRecommendationsInput(v *ExportAutoScalingGroupRecommendationsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "ExportAutoScalingGroupRecommendationsInput"}
	if v.S3DestinationConfig == nil {
		invalidParams.Add(smithy.NewErrParamRequired("S3DestinationConfig"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpExportEBSVolumeRecommendationsInput(v *ExportEBSVolumeRecommendationsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "ExportEBSVolumeRecommendationsInput"}
	if v.S3DestinationConfig == nil {
		invalidParams.Add(smithy.NewErrParamRequired("S3DestinationConfig"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpExportEC2InstanceRecommendationsInput(v *ExportEC2InstanceRecommendationsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "ExportEC2InstanceRecommendationsInput"}
	if v.S3DestinationConfig == nil {
		invalidParams.Add(smithy.NewErrParamRequired("S3DestinationConfig"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpExportLambdaFunctionRecommendationsInput(v *ExportLambdaFunctionRecommendationsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "ExportLambdaFunctionRecommendationsInput"}
	if v.S3DestinationConfig == nil {
		invalidParams.Add(smithy.NewErrParamRequired("S3DestinationConfig"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpGetEC2RecommendationProjectedMetricsInput(v *GetEC2RecommendationProjectedMetricsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "GetEC2RecommendationProjectedMetricsInput"}
	if v.InstanceArn == nil {
		invalidParams.Add(smithy.NewErrParamRequired("InstanceArn"))
	}
	if len(v.Stat) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("Stat"))
	}
	if v.StartTime == nil {
		invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
	}
	if v.EndTime == nil {
		invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpGetEffectiveRecommendationPreferencesInput(v *GetEffectiveRecommendationPreferencesInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "GetEffectiveRecommendationPreferencesInput"}
	if v.ResourceArn == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpGetRecommendationPreferencesInput(v *GetRecommendationPreferencesInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "GetRecommendationPreferencesInput"}
	if len(v.ResourceType) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpPutRecommendationPreferencesInput(v *PutRecommendationPreferencesInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "PutRecommendationPreferencesInput"}
	if len(v.ResourceType) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpUpdateEnrollmentStatusInput(v *UpdateEnrollmentStatusInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "UpdateEnrollmentStatusInput"}
	if len(v.Status) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("Status"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}
