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


package serviceactivity

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

type validateOpDescribeEventAttributes struct {
}

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

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

type validateOpDescribeEventCalendar struct {
}

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

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

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

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

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

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