//go:build !no_runtime_type_checking

package awscloudtrail

import (
	"fmt"

	_jsii_ "github.com/aws/jsii-runtime-go/runtime"

	"github.com/aws/aws-cdk-go/awscdk/v2"
	"github.com/aws/aws-cdk-go/awscdk/v2/awsevents"
	"github.com/aws/aws-cdk-go/awscdk/v2/awslambda"
	"github.com/aws/constructs-go/constructs/v10"
)

func (t *jsiiProxy_Trail) validateAddEventSelectorParameters(dataResourceType DataResourceType, dataResourceValues *[]*string, options *AddEventSelectorOptions) error {
	if dataResourceType == "" {
		return fmt.Errorf("parameter dataResourceType is required, but nil was provided")
	}

	if dataResourceValues == nil {
		return fmt.Errorf("parameter dataResourceValues is required, but nil was provided")
	}

	if err := _jsii_.ValidateStruct(options, func() string { return "parameter options" }); err != nil {
		return err
	}

	return nil
}

func (t *jsiiProxy_Trail) validateAddLambdaEventSelectorParameters(handlers *[]awslambda.IFunction, options *AddEventSelectorOptions) error {
	if handlers == nil {
		return fmt.Errorf("parameter handlers is required, but nil was provided")
	}

	if err := _jsii_.ValidateStruct(options, func() string { return "parameter options" }); err != nil {
		return err
	}

	return nil
}

func (t *jsiiProxy_Trail) validateAddS3EventSelectorParameters(s3Selector *[]*S3EventSelector, options *AddEventSelectorOptions) error {
	if s3Selector == nil {
		return fmt.Errorf("parameter s3Selector is required, but nil was provided")
	}
	for idx_8d916a, v := range *s3Selector {
		if err := _jsii_.ValidateStruct(v, func() string { return fmt.Sprintf("parameter s3Selector[%#v]", idx_8d916a) }); err != nil {
			return err
		}
	}

	if err := _jsii_.ValidateStruct(options, func() string { return "parameter options" }); err != nil {
		return err
	}

	return nil
}

func (t *jsiiProxy_Trail) validateApplyRemovalPolicyParameters(policy awscdk.RemovalPolicy) error {
	if policy == "" {
		return fmt.Errorf("parameter policy is required, but nil was provided")
	}

	return nil
}

func (t *jsiiProxy_Trail) validateGetResourceArnAttributeParameters(arnAttr *string, arnComponents *awscdk.ArnComponents) error {
	if arnAttr == nil {
		return fmt.Errorf("parameter arnAttr is required, but nil was provided")
	}

	if arnComponents == nil {
		return fmt.Errorf("parameter arnComponents is required, but nil was provided")
	}
	if err := _jsii_.ValidateStruct(arnComponents, func() string { return "parameter arnComponents" }); err != nil {
		return err
	}

	return nil
}

func (t *jsiiProxy_Trail) validateGetResourceNameAttributeParameters(nameAttr *string) error {
	if nameAttr == nil {
		return fmt.Errorf("parameter nameAttr is required, but nil was provided")
	}

	return nil
}

func (t *jsiiProxy_Trail) validateLogAllLambdaDataEventsParameters(options *AddEventSelectorOptions) error {
	if err := _jsii_.ValidateStruct(options, func() string { return "parameter options" }); err != nil {
		return err
	}

	return nil
}

func (t *jsiiProxy_Trail) validateLogAllS3DataEventsParameters(options *AddEventSelectorOptions) error {
	if err := _jsii_.ValidateStruct(options, func() string { return "parameter options" }); err != nil {
		return err
	}

	return nil
}

func validateTrail_IsConstructParameters(x interface{}) error {
	if x == nil {
		return fmt.Errorf("parameter x is required, but nil was provided")
	}

	return nil
}

func validateTrail_IsOwnedResourceParameters(construct constructs.IConstruct) error {
	if construct == nil {
		return fmt.Errorf("parameter construct is required, but nil was provided")
	}

	return nil
}

func validateTrail_IsResourceParameters(construct constructs.IConstruct) error {
	if construct == nil {
		return fmt.Errorf("parameter construct is required, but nil was provided")
	}

	return nil
}

func validateTrail_OnEventParameters(scope constructs.Construct, id *string, options *awsevents.OnEventOptions) error {
	if scope == nil {
		return fmt.Errorf("parameter scope is required, but nil was provided")
	}

	if id == nil {
		return fmt.Errorf("parameter id is required, but nil was provided")
	}

	if err := _jsii_.ValidateStruct(options, func() string { return "parameter options" }); err != nil {
		return err
	}

	return nil
}

func validateNewTrailParameters(scope constructs.Construct, id *string, props *TrailProps) error {
	if scope == nil {
		return fmt.Errorf("parameter scope is required, but nil was provided")
	}

	if id == nil {
		return fmt.Errorf("parameter id is required, but nil was provided")
	}

	if err := _jsii_.ValidateStruct(props, func() string { return "parameter props" }); err != nil {
		return err
	}

	return nil
}

