generated from pulumi/pulumi-tf-provider-boilerplate
/
transcodingTemplate.go
438 lines (384 loc) · 18 KB
/
transcodingTemplate.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package mpc
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages an MPC transcoding template resource within HuaweiCloud.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Mpc"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Mpc"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Mpc.NewTranscodingTemplate(ctx, "test", &Mpc.TranscodingTemplateArgs{
// Audio: &mpc.TranscodingTemplateAudioArgs{
// Bitrate: pulumi.Int(0),
// Channels: pulumi.Int(2),
// Codec: pulumi.Int(2),
// OutputPolicy: pulumi.String("transcode"),
// SampleRate: pulumi.Int(1),
// },
// DashSegmentDuration: pulumi.Int(5),
// HlsSegmentDuration: pulumi.Int(5),
// LowBitrateHd: pulumi.Bool(true),
// OutputFormat: pulumi.Int(1),
// Video: &mpc.TranscodingTemplateVideoArgs{
// Bitrate: pulumi.Int(0),
// BlackBarRemoval: pulumi.Int(0),
// Codec: pulumi.Int(2),
// Fps: pulumi.Int(0),
// Height: pulumi.Int(0),
// Level: pulumi.Int(15),
// MaxConsecutiveBframes: pulumi.Int(7),
// MaxIframesInterval: pulumi.Int(5),
// OutputPolicy: pulumi.String("transcode"),
// Profile: pulumi.Int(4),
// Quality: pulumi.Int(1),
// Width: pulumi.Int(0),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// MPC transcoding templates can be imported using the `id`, e.g.
//
// ```sh
//
// $ pulumi import huaweicloud:Mpc/transcodingTemplate:TranscodingTemplate test 542899
//
// ```
type TranscodingTemplate struct {
pulumi.CustomResourceState
// Specifies the audio parameters. The object structure is documented below.
Audio TranscodingTemplateAudioPtrOutput `pulumi:"audio"`
// Specifies the dash segment duration. This parameter is used only when `outputFormat`
// is set to 2 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
DashSegmentDuration pulumi.IntPtrOutput `pulumi:"dashSegmentDuration"`
// Specifies the HLS segment duration. This parameter is used only
// when `outputFormat` is set to 1 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
HlsSegmentDuration pulumi.IntPtrOutput `pulumi:"hlsSegmentDuration"`
// Specifies Whether to enable low bitrate HD. The default value is false.
LowBitrateHd pulumi.BoolPtrOutput `pulumi:"lowBitrateHd"`
// Specifies the name of a transcoding template.
Name pulumi.StringOutput `pulumi:"name"`
// Specifies the packaging type. Possible values are:
// + **1**: HLS
// + **2**: DASH
// + **3**: HLS+DASH
// + **4**: MP4
// + **5**: MP3
// + **6**: ADTS
OutputFormat pulumi.IntOutput `pulumi:"outputFormat"`
// The region in which to create the transcoding template resource. If omitted,
// the provider-level region will be used. Changing this creates a new resource.
Region pulumi.StringOutput `pulumi:"region"`
// Specifies the video parameters. The object structure is documented below.
Video TranscodingTemplateVideoPtrOutput `pulumi:"video"`
}
// NewTranscodingTemplate registers a new resource with the given unique name, arguments, and options.
func NewTranscodingTemplate(ctx *pulumi.Context,
name string, args *TranscodingTemplateArgs, opts ...pulumi.ResourceOption) (*TranscodingTemplate, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.OutputFormat == nil {
return nil, errors.New("invalid value for required argument 'OutputFormat'")
}
opts = pkgResourceDefaultOpts(opts)
var resource TranscodingTemplate
err := ctx.RegisterResource("huaweicloud:Mpc/transcodingTemplate:TranscodingTemplate", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTranscodingTemplate gets an existing TranscodingTemplate resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetTranscodingTemplate(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TranscodingTemplateState, opts ...pulumi.ResourceOption) (*TranscodingTemplate, error) {
var resource TranscodingTemplate
err := ctx.ReadResource("huaweicloud:Mpc/transcodingTemplate:TranscodingTemplate", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TranscodingTemplate resources.
type transcodingTemplateState struct {
// Specifies the audio parameters. The object structure is documented below.
Audio *TranscodingTemplateAudio `pulumi:"audio"`
// Specifies the dash segment duration. This parameter is used only when `outputFormat`
// is set to 2 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
DashSegmentDuration *int `pulumi:"dashSegmentDuration"`
// Specifies the HLS segment duration. This parameter is used only
// when `outputFormat` is set to 1 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
HlsSegmentDuration *int `pulumi:"hlsSegmentDuration"`
// Specifies Whether to enable low bitrate HD. The default value is false.
LowBitrateHd *bool `pulumi:"lowBitrateHd"`
// Specifies the name of a transcoding template.
Name *string `pulumi:"name"`
// Specifies the packaging type. Possible values are:
// + **1**: HLS
// + **2**: DASH
// + **3**: HLS+DASH
// + **4**: MP4
// + **5**: MP3
// + **6**: ADTS
OutputFormat *int `pulumi:"outputFormat"`
// The region in which to create the transcoding template resource. If omitted,
// the provider-level region will be used. Changing this creates a new resource.
Region *string `pulumi:"region"`
// Specifies the video parameters. The object structure is documented below.
Video *TranscodingTemplateVideo `pulumi:"video"`
}
type TranscodingTemplateState struct {
// Specifies the audio parameters. The object structure is documented below.
Audio TranscodingTemplateAudioPtrInput
// Specifies the dash segment duration. This parameter is used only when `outputFormat`
// is set to 2 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
DashSegmentDuration pulumi.IntPtrInput
// Specifies the HLS segment duration. This parameter is used only
// when `outputFormat` is set to 1 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
HlsSegmentDuration pulumi.IntPtrInput
// Specifies Whether to enable low bitrate HD. The default value is false.
LowBitrateHd pulumi.BoolPtrInput
// Specifies the name of a transcoding template.
Name pulumi.StringPtrInput
// Specifies the packaging type. Possible values are:
// + **1**: HLS
// + **2**: DASH
// + **3**: HLS+DASH
// + **4**: MP4
// + **5**: MP3
// + **6**: ADTS
OutputFormat pulumi.IntPtrInput
// The region in which to create the transcoding template resource. If omitted,
// the provider-level region will be used. Changing this creates a new resource.
Region pulumi.StringPtrInput
// Specifies the video parameters. The object structure is documented below.
Video TranscodingTemplateVideoPtrInput
}
func (TranscodingTemplateState) ElementType() reflect.Type {
return reflect.TypeOf((*transcodingTemplateState)(nil)).Elem()
}
type transcodingTemplateArgs struct {
// Specifies the audio parameters. The object structure is documented below.
Audio *TranscodingTemplateAudio `pulumi:"audio"`
// Specifies the dash segment duration. This parameter is used only when `outputFormat`
// is set to 2 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
DashSegmentDuration *int `pulumi:"dashSegmentDuration"`
// Specifies the HLS segment duration. This parameter is used only
// when `outputFormat` is set to 1 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
HlsSegmentDuration *int `pulumi:"hlsSegmentDuration"`
// Specifies Whether to enable low bitrate HD. The default value is false.
LowBitrateHd *bool `pulumi:"lowBitrateHd"`
// Specifies the name of a transcoding template.
Name *string `pulumi:"name"`
// Specifies the packaging type. Possible values are:
// + **1**: HLS
// + **2**: DASH
// + **3**: HLS+DASH
// + **4**: MP4
// + **5**: MP3
// + **6**: ADTS
OutputFormat int `pulumi:"outputFormat"`
// The region in which to create the transcoding template resource. If omitted,
// the provider-level region will be used. Changing this creates a new resource.
Region *string `pulumi:"region"`
// Specifies the video parameters. The object structure is documented below.
Video *TranscodingTemplateVideo `pulumi:"video"`
}
// The set of arguments for constructing a TranscodingTemplate resource.
type TranscodingTemplateArgs struct {
// Specifies the audio parameters. The object structure is documented below.
Audio TranscodingTemplateAudioPtrInput
// Specifies the dash segment duration. This parameter is used only when `outputFormat`
// is set to 2 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
DashSegmentDuration pulumi.IntPtrInput
// Specifies the HLS segment duration. This parameter is used only
// when `outputFormat` is set to 1 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
HlsSegmentDuration pulumi.IntPtrInput
// Specifies Whether to enable low bitrate HD. The default value is false.
LowBitrateHd pulumi.BoolPtrInput
// Specifies the name of a transcoding template.
Name pulumi.StringPtrInput
// Specifies the packaging type. Possible values are:
// + **1**: HLS
// + **2**: DASH
// + **3**: HLS+DASH
// + **4**: MP4
// + **5**: MP3
// + **6**: ADTS
OutputFormat pulumi.IntInput
// The region in which to create the transcoding template resource. If omitted,
// the provider-level region will be used. Changing this creates a new resource.
Region pulumi.StringPtrInput
// Specifies the video parameters. The object structure is documented below.
Video TranscodingTemplateVideoPtrInput
}
func (TranscodingTemplateArgs) ElementType() reflect.Type {
return reflect.TypeOf((*transcodingTemplateArgs)(nil)).Elem()
}
type TranscodingTemplateInput interface {
pulumi.Input
ToTranscodingTemplateOutput() TranscodingTemplateOutput
ToTranscodingTemplateOutputWithContext(ctx context.Context) TranscodingTemplateOutput
}
func (*TranscodingTemplate) ElementType() reflect.Type {
return reflect.TypeOf((**TranscodingTemplate)(nil)).Elem()
}
func (i *TranscodingTemplate) ToTranscodingTemplateOutput() TranscodingTemplateOutput {
return i.ToTranscodingTemplateOutputWithContext(context.Background())
}
func (i *TranscodingTemplate) ToTranscodingTemplateOutputWithContext(ctx context.Context) TranscodingTemplateOutput {
return pulumi.ToOutputWithContext(ctx, i).(TranscodingTemplateOutput)
}
// TranscodingTemplateArrayInput is an input type that accepts TranscodingTemplateArray and TranscodingTemplateArrayOutput values.
// You can construct a concrete instance of `TranscodingTemplateArrayInput` via:
//
// TranscodingTemplateArray{ TranscodingTemplateArgs{...} }
type TranscodingTemplateArrayInput interface {
pulumi.Input
ToTranscodingTemplateArrayOutput() TranscodingTemplateArrayOutput
ToTranscodingTemplateArrayOutputWithContext(context.Context) TranscodingTemplateArrayOutput
}
type TranscodingTemplateArray []TranscodingTemplateInput
func (TranscodingTemplateArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TranscodingTemplate)(nil)).Elem()
}
func (i TranscodingTemplateArray) ToTranscodingTemplateArrayOutput() TranscodingTemplateArrayOutput {
return i.ToTranscodingTemplateArrayOutputWithContext(context.Background())
}
func (i TranscodingTemplateArray) ToTranscodingTemplateArrayOutputWithContext(ctx context.Context) TranscodingTemplateArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TranscodingTemplateArrayOutput)
}
// TranscodingTemplateMapInput is an input type that accepts TranscodingTemplateMap and TranscodingTemplateMapOutput values.
// You can construct a concrete instance of `TranscodingTemplateMapInput` via:
//
// TranscodingTemplateMap{ "key": TranscodingTemplateArgs{...} }
type TranscodingTemplateMapInput interface {
pulumi.Input
ToTranscodingTemplateMapOutput() TranscodingTemplateMapOutput
ToTranscodingTemplateMapOutputWithContext(context.Context) TranscodingTemplateMapOutput
}
type TranscodingTemplateMap map[string]TranscodingTemplateInput
func (TranscodingTemplateMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TranscodingTemplate)(nil)).Elem()
}
func (i TranscodingTemplateMap) ToTranscodingTemplateMapOutput() TranscodingTemplateMapOutput {
return i.ToTranscodingTemplateMapOutputWithContext(context.Background())
}
func (i TranscodingTemplateMap) ToTranscodingTemplateMapOutputWithContext(ctx context.Context) TranscodingTemplateMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TranscodingTemplateMapOutput)
}
type TranscodingTemplateOutput struct{ *pulumi.OutputState }
func (TranscodingTemplateOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TranscodingTemplate)(nil)).Elem()
}
func (o TranscodingTemplateOutput) ToTranscodingTemplateOutput() TranscodingTemplateOutput {
return o
}
func (o TranscodingTemplateOutput) ToTranscodingTemplateOutputWithContext(ctx context.Context) TranscodingTemplateOutput {
return o
}
// Specifies the audio parameters. The object structure is documented below.
func (o TranscodingTemplateOutput) Audio() TranscodingTemplateAudioPtrOutput {
return o.ApplyT(func(v *TranscodingTemplate) TranscodingTemplateAudioPtrOutput { return v.Audio }).(TranscodingTemplateAudioPtrOutput)
}
// Specifies the dash segment duration. This parameter is used only when `outputFormat`
// is set to 2 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
func (o TranscodingTemplateOutput) DashSegmentDuration() pulumi.IntPtrOutput {
return o.ApplyT(func(v *TranscodingTemplate) pulumi.IntPtrOutput { return v.DashSegmentDuration }).(pulumi.IntPtrOutput)
}
// Specifies the HLS segment duration. This parameter is used only
// when `outputFormat` is set to 1 or 3. The value ranges from 2 to 10. The default value is 5. The unit is second.
func (o TranscodingTemplateOutput) HlsSegmentDuration() pulumi.IntPtrOutput {
return o.ApplyT(func(v *TranscodingTemplate) pulumi.IntPtrOutput { return v.HlsSegmentDuration }).(pulumi.IntPtrOutput)
}
// Specifies Whether to enable low bitrate HD. The default value is false.
func (o TranscodingTemplateOutput) LowBitrateHd() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *TranscodingTemplate) pulumi.BoolPtrOutput { return v.LowBitrateHd }).(pulumi.BoolPtrOutput)
}
// Specifies the name of a transcoding template.
func (o TranscodingTemplateOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *TranscodingTemplate) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Specifies the packaging type. Possible values are:
// + **1**: HLS
// + **2**: DASH
// + **3**: HLS+DASH
// + **4**: MP4
// + **5**: MP3
// + **6**: ADTS
func (o TranscodingTemplateOutput) OutputFormat() pulumi.IntOutput {
return o.ApplyT(func(v *TranscodingTemplate) pulumi.IntOutput { return v.OutputFormat }).(pulumi.IntOutput)
}
// The region in which to create the transcoding template resource. If omitted,
// the provider-level region will be used. Changing this creates a new resource.
func (o TranscodingTemplateOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v *TranscodingTemplate) pulumi.StringOutput { return v.Region }).(pulumi.StringOutput)
}
// Specifies the video parameters. The object structure is documented below.
func (o TranscodingTemplateOutput) Video() TranscodingTemplateVideoPtrOutput {
return o.ApplyT(func(v *TranscodingTemplate) TranscodingTemplateVideoPtrOutput { return v.Video }).(TranscodingTemplateVideoPtrOutput)
}
type TranscodingTemplateArrayOutput struct{ *pulumi.OutputState }
func (TranscodingTemplateArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TranscodingTemplate)(nil)).Elem()
}
func (o TranscodingTemplateArrayOutput) ToTranscodingTemplateArrayOutput() TranscodingTemplateArrayOutput {
return o
}
func (o TranscodingTemplateArrayOutput) ToTranscodingTemplateArrayOutputWithContext(ctx context.Context) TranscodingTemplateArrayOutput {
return o
}
func (o TranscodingTemplateArrayOutput) Index(i pulumi.IntInput) TranscodingTemplateOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TranscodingTemplate {
return vs[0].([]*TranscodingTemplate)[vs[1].(int)]
}).(TranscodingTemplateOutput)
}
type TranscodingTemplateMapOutput struct{ *pulumi.OutputState }
func (TranscodingTemplateMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TranscodingTemplate)(nil)).Elem()
}
func (o TranscodingTemplateMapOutput) ToTranscodingTemplateMapOutput() TranscodingTemplateMapOutput {
return o
}
func (o TranscodingTemplateMapOutput) ToTranscodingTemplateMapOutputWithContext(ctx context.Context) TranscodingTemplateMapOutput {
return o
}
func (o TranscodingTemplateMapOutput) MapIndex(k pulumi.StringInput) TranscodingTemplateOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TranscodingTemplate {
return vs[0].(map[string]*TranscodingTemplate)[vs[1].(string)]
}).(TranscodingTemplateOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TranscodingTemplateInput)(nil)).Elem(), &TranscodingTemplate{})
pulumi.RegisterInputType(reflect.TypeOf((*TranscodingTemplateArrayInput)(nil)).Elem(), TranscodingTemplateArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TranscodingTemplateMapInput)(nil)).Elem(), TranscodingTemplateMap{})
pulumi.RegisterOutputType(TranscodingTemplateOutput{})
pulumi.RegisterOutputType(TranscodingTemplateArrayOutput{})
pulumi.RegisterOutputType(TranscodingTemplateMapOutput{})
}