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

package servicequotas

import (
	"context"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/servicequotas/types"
	smithy "github.com/aws/smithy-go"
	"github.com/aws/smithy-go/middleware"
)

type validateOpDeleteServiceQuotaIncreaseRequestFromTemplate struct {
}

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

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

type validateOpGetAWSDefaultServiceQuota struct {
}

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

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

type validateOpGetRequestedServiceQuotaChange struct {
}

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

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

type validateOpGetServiceQuotaIncreaseRequestFromTemplate struct {
}

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

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

type validateOpGetServiceQuota struct {
}

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

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

type validateOpListAWSDefaultServiceQuotas struct {
}

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

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

type validateOpListRequestedServiceQuotaChangeHistoryByQuota struct {
}

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

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

type validateOpListServiceQuotas struct {
}

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

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

type validateOpListTagsForResource struct {
}

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

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

type validateOpPutServiceQuotaIncreaseRequestIntoTemplate struct {
}

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

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

type validateOpRequestServiceQuotaIncrease struct {
}

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

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

type validateOpTagResource struct {
}

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

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

type validateOpUntagResource struct {
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func validateInputTags(v []types.Tag) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "InputTags"}
	for i := range v {
		if err := validateTag(&v[i]); err != nil {
			invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateTag(v *types.Tag) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "Tag"}
	if v.Key == nil {
		invalidParams.Add(smithy.NewErrParamRequired("Key"))
	}
	if v.Value == nil {
		invalidParams.Add(smithy.NewErrParamRequired("Value"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDeleteServiceQuotaIncreaseRequestFromTemplateInput(v *DeleteServiceQuotaIncreaseRequestFromTemplateInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceQuotaIncreaseRequestFromTemplateInput"}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if v.AwsRegion == nil {
		invalidParams.Add(smithy.NewErrParamRequired("AwsRegion"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpGetAWSDefaultServiceQuotaInput(v *GetAWSDefaultServiceQuotaInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "GetAWSDefaultServiceQuotaInput"}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

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

func validateOpGetServiceQuotaIncreaseRequestFromTemplateInput(v *GetServiceQuotaIncreaseRequestFromTemplateInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "GetServiceQuotaIncreaseRequestFromTemplateInput"}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if v.AwsRegion == nil {
		invalidParams.Add(smithy.NewErrParamRequired("AwsRegion"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpGetServiceQuotaInput(v *GetServiceQuotaInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "GetServiceQuotaInput"}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

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

func validateOpListRequestedServiceQuotaChangeHistoryByQuotaInput(v *ListRequestedServiceQuotaChangeHistoryByQuotaInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "ListRequestedServiceQuotaChangeHistoryByQuotaInput"}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

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

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

func validateOpPutServiceQuotaIncreaseRequestIntoTemplateInput(v *PutServiceQuotaIncreaseRequestIntoTemplateInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "PutServiceQuotaIncreaseRequestIntoTemplateInput"}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.AwsRegion == nil {
		invalidParams.Add(smithy.NewErrParamRequired("AwsRegion"))
	}
	if v.DesiredValue == nil {
		invalidParams.Add(smithy.NewErrParamRequired("DesiredValue"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpRequestServiceQuotaIncreaseInput(v *RequestServiceQuotaIncreaseInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "RequestServiceQuotaIncreaseInput"}
	if v.ServiceCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
	}
	if v.QuotaCode == nil {
		invalidParams.Add(smithy.NewErrParamRequired("QuotaCode"))
	}
	if v.DesiredValue == nil {
		invalidParams.Add(smithy.NewErrParamRequired("DesiredValue"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpTagResourceInput(v *TagResourceInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
	if v.ResourceARN == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
	}
	if v.Tags == nil {
		invalidParams.Add(smithy.NewErrParamRequired("Tags"))
	} else if v.Tags != nil {
		if err := validateInputTags(v.Tags); err != nil {
			invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpUntagResourceInput(v *UntagResourceInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
	if v.ResourceARN == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
	}
	if v.TagKeys == nil {
		invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}
