-
Notifications
You must be signed in to change notification settings - Fork 38
/
constants.go
1382 lines (1206 loc) · 38.1 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package encodings
import (
"encoding/json"
"fmt"
"strings"
)
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type AacAudioProfile string
const (
AacAudioProfileAacLc AacAudioProfile = "AacLc"
AacAudioProfileHeAacVOne AacAudioProfile = "HeAacV1"
AacAudioProfileHeAacVTwo AacAudioProfile = "HeAacV2"
)
func PossibleValuesForAacAudioProfile() []string {
return []string{
string(AacAudioProfileAacLc),
string(AacAudioProfileHeAacVOne),
string(AacAudioProfileHeAacVTwo),
}
}
func (s *AacAudioProfile) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAacAudioProfile(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseAacAudioProfile(input string) (*AacAudioProfile, error) {
vals := map[string]AacAudioProfile{
"aaclc": AacAudioProfileAacLc,
"heaacv1": AacAudioProfileHeAacVOne,
"heaacv2": AacAudioProfileHeAacVTwo,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := AacAudioProfile(input)
return &out, nil
}
type AnalysisResolution string
const (
AnalysisResolutionSourceResolution AnalysisResolution = "SourceResolution"
AnalysisResolutionStandardDefinition AnalysisResolution = "StandardDefinition"
)
func PossibleValuesForAnalysisResolution() []string {
return []string{
string(AnalysisResolutionSourceResolution),
string(AnalysisResolutionStandardDefinition),
}
}
func (s *AnalysisResolution) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAnalysisResolution(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseAnalysisResolution(input string) (*AnalysisResolution, error) {
vals := map[string]AnalysisResolution{
"sourceresolution": AnalysisResolutionSourceResolution,
"standarddefinition": AnalysisResolutionStandardDefinition,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := AnalysisResolution(input)
return &out, nil
}
type AttributeFilter string
const (
AttributeFilterAll AttributeFilter = "All"
AttributeFilterBottom AttributeFilter = "Bottom"
AttributeFilterTop AttributeFilter = "Top"
AttributeFilterValueEquals AttributeFilter = "ValueEquals"
)
func PossibleValuesForAttributeFilter() []string {
return []string{
string(AttributeFilterAll),
string(AttributeFilterBottom),
string(AttributeFilterTop),
string(AttributeFilterValueEquals),
}
}
func (s *AttributeFilter) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAttributeFilter(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseAttributeFilter(input string) (*AttributeFilter, error) {
vals := map[string]AttributeFilter{
"all": AttributeFilterAll,
"bottom": AttributeFilterBottom,
"top": AttributeFilterTop,
"valueequals": AttributeFilterValueEquals,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := AttributeFilter(input)
return &out, nil
}
type AudioAnalysisMode string
const (
AudioAnalysisModeBasic AudioAnalysisMode = "Basic"
AudioAnalysisModeStandard AudioAnalysisMode = "Standard"
)
func PossibleValuesForAudioAnalysisMode() []string {
return []string{
string(AudioAnalysisModeBasic),
string(AudioAnalysisModeStandard),
}
}
func (s *AudioAnalysisMode) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseAudioAnalysisMode(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseAudioAnalysisMode(input string) (*AudioAnalysisMode, error) {
vals := map[string]AudioAnalysisMode{
"basic": AudioAnalysisModeBasic,
"standard": AudioAnalysisModeStandard,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := AudioAnalysisMode(input)
return &out, nil
}
type BlurType string
const (
BlurTypeBlack BlurType = "Black"
BlurTypeBox BlurType = "Box"
BlurTypeHigh BlurType = "High"
BlurTypeLow BlurType = "Low"
BlurTypeMed BlurType = "Med"
)
func PossibleValuesForBlurType() []string {
return []string{
string(BlurTypeBlack),
string(BlurTypeBox),
string(BlurTypeHigh),
string(BlurTypeLow),
string(BlurTypeMed),
}
}
func (s *BlurType) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseBlurType(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseBlurType(input string) (*BlurType, error) {
vals := map[string]BlurType{
"black": BlurTypeBlack,
"box": BlurTypeBox,
"high": BlurTypeHigh,
"low": BlurTypeLow,
"med": BlurTypeMed,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := BlurType(input)
return &out, nil
}
type ChannelMapping string
const (
ChannelMappingBackLeft ChannelMapping = "BackLeft"
ChannelMappingBackRight ChannelMapping = "BackRight"
ChannelMappingCenter ChannelMapping = "Center"
ChannelMappingFrontLeft ChannelMapping = "FrontLeft"
ChannelMappingFrontRight ChannelMapping = "FrontRight"
ChannelMappingLowFrequencyEffects ChannelMapping = "LowFrequencyEffects"
ChannelMappingStereoLeft ChannelMapping = "StereoLeft"
ChannelMappingStereoRight ChannelMapping = "StereoRight"
)
func PossibleValuesForChannelMapping() []string {
return []string{
string(ChannelMappingBackLeft),
string(ChannelMappingBackRight),
string(ChannelMappingCenter),
string(ChannelMappingFrontLeft),
string(ChannelMappingFrontRight),
string(ChannelMappingLowFrequencyEffects),
string(ChannelMappingStereoLeft),
string(ChannelMappingStereoRight),
}
}
func (s *ChannelMapping) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseChannelMapping(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseChannelMapping(input string) (*ChannelMapping, error) {
vals := map[string]ChannelMapping{
"backleft": ChannelMappingBackLeft,
"backright": ChannelMappingBackRight,
"center": ChannelMappingCenter,
"frontleft": ChannelMappingFrontLeft,
"frontright": ChannelMappingFrontRight,
"lowfrequencyeffects": ChannelMappingLowFrequencyEffects,
"stereoleft": ChannelMappingStereoLeft,
"stereoright": ChannelMappingStereoRight,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := ChannelMapping(input)
return &out, nil
}
type Complexity string
const (
ComplexityBalanced Complexity = "Balanced"
ComplexityQuality Complexity = "Quality"
ComplexitySpeed Complexity = "Speed"
)
func PossibleValuesForComplexity() []string {
return []string{
string(ComplexityBalanced),
string(ComplexityQuality),
string(ComplexitySpeed),
}
}
func (s *Complexity) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseComplexity(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseComplexity(input string) (*Complexity, error) {
vals := map[string]Complexity{
"balanced": ComplexityBalanced,
"quality": ComplexityQuality,
"speed": ComplexitySpeed,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := Complexity(input)
return &out, nil
}
type DeinterlaceMode string
const (
DeinterlaceModeAutoPixelAdaptive DeinterlaceMode = "AutoPixelAdaptive"
DeinterlaceModeOff DeinterlaceMode = "Off"
)
func PossibleValuesForDeinterlaceMode() []string {
return []string{
string(DeinterlaceModeAutoPixelAdaptive),
string(DeinterlaceModeOff),
}
}
func (s *DeinterlaceMode) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseDeinterlaceMode(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseDeinterlaceMode(input string) (*DeinterlaceMode, error) {
vals := map[string]DeinterlaceMode{
"autopixeladaptive": DeinterlaceModeAutoPixelAdaptive,
"off": DeinterlaceModeOff,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := DeinterlaceMode(input)
return &out, nil
}
type DeinterlaceParity string
const (
DeinterlaceParityAuto DeinterlaceParity = "Auto"
DeinterlaceParityBottomFieldFirst DeinterlaceParity = "BottomFieldFirst"
DeinterlaceParityTopFieldFirst DeinterlaceParity = "TopFieldFirst"
)
func PossibleValuesForDeinterlaceParity() []string {
return []string{
string(DeinterlaceParityAuto),
string(DeinterlaceParityBottomFieldFirst),
string(DeinterlaceParityTopFieldFirst),
}
}
func (s *DeinterlaceParity) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseDeinterlaceParity(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseDeinterlaceParity(input string) (*DeinterlaceParity, error) {
vals := map[string]DeinterlaceParity{
"auto": DeinterlaceParityAuto,
"bottomfieldfirst": DeinterlaceParityBottomFieldFirst,
"topfieldfirst": DeinterlaceParityTopFieldFirst,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := DeinterlaceParity(input)
return &out, nil
}
type EncoderNamedPreset string
const (
EncoderNamedPresetAACGoodQualityAudio EncoderNamedPreset = "AACGoodQualityAudio"
EncoderNamedPresetAdaptiveStreaming EncoderNamedPreset = "AdaptiveStreaming"
EncoderNamedPresetContentAwareEncoding EncoderNamedPreset = "ContentAwareEncoding"
EncoderNamedPresetContentAwareEncodingExperimental EncoderNamedPreset = "ContentAwareEncodingExperimental"
EncoderNamedPresetCopyAllBitrateNonInterleaved EncoderNamedPreset = "CopyAllBitrateNonInterleaved"
EncoderNamedPresetHTwoSixFiveAdaptiveStreaming EncoderNamedPreset = "H265AdaptiveStreaming"
EncoderNamedPresetHTwoSixFiveContentAwareEncoding EncoderNamedPreset = "H265ContentAwareEncoding"
EncoderNamedPresetHTwoSixFiveSingleBitrateFourK EncoderNamedPreset = "H265SingleBitrate4K"
EncoderNamedPresetHTwoSixFiveSingleBitrateOneZeroEightZerop EncoderNamedPreset = "H265SingleBitrate1080p"
EncoderNamedPresetHTwoSixFiveSingleBitrateSevenTwoZerop EncoderNamedPreset = "H265SingleBitrate720p"
EncoderNamedPresetHTwoSixFourMultipleBitrateOneZeroEightZerop EncoderNamedPreset = "H264MultipleBitrate1080p"
EncoderNamedPresetHTwoSixFourMultipleBitrateSD EncoderNamedPreset = "H264MultipleBitrateSD"
EncoderNamedPresetHTwoSixFourMultipleBitrateSevenTwoZerop EncoderNamedPreset = "H264MultipleBitrate720p"
EncoderNamedPresetHTwoSixFourSingleBitrateOneZeroEightZerop EncoderNamedPreset = "H264SingleBitrate1080p"
EncoderNamedPresetHTwoSixFourSingleBitrateSD EncoderNamedPreset = "H264SingleBitrateSD"
EncoderNamedPresetHTwoSixFourSingleBitrateSevenTwoZerop EncoderNamedPreset = "H264SingleBitrate720p"
)
func PossibleValuesForEncoderNamedPreset() []string {
return []string{
string(EncoderNamedPresetAACGoodQualityAudio),
string(EncoderNamedPresetAdaptiveStreaming),
string(EncoderNamedPresetContentAwareEncoding),
string(EncoderNamedPresetContentAwareEncodingExperimental),
string(EncoderNamedPresetCopyAllBitrateNonInterleaved),
string(EncoderNamedPresetHTwoSixFiveAdaptiveStreaming),
string(EncoderNamedPresetHTwoSixFiveContentAwareEncoding),
string(EncoderNamedPresetHTwoSixFiveSingleBitrateFourK),
string(EncoderNamedPresetHTwoSixFiveSingleBitrateOneZeroEightZerop),
string(EncoderNamedPresetHTwoSixFiveSingleBitrateSevenTwoZerop),
string(EncoderNamedPresetHTwoSixFourMultipleBitrateOneZeroEightZerop),
string(EncoderNamedPresetHTwoSixFourMultipleBitrateSD),
string(EncoderNamedPresetHTwoSixFourMultipleBitrateSevenTwoZerop),
string(EncoderNamedPresetHTwoSixFourSingleBitrateOneZeroEightZerop),
string(EncoderNamedPresetHTwoSixFourSingleBitrateSD),
string(EncoderNamedPresetHTwoSixFourSingleBitrateSevenTwoZerop),
}
}
func (s *EncoderNamedPreset) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseEncoderNamedPreset(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseEncoderNamedPreset(input string) (*EncoderNamedPreset, error) {
vals := map[string]EncoderNamedPreset{
"aacgoodqualityaudio": EncoderNamedPresetAACGoodQualityAudio,
"adaptivestreaming": EncoderNamedPresetAdaptiveStreaming,
"contentawareencoding": EncoderNamedPresetContentAwareEncoding,
"contentawareencodingexperimental": EncoderNamedPresetContentAwareEncodingExperimental,
"copyallbitratenoninterleaved": EncoderNamedPresetCopyAllBitrateNonInterleaved,
"h265adaptivestreaming": EncoderNamedPresetHTwoSixFiveAdaptiveStreaming,
"h265contentawareencoding": EncoderNamedPresetHTwoSixFiveContentAwareEncoding,
"h265singlebitrate4k": EncoderNamedPresetHTwoSixFiveSingleBitrateFourK,
"h265singlebitrate1080p": EncoderNamedPresetHTwoSixFiveSingleBitrateOneZeroEightZerop,
"h265singlebitrate720p": EncoderNamedPresetHTwoSixFiveSingleBitrateSevenTwoZerop,
"h264multiplebitrate1080p": EncoderNamedPresetHTwoSixFourMultipleBitrateOneZeroEightZerop,
"h264multiplebitratesd": EncoderNamedPresetHTwoSixFourMultipleBitrateSD,
"h264multiplebitrate720p": EncoderNamedPresetHTwoSixFourMultipleBitrateSevenTwoZerop,
"h264singlebitrate1080p": EncoderNamedPresetHTwoSixFourSingleBitrateOneZeroEightZerop,
"h264singlebitratesd": EncoderNamedPresetHTwoSixFourSingleBitrateSD,
"h264singlebitrate720p": EncoderNamedPresetHTwoSixFourSingleBitrateSevenTwoZerop,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := EncoderNamedPreset(input)
return &out, nil
}
type EntropyMode string
const (
EntropyModeCabac EntropyMode = "Cabac"
EntropyModeCavlc EntropyMode = "Cavlc"
)
func PossibleValuesForEntropyMode() []string {
return []string{
string(EntropyModeCabac),
string(EntropyModeCavlc),
}
}
func (s *EntropyMode) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseEntropyMode(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseEntropyMode(input string) (*EntropyMode, error) {
vals := map[string]EntropyMode{
"cabac": EntropyModeCabac,
"cavlc": EntropyModeCavlc,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := EntropyMode(input)
return &out, nil
}
type FaceRedactorMode string
const (
FaceRedactorModeAnalyze FaceRedactorMode = "Analyze"
FaceRedactorModeCombined FaceRedactorMode = "Combined"
FaceRedactorModeRedact FaceRedactorMode = "Redact"
)
func PossibleValuesForFaceRedactorMode() []string {
return []string{
string(FaceRedactorModeAnalyze),
string(FaceRedactorModeCombined),
string(FaceRedactorModeRedact),
}
}
func (s *FaceRedactorMode) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseFaceRedactorMode(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseFaceRedactorMode(input string) (*FaceRedactorMode, error) {
vals := map[string]FaceRedactorMode{
"analyze": FaceRedactorModeAnalyze,
"combined": FaceRedactorModeCombined,
"redact": FaceRedactorModeRedact,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := FaceRedactorMode(input)
return &out, nil
}
type H264Complexity string
const (
H264ComplexityBalanced H264Complexity = "Balanced"
H264ComplexityQuality H264Complexity = "Quality"
H264ComplexitySpeed H264Complexity = "Speed"
)
func PossibleValuesForH264Complexity() []string {
return []string{
string(H264ComplexityBalanced),
string(H264ComplexityQuality),
string(H264ComplexitySpeed),
}
}
func (s *H264Complexity) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseH264Complexity(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseH264Complexity(input string) (*H264Complexity, error) {
vals := map[string]H264Complexity{
"balanced": H264ComplexityBalanced,
"quality": H264ComplexityQuality,
"speed": H264ComplexitySpeed,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := H264Complexity(input)
return &out, nil
}
type H264RateControlMode string
const (
H264RateControlModeABR H264RateControlMode = "ABR"
H264RateControlModeCBR H264RateControlMode = "CBR"
H264RateControlModeCRF H264RateControlMode = "CRF"
)
func PossibleValuesForH264RateControlMode() []string {
return []string{
string(H264RateControlModeABR),
string(H264RateControlModeCBR),
string(H264RateControlModeCRF),
}
}
func (s *H264RateControlMode) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseH264RateControlMode(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseH264RateControlMode(input string) (*H264RateControlMode, error) {
vals := map[string]H264RateControlMode{
"abr": H264RateControlModeABR,
"cbr": H264RateControlModeCBR,
"crf": H264RateControlModeCRF,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := H264RateControlMode(input)
return &out, nil
}
type H264VideoProfile string
const (
H264VideoProfileAuto H264VideoProfile = "Auto"
H264VideoProfileBaseline H264VideoProfile = "Baseline"
H264VideoProfileHigh H264VideoProfile = "High"
H264VideoProfileHighFourFourFour H264VideoProfile = "High444"
H264VideoProfileHighFourTwoTwo H264VideoProfile = "High422"
H264VideoProfileMain H264VideoProfile = "Main"
)
func PossibleValuesForH264VideoProfile() []string {
return []string{
string(H264VideoProfileAuto),
string(H264VideoProfileBaseline),
string(H264VideoProfileHigh),
string(H264VideoProfileHighFourFourFour),
string(H264VideoProfileHighFourTwoTwo),
string(H264VideoProfileMain),
}
}
func (s *H264VideoProfile) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseH264VideoProfile(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseH264VideoProfile(input string) (*H264VideoProfile, error) {
vals := map[string]H264VideoProfile{
"auto": H264VideoProfileAuto,
"baseline": H264VideoProfileBaseline,
"high": H264VideoProfileHigh,
"high444": H264VideoProfileHighFourFourFour,
"high422": H264VideoProfileHighFourTwoTwo,
"main": H264VideoProfileMain,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := H264VideoProfile(input)
return &out, nil
}
type H265Complexity string
const (
H265ComplexityBalanced H265Complexity = "Balanced"
H265ComplexityQuality H265Complexity = "Quality"
H265ComplexitySpeed H265Complexity = "Speed"
)
func PossibleValuesForH265Complexity() []string {
return []string{
string(H265ComplexityBalanced),
string(H265ComplexityQuality),
string(H265ComplexitySpeed),
}
}
func (s *H265Complexity) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseH265Complexity(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseH265Complexity(input string) (*H265Complexity, error) {
vals := map[string]H265Complexity{
"balanced": H265ComplexityBalanced,
"quality": H265ComplexityQuality,
"speed": H265ComplexitySpeed,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := H265Complexity(input)
return &out, nil
}
type H265VideoProfile string
const (
H265VideoProfileAuto H265VideoProfile = "Auto"
H265VideoProfileMain H265VideoProfile = "Main"
H265VideoProfileMainOneZero H265VideoProfile = "Main10"
)
func PossibleValuesForH265VideoProfile() []string {
return []string{
string(H265VideoProfileAuto),
string(H265VideoProfileMain),
string(H265VideoProfileMainOneZero),
}
}
func (s *H265VideoProfile) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseH265VideoProfile(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseH265VideoProfile(input string) (*H265VideoProfile, error) {
vals := map[string]H265VideoProfile{
"auto": H265VideoProfileAuto,
"main": H265VideoProfileMain,
"main10": H265VideoProfileMainOneZero,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := H265VideoProfile(input)
return &out, nil
}
type InsightsType string
const (
InsightsTypeAllInsights InsightsType = "AllInsights"
InsightsTypeAudioInsightsOnly InsightsType = "AudioInsightsOnly"
InsightsTypeVideoInsightsOnly InsightsType = "VideoInsightsOnly"
)
func PossibleValuesForInsightsType() []string {
return []string{
string(InsightsTypeAllInsights),
string(InsightsTypeAudioInsightsOnly),
string(InsightsTypeVideoInsightsOnly),
}
}
func (s *InsightsType) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseInsightsType(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseInsightsType(input string) (*InsightsType, error) {
vals := map[string]InsightsType{
"allinsights": InsightsTypeAllInsights,
"audioinsightsonly": InsightsTypeAudioInsightsOnly,
"videoinsightsonly": InsightsTypeVideoInsightsOnly,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := InsightsType(input)
return &out, nil
}
type InterleaveOutput string
const (
InterleaveOutputInterleavedOutput InterleaveOutput = "InterleavedOutput"
InterleaveOutputNonInterleavedOutput InterleaveOutput = "NonInterleavedOutput"
)
func PossibleValuesForInterleaveOutput() []string {
return []string{
string(InterleaveOutputInterleavedOutput),
string(InterleaveOutputNonInterleavedOutput),
}
}
func (s *InterleaveOutput) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseInterleaveOutput(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseInterleaveOutput(input string) (*InterleaveOutput, error) {
vals := map[string]InterleaveOutput{
"interleavedoutput": InterleaveOutputInterleavedOutput,
"noninterleavedoutput": InterleaveOutputNonInterleavedOutput,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := InterleaveOutput(input)
return &out, nil
}
type JobErrorCategory string
const (
JobErrorCategoryConfiguration JobErrorCategory = "Configuration"
JobErrorCategoryContent JobErrorCategory = "Content"
JobErrorCategoryDownload JobErrorCategory = "Download"
JobErrorCategoryService JobErrorCategory = "Service"
JobErrorCategoryUpload JobErrorCategory = "Upload"
)
func PossibleValuesForJobErrorCategory() []string {
return []string{
string(JobErrorCategoryConfiguration),
string(JobErrorCategoryContent),
string(JobErrorCategoryDownload),
string(JobErrorCategoryService),
string(JobErrorCategoryUpload),
}
}
func (s *JobErrorCategory) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseJobErrorCategory(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseJobErrorCategory(input string) (*JobErrorCategory, error) {
vals := map[string]JobErrorCategory{
"configuration": JobErrorCategoryConfiguration,
"content": JobErrorCategoryContent,
"download": JobErrorCategoryDownload,
"service": JobErrorCategoryService,
"upload": JobErrorCategoryUpload,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := JobErrorCategory(input)
return &out, nil
}
type JobErrorCode string
const (
JobErrorCodeConfigurationUnsupported JobErrorCode = "ConfigurationUnsupported"
JobErrorCodeContentMalformed JobErrorCode = "ContentMalformed"
JobErrorCodeContentUnsupported JobErrorCode = "ContentUnsupported"
JobErrorCodeDownloadNotAccessible JobErrorCode = "DownloadNotAccessible"
JobErrorCodeDownloadTransientError JobErrorCode = "DownloadTransientError"
JobErrorCodeServiceError JobErrorCode = "ServiceError"
JobErrorCodeServiceTransientError JobErrorCode = "ServiceTransientError"
JobErrorCodeUploadNotAccessible JobErrorCode = "UploadNotAccessible"
JobErrorCodeUploadTransientError JobErrorCode = "UploadTransientError"
)
func PossibleValuesForJobErrorCode() []string {
return []string{
string(JobErrorCodeConfigurationUnsupported),
string(JobErrorCodeContentMalformed),
string(JobErrorCodeContentUnsupported),
string(JobErrorCodeDownloadNotAccessible),
string(JobErrorCodeDownloadTransientError),
string(JobErrorCodeServiceError),
string(JobErrorCodeServiceTransientError),
string(JobErrorCodeUploadNotAccessible),
string(JobErrorCodeUploadTransientError),
}
}
func (s *JobErrorCode) UnmarshalJSON(bytes []byte) error {
var decoded string
if err := json.Unmarshal(bytes, &decoded); err != nil {
return fmt.Errorf("unmarshaling: %+v", err)
}
out, err := parseJobErrorCode(decoded)
if err != nil {
return fmt.Errorf("parsing %q: %+v", decoded, err)
}
*s = *out
return nil
}
func parseJobErrorCode(input string) (*JobErrorCode, error) {
vals := map[string]JobErrorCode{
"configurationunsupported": JobErrorCodeConfigurationUnsupported,
"contentmalformed": JobErrorCodeContentMalformed,
"contentunsupported": JobErrorCodeContentUnsupported,