// Code generated by smithy-go-codegen DO NOT EDIT. package elastictranscoder import ( "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCancelJob struct { } func (*validateOpCancelJob) ID() string { return "OperationInputValidation" } func (m *validateOpCancelJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateJob struct { } func (*validateOpCreateJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreatePipeline struct { } func (*validateOpCreatePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreatePreset struct { } func (*validateOpCreatePreset) ID() string { return "OperationInputValidation" } func (m *validateOpCreatePreset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreatePresetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreatePresetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeletePipeline struct { } func (*validateOpDeletePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpDeletePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeletePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeletePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeletePreset struct { } func (*validateOpDeletePreset) ID() string { return "OperationInputValidation" } func (m *validateOpDeletePreset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeletePresetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeletePresetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListJobsByPipeline struct { } func (*validateOpListJobsByPipeline) ID() string { return "OperationInputValidation" } func (m *validateOpListJobsByPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListJobsByPipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListJobsByPipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListJobsByStatus struct { } func (*validateOpListJobsByStatus) ID() string { return "OperationInputValidation" } func (m *validateOpListJobsByStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListJobsByStatusInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListJobsByStatusInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpReadJob struct { } func (*validateOpReadJob) ID() string { return "OperationInputValidation" } func (m *validateOpReadJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ReadJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpReadJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpReadPipeline struct { } func (*validateOpReadPipeline) ID() string { return "OperationInputValidation" } func (m *validateOpReadPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ReadPipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpReadPipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpReadPreset struct { } func (*validateOpReadPreset) ID() string { return "OperationInputValidation" } func (m *validateOpReadPreset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ReadPresetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpReadPresetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTestRole struct { } func (*validateOpTestRole) ID() string { return "OperationInputValidation" } func (m *validateOpTestRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TestRoleInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTestRoleInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdatePipeline struct { } func (*validateOpUpdatePipeline) ID() string { return "OperationInputValidation" } func (m *validateOpUpdatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdatePipelineInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdatePipelineInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdatePipelineNotifications struct { } func (*validateOpUpdatePipelineNotifications) ID() string { return "OperationInputValidation" } func (m *validateOpUpdatePipelineNotifications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdatePipelineNotificationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdatePipelineNotificationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdatePipelineStatus struct { } func (*validateOpUpdatePipelineStatus) ID() string { return "OperationInputValidation" } func (m *validateOpUpdatePipelineStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdatePipelineStatusInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdatePipelineStatusInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCancelJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelJob{}, middleware.After) } func addOpCreateJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateJob{}, middleware.After) } func addOpCreatePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePipeline{}, middleware.After) } func addOpCreatePresetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreatePreset{}, middleware.After) } func addOpDeletePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePipeline{}, middleware.After) } func addOpDeletePresetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeletePreset{}, middleware.After) } func addOpListJobsByPipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListJobsByPipeline{}, middleware.After) } func addOpListJobsByStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListJobsByStatus{}, middleware.After) } func addOpReadJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpReadJob{}, middleware.After) } func addOpReadPipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpReadPipeline{}, middleware.After) } func addOpReadPresetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpReadPreset{}, middleware.After) } func addOpTestRoleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTestRole{}, middleware.After) } func addOpUpdatePipelineValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePipeline{}, middleware.After) } func addOpUpdatePipelineNotificationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePipelineNotifications{}, middleware.After) } func addOpUpdatePipelineStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePipelineStatus{}, middleware.After) } func validateOpCancelJobInput(v *CancelJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelJobInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateJobInput(v *CreateJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateJobInput"} if v.PipelineId == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePipelineInput(v *CreatePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePipelineInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.InputBucket == nil { invalidParams.Add(smithy.NewErrParamRequired("InputBucket")) } if v.Role == nil { invalidParams.Add(smithy.NewErrParamRequired("Role")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreatePresetInput(v *CreatePresetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreatePresetInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Container == nil { invalidParams.Add(smithy.NewErrParamRequired("Container")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeletePipelineInput(v *DeletePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeletePipelineInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeletePresetInput(v *DeletePresetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeletePresetInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListJobsByPipelineInput(v *ListJobsByPipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListJobsByPipelineInput"} if v.PipelineId == nil { invalidParams.Add(smithy.NewErrParamRequired("PipelineId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListJobsByStatusInput(v *ListJobsByStatusInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListJobsByStatusInput"} if v.Status == nil { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpReadJobInput(v *ReadJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ReadJobInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpReadPipelineInput(v *ReadPipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ReadPipelineInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpReadPresetInput(v *ReadPresetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ReadPresetInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTestRoleInput(v *TestRoleInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TestRoleInput"} if v.Role == nil { invalidParams.Add(smithy.NewErrParamRequired("Role")) } if v.InputBucket == nil { invalidParams.Add(smithy.NewErrParamRequired("InputBucket")) } if v.OutputBucket == nil { invalidParams.Add(smithy.NewErrParamRequired("OutputBucket")) } if v.Topics == nil { invalidParams.Add(smithy.NewErrParamRequired("Topics")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdatePipelineInput(v *UpdatePipelineInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdatePipelineNotificationsInput(v *UpdatePipelineNotificationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineNotificationsInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.Notifications == nil { invalidParams.Add(smithy.NewErrParamRequired("Notifications")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdatePipelineStatusInput(v *UpdatePipelineStatusInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineStatusInput"} if v.Id == nil { invalidParams.Add(smithy.NewErrParamRequired("Id")) } if v.Status == nil { invalidParams.Add(smithy.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }