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

package pinpointsmsvoice

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

type validateOpCreateConfigurationSetEventDestination struct {
}

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

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

type validateOpDeleteConfigurationSetEventDestination struct {
}

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

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

type validateOpDeleteConfigurationSet struct {
}

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

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

type validateOpGetConfigurationSetEventDestinations struct {
}

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

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

type validateOpUpdateConfigurationSetEventDestination struct {
}

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

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

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

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

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

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

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

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

func validateOpDeleteConfigurationSetEventDestinationInput(v *DeleteConfigurationSetEventDestinationInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationSetEventDestinationInput"}
	if v.ConfigurationSetName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
	}
	if v.EventDestinationName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("EventDestinationName"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

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

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

func validateOpUpdateConfigurationSetEventDestinationInput(v *UpdateConfigurationSetEventDestinationInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationSetEventDestinationInput"}
	if v.ConfigurationSetName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
	}
	if v.EventDestinationName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("EventDestinationName"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}
