1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package elastictranscoder
4
5import (
6	"context"
7	"fmt"
8	smithy "github.com/aws/smithy-go"
9	"github.com/aws/smithy-go/middleware"
10)
11
12type validateOpCancelJob struct {
13}
14
15func (*validateOpCancelJob) ID() string {
16	return "OperationInputValidation"
17}
18
19func (m *validateOpCancelJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
20	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
21) {
22	input, ok := in.Parameters.(*CancelJobInput)
23	if !ok {
24		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
25	}
26	if err := validateOpCancelJobInput(input); err != nil {
27		return out, metadata, err
28	}
29	return next.HandleInitialize(ctx, in)
30}
31
32type validateOpCreateJob struct {
33}
34
35func (*validateOpCreateJob) ID() string {
36	return "OperationInputValidation"
37}
38
39func (m *validateOpCreateJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
40	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
41) {
42	input, ok := in.Parameters.(*CreateJobInput)
43	if !ok {
44		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
45	}
46	if err := validateOpCreateJobInput(input); err != nil {
47		return out, metadata, err
48	}
49	return next.HandleInitialize(ctx, in)
50}
51
52type validateOpCreatePipeline struct {
53}
54
55func (*validateOpCreatePipeline) ID() string {
56	return "OperationInputValidation"
57}
58
59func (m *validateOpCreatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
60	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
61) {
62	input, ok := in.Parameters.(*CreatePipelineInput)
63	if !ok {
64		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
65	}
66	if err := validateOpCreatePipelineInput(input); err != nil {
67		return out, metadata, err
68	}
69	return next.HandleInitialize(ctx, in)
70}
71
72type validateOpCreatePreset struct {
73}
74
75func (*validateOpCreatePreset) ID() string {
76	return "OperationInputValidation"
77}
78
79func (m *validateOpCreatePreset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
80	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
81) {
82	input, ok := in.Parameters.(*CreatePresetInput)
83	if !ok {
84		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
85	}
86	if err := validateOpCreatePresetInput(input); err != nil {
87		return out, metadata, err
88	}
89	return next.HandleInitialize(ctx, in)
90}
91
92type validateOpDeletePipeline struct {
93}
94
95func (*validateOpDeletePipeline) ID() string {
96	return "OperationInputValidation"
97}
98
99func (m *validateOpDeletePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
100	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
101) {
102	input, ok := in.Parameters.(*DeletePipelineInput)
103	if !ok {
104		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
105	}
106	if err := validateOpDeletePipelineInput(input); err != nil {
107		return out, metadata, err
108	}
109	return next.HandleInitialize(ctx, in)
110}
111
112type validateOpDeletePreset struct {
113}
114
115func (*validateOpDeletePreset) ID() string {
116	return "OperationInputValidation"
117}
118
119func (m *validateOpDeletePreset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
120	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
121) {
122	input, ok := in.Parameters.(*DeletePresetInput)
123	if !ok {
124		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
125	}
126	if err := validateOpDeletePresetInput(input); err != nil {
127		return out, metadata, err
128	}
129	return next.HandleInitialize(ctx, in)
130}
131
132type validateOpListJobsByPipeline struct {
133}
134
135func (*validateOpListJobsByPipeline) ID() string {
136	return "OperationInputValidation"
137}
138
139func (m *validateOpListJobsByPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
140	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
141) {
142	input, ok := in.Parameters.(*ListJobsByPipelineInput)
143	if !ok {
144		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
145	}
146	if err := validateOpListJobsByPipelineInput(input); err != nil {
147		return out, metadata, err
148	}
149	return next.HandleInitialize(ctx, in)
150}
151
152type validateOpListJobsByStatus struct {
153}
154
155func (*validateOpListJobsByStatus) ID() string {
156	return "OperationInputValidation"
157}
158
159func (m *validateOpListJobsByStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
160	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
161) {
162	input, ok := in.Parameters.(*ListJobsByStatusInput)
163	if !ok {
164		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
165	}
166	if err := validateOpListJobsByStatusInput(input); err != nil {
167		return out, metadata, err
168	}
169	return next.HandleInitialize(ctx, in)
170}
171
172type validateOpReadJob struct {
173}
174
175func (*validateOpReadJob) ID() string {
176	return "OperationInputValidation"
177}
178
179func (m *validateOpReadJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
180	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
181) {
182	input, ok := in.Parameters.(*ReadJobInput)
183	if !ok {
184		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
185	}
186	if err := validateOpReadJobInput(input); err != nil {
187		return out, metadata, err
188	}
189	return next.HandleInitialize(ctx, in)
190}
191
192type validateOpReadPipeline struct {
193}
194
195func (*validateOpReadPipeline) ID() string {
196	return "OperationInputValidation"
197}
198
199func (m *validateOpReadPipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
200	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
201) {
202	input, ok := in.Parameters.(*ReadPipelineInput)
203	if !ok {
204		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
205	}
206	if err := validateOpReadPipelineInput(input); err != nil {
207		return out, metadata, err
208	}
209	return next.HandleInitialize(ctx, in)
210}
211
212type validateOpReadPreset struct {
213}
214
215func (*validateOpReadPreset) ID() string {
216	return "OperationInputValidation"
217}
218
219func (m *validateOpReadPreset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
220	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
221) {
222	input, ok := in.Parameters.(*ReadPresetInput)
223	if !ok {
224		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
225	}
226	if err := validateOpReadPresetInput(input); err != nil {
227		return out, metadata, err
228	}
229	return next.HandleInitialize(ctx, in)
230}
231
232type validateOpTestRole struct {
233}
234
235func (*validateOpTestRole) ID() string {
236	return "OperationInputValidation"
237}
238
239func (m *validateOpTestRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
240	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
241) {
242	input, ok := in.Parameters.(*TestRoleInput)
243	if !ok {
244		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
245	}
246	if err := validateOpTestRoleInput(input); err != nil {
247		return out, metadata, err
248	}
249	return next.HandleInitialize(ctx, in)
250}
251
252type validateOpUpdatePipeline struct {
253}
254
255func (*validateOpUpdatePipeline) ID() string {
256	return "OperationInputValidation"
257}
258
259func (m *validateOpUpdatePipeline) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
260	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
261) {
262	input, ok := in.Parameters.(*UpdatePipelineInput)
263	if !ok {
264		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
265	}
266	if err := validateOpUpdatePipelineInput(input); err != nil {
267		return out, metadata, err
268	}
269	return next.HandleInitialize(ctx, in)
270}
271
272type validateOpUpdatePipelineNotifications struct {
273}
274
275func (*validateOpUpdatePipelineNotifications) ID() string {
276	return "OperationInputValidation"
277}
278
279func (m *validateOpUpdatePipelineNotifications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
280	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
281) {
282	input, ok := in.Parameters.(*UpdatePipelineNotificationsInput)
283	if !ok {
284		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
285	}
286	if err := validateOpUpdatePipelineNotificationsInput(input); err != nil {
287		return out, metadata, err
288	}
289	return next.HandleInitialize(ctx, in)
290}
291
292type validateOpUpdatePipelineStatus struct {
293}
294
295func (*validateOpUpdatePipelineStatus) ID() string {
296	return "OperationInputValidation"
297}
298
299func (m *validateOpUpdatePipelineStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
300	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
301) {
302	input, ok := in.Parameters.(*UpdatePipelineStatusInput)
303	if !ok {
304		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
305	}
306	if err := validateOpUpdatePipelineStatusInput(input); err != nil {
307		return out, metadata, err
308	}
309	return next.HandleInitialize(ctx, in)
310}
311
312func addOpCancelJobValidationMiddleware(stack *middleware.Stack) error {
313	return stack.Initialize.Add(&validateOpCancelJob{}, middleware.After)
314}
315
316func addOpCreateJobValidationMiddleware(stack *middleware.Stack) error {
317	return stack.Initialize.Add(&validateOpCreateJob{}, middleware.After)
318}
319
320func addOpCreatePipelineValidationMiddleware(stack *middleware.Stack) error {
321	return stack.Initialize.Add(&validateOpCreatePipeline{}, middleware.After)
322}
323
324func addOpCreatePresetValidationMiddleware(stack *middleware.Stack) error {
325	return stack.Initialize.Add(&validateOpCreatePreset{}, middleware.After)
326}
327
328func addOpDeletePipelineValidationMiddleware(stack *middleware.Stack) error {
329	return stack.Initialize.Add(&validateOpDeletePipeline{}, middleware.After)
330}
331
332func addOpDeletePresetValidationMiddleware(stack *middleware.Stack) error {
333	return stack.Initialize.Add(&validateOpDeletePreset{}, middleware.After)
334}
335
336func addOpListJobsByPipelineValidationMiddleware(stack *middleware.Stack) error {
337	return stack.Initialize.Add(&validateOpListJobsByPipeline{}, middleware.After)
338}
339
340func addOpListJobsByStatusValidationMiddleware(stack *middleware.Stack) error {
341	return stack.Initialize.Add(&validateOpListJobsByStatus{}, middleware.After)
342}
343
344func addOpReadJobValidationMiddleware(stack *middleware.Stack) error {
345	return stack.Initialize.Add(&validateOpReadJob{}, middleware.After)
346}
347
348func addOpReadPipelineValidationMiddleware(stack *middleware.Stack) error {
349	return stack.Initialize.Add(&validateOpReadPipeline{}, middleware.After)
350}
351
352func addOpReadPresetValidationMiddleware(stack *middleware.Stack) error {
353	return stack.Initialize.Add(&validateOpReadPreset{}, middleware.After)
354}
355
356func addOpTestRoleValidationMiddleware(stack *middleware.Stack) error {
357	return stack.Initialize.Add(&validateOpTestRole{}, middleware.After)
358}
359
360func addOpUpdatePipelineValidationMiddleware(stack *middleware.Stack) error {
361	return stack.Initialize.Add(&validateOpUpdatePipeline{}, middleware.After)
362}
363
364func addOpUpdatePipelineNotificationsValidationMiddleware(stack *middleware.Stack) error {
365	return stack.Initialize.Add(&validateOpUpdatePipelineNotifications{}, middleware.After)
366}
367
368func addOpUpdatePipelineStatusValidationMiddleware(stack *middleware.Stack) error {
369	return stack.Initialize.Add(&validateOpUpdatePipelineStatus{}, middleware.After)
370}
371
372func validateOpCancelJobInput(v *CancelJobInput) error {
373	if v == nil {
374		return nil
375	}
376	invalidParams := smithy.InvalidParamsError{Context: "CancelJobInput"}
377	if v.Id == nil {
378		invalidParams.Add(smithy.NewErrParamRequired("Id"))
379	}
380	if invalidParams.Len() > 0 {
381		return invalidParams
382	} else {
383		return nil
384	}
385}
386
387func validateOpCreateJobInput(v *CreateJobInput) error {
388	if v == nil {
389		return nil
390	}
391	invalidParams := smithy.InvalidParamsError{Context: "CreateJobInput"}
392	if v.PipelineId == nil {
393		invalidParams.Add(smithy.NewErrParamRequired("PipelineId"))
394	}
395	if invalidParams.Len() > 0 {
396		return invalidParams
397	} else {
398		return nil
399	}
400}
401
402func validateOpCreatePipelineInput(v *CreatePipelineInput) error {
403	if v == nil {
404		return nil
405	}
406	invalidParams := smithy.InvalidParamsError{Context: "CreatePipelineInput"}
407	if v.Name == nil {
408		invalidParams.Add(smithy.NewErrParamRequired("Name"))
409	}
410	if v.InputBucket == nil {
411		invalidParams.Add(smithy.NewErrParamRequired("InputBucket"))
412	}
413	if v.Role == nil {
414		invalidParams.Add(smithy.NewErrParamRequired("Role"))
415	}
416	if invalidParams.Len() > 0 {
417		return invalidParams
418	} else {
419		return nil
420	}
421}
422
423func validateOpCreatePresetInput(v *CreatePresetInput) error {
424	if v == nil {
425		return nil
426	}
427	invalidParams := smithy.InvalidParamsError{Context: "CreatePresetInput"}
428	if v.Name == nil {
429		invalidParams.Add(smithy.NewErrParamRequired("Name"))
430	}
431	if v.Container == nil {
432		invalidParams.Add(smithy.NewErrParamRequired("Container"))
433	}
434	if invalidParams.Len() > 0 {
435		return invalidParams
436	} else {
437		return nil
438	}
439}
440
441func validateOpDeletePipelineInput(v *DeletePipelineInput) error {
442	if v == nil {
443		return nil
444	}
445	invalidParams := smithy.InvalidParamsError{Context: "DeletePipelineInput"}
446	if v.Id == nil {
447		invalidParams.Add(smithy.NewErrParamRequired("Id"))
448	}
449	if invalidParams.Len() > 0 {
450		return invalidParams
451	} else {
452		return nil
453	}
454}
455
456func validateOpDeletePresetInput(v *DeletePresetInput) error {
457	if v == nil {
458		return nil
459	}
460	invalidParams := smithy.InvalidParamsError{Context: "DeletePresetInput"}
461	if v.Id == nil {
462		invalidParams.Add(smithy.NewErrParamRequired("Id"))
463	}
464	if invalidParams.Len() > 0 {
465		return invalidParams
466	} else {
467		return nil
468	}
469}
470
471func validateOpListJobsByPipelineInput(v *ListJobsByPipelineInput) error {
472	if v == nil {
473		return nil
474	}
475	invalidParams := smithy.InvalidParamsError{Context: "ListJobsByPipelineInput"}
476	if v.PipelineId == nil {
477		invalidParams.Add(smithy.NewErrParamRequired("PipelineId"))
478	}
479	if invalidParams.Len() > 0 {
480		return invalidParams
481	} else {
482		return nil
483	}
484}
485
486func validateOpListJobsByStatusInput(v *ListJobsByStatusInput) error {
487	if v == nil {
488		return nil
489	}
490	invalidParams := smithy.InvalidParamsError{Context: "ListJobsByStatusInput"}
491	if v.Status == nil {
492		invalidParams.Add(smithy.NewErrParamRequired("Status"))
493	}
494	if invalidParams.Len() > 0 {
495		return invalidParams
496	} else {
497		return nil
498	}
499}
500
501func validateOpReadJobInput(v *ReadJobInput) error {
502	if v == nil {
503		return nil
504	}
505	invalidParams := smithy.InvalidParamsError{Context: "ReadJobInput"}
506	if v.Id == nil {
507		invalidParams.Add(smithy.NewErrParamRequired("Id"))
508	}
509	if invalidParams.Len() > 0 {
510		return invalidParams
511	} else {
512		return nil
513	}
514}
515
516func validateOpReadPipelineInput(v *ReadPipelineInput) error {
517	if v == nil {
518		return nil
519	}
520	invalidParams := smithy.InvalidParamsError{Context: "ReadPipelineInput"}
521	if v.Id == nil {
522		invalidParams.Add(smithy.NewErrParamRequired("Id"))
523	}
524	if invalidParams.Len() > 0 {
525		return invalidParams
526	} else {
527		return nil
528	}
529}
530
531func validateOpReadPresetInput(v *ReadPresetInput) error {
532	if v == nil {
533		return nil
534	}
535	invalidParams := smithy.InvalidParamsError{Context: "ReadPresetInput"}
536	if v.Id == nil {
537		invalidParams.Add(smithy.NewErrParamRequired("Id"))
538	}
539	if invalidParams.Len() > 0 {
540		return invalidParams
541	} else {
542		return nil
543	}
544}
545
546func validateOpTestRoleInput(v *TestRoleInput) error {
547	if v == nil {
548		return nil
549	}
550	invalidParams := smithy.InvalidParamsError{Context: "TestRoleInput"}
551	if v.Role == nil {
552		invalidParams.Add(smithy.NewErrParamRequired("Role"))
553	}
554	if v.InputBucket == nil {
555		invalidParams.Add(smithy.NewErrParamRequired("InputBucket"))
556	}
557	if v.OutputBucket == nil {
558		invalidParams.Add(smithy.NewErrParamRequired("OutputBucket"))
559	}
560	if v.Topics == nil {
561		invalidParams.Add(smithy.NewErrParamRequired("Topics"))
562	}
563	if invalidParams.Len() > 0 {
564		return invalidParams
565	} else {
566		return nil
567	}
568}
569
570func validateOpUpdatePipelineInput(v *UpdatePipelineInput) error {
571	if v == nil {
572		return nil
573	}
574	invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineInput"}
575	if v.Id == nil {
576		invalidParams.Add(smithy.NewErrParamRequired("Id"))
577	}
578	if invalidParams.Len() > 0 {
579		return invalidParams
580	} else {
581		return nil
582	}
583}
584
585func validateOpUpdatePipelineNotificationsInput(v *UpdatePipelineNotificationsInput) error {
586	if v == nil {
587		return nil
588	}
589	invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineNotificationsInput"}
590	if v.Id == nil {
591		invalidParams.Add(smithy.NewErrParamRequired("Id"))
592	}
593	if v.Notifications == nil {
594		invalidParams.Add(smithy.NewErrParamRequired("Notifications"))
595	}
596	if invalidParams.Len() > 0 {
597		return invalidParams
598	} else {
599		return nil
600	}
601}
602
603func validateOpUpdatePipelineStatusInput(v *UpdatePipelineStatusInput) error {
604	if v == nil {
605		return nil
606	}
607	invalidParams := smithy.InvalidParamsError{Context: "UpdatePipelineStatusInput"}
608	if v.Id == nil {
609		invalidParams.Add(smithy.NewErrParamRequired("Id"))
610	}
611	if v.Status == nil {
612		invalidParams.Add(smithy.NewErrParamRequired("Status"))
613	}
614	if invalidParams.Len() > 0 {
615		return invalidParams
616	} else {
617		return nil
618	}
619}
620