generated from pulumi/pulumi-tf-provider-boilerplate
/
liveTranscodeRuleAttachment.go
358 lines (306 loc) · 14.8 KB
/
liveTranscodeRuleAttachment.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
// 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 css
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a resource to create a css liveTranscodeRuleAttachment
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Css"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// task, err := Css.NewPullStreamTask(ctx, "task", &Css.PullStreamTaskArgs{
// SourceType: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// SourceUrls: pulumi.StringArray{
// pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// },
// DomainName: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// AppName: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// StreamName: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// StartTime: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// EndTime: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// Operator: pulumi.String(fmt.Sprintf("%v%v", "%", "s")),
// Comment: pulumi.String("This is a demo."),
// })
// if err != nil {
// return err
// }
// temp, err := Css.NewLiveTranscodeTemplate(ctx, "temp", &Css.LiveTranscodeTemplateArgs{
// TemplateName: pulumi.String("xxx"),
// Acodec: pulumi.String("aac"),
// VideoBitrate: pulumi.Int(100),
// Vcodec: pulumi.String("origin"),
// Description: pulumi.String("This_is_a_tf_test_temp."),
// NeedVideo: pulumi.Int(1),
// NeedAudio: pulumi.Int(1),
// })
// if err != nil {
// return err
// }
// _, err = Css.NewLiveTranscodeRuleAttachment(ctx, "liveTranscodeRuleAttachment", &Css.LiveTranscodeRuleAttachmentArgs{
// DomainName: task.DomainName,
// AppName: task.AppName,
// StreamName: task.StreamName,
// TemplateId: temp.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// css live_transcode_rule_attachment can be imported using the id, e.g.
//
// ```sh
// $ pulumi import tencentcloud:Css/liveTranscodeRuleAttachment:LiveTranscodeRuleAttachment live_transcode_rule_attachment liveTranscodeRuleAttachment_id
// ```
type LiveTranscodeRuleAttachment struct {
pulumi.CustomResourceState
// app name which you want to bind, can be empty string if not binding specific app name.
AppName pulumi.StringOutput `pulumi:"appName"`
// create time.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// domain name hich you want to bind the transcode template.
DomainName pulumi.StringOutput `pulumi:"domainName"`
// stream name which you want to bind, can be empty string if not binding specific stream.
StreamName pulumi.StringOutput `pulumi:"streamName"`
// template created by css_live_transcode_template.
TemplateId pulumi.IntOutput `pulumi:"templateId"`
// update time.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewLiveTranscodeRuleAttachment registers a new resource with the given unique name, arguments, and options.
func NewLiveTranscodeRuleAttachment(ctx *pulumi.Context,
name string, args *LiveTranscodeRuleAttachmentArgs, opts ...pulumi.ResourceOption) (*LiveTranscodeRuleAttachment, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AppName == nil {
return nil, errors.New("invalid value for required argument 'AppName'")
}
if args.DomainName == nil {
return nil, errors.New("invalid value for required argument 'DomainName'")
}
if args.StreamName == nil {
return nil, errors.New("invalid value for required argument 'StreamName'")
}
if args.TemplateId == nil {
return nil, errors.New("invalid value for required argument 'TemplateId'")
}
opts = pkgResourceDefaultOpts(opts)
var resource LiveTranscodeRuleAttachment
err := ctx.RegisterResource("tencentcloud:Css/liveTranscodeRuleAttachment:LiveTranscodeRuleAttachment", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetLiveTranscodeRuleAttachment gets an existing LiveTranscodeRuleAttachment 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 GetLiveTranscodeRuleAttachment(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *LiveTranscodeRuleAttachmentState, opts ...pulumi.ResourceOption) (*LiveTranscodeRuleAttachment, error) {
var resource LiveTranscodeRuleAttachment
err := ctx.ReadResource("tencentcloud:Css/liveTranscodeRuleAttachment:LiveTranscodeRuleAttachment", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering LiveTranscodeRuleAttachment resources.
type liveTranscodeRuleAttachmentState struct {
// app name which you want to bind, can be empty string if not binding specific app name.
AppName *string `pulumi:"appName"`
// create time.
CreateTime *string `pulumi:"createTime"`
// domain name hich you want to bind the transcode template.
DomainName *string `pulumi:"domainName"`
// stream name which you want to bind, can be empty string if not binding specific stream.
StreamName *string `pulumi:"streamName"`
// template created by css_live_transcode_template.
TemplateId *int `pulumi:"templateId"`
// update time.
UpdateTime *string `pulumi:"updateTime"`
}
type LiveTranscodeRuleAttachmentState struct {
// app name which you want to bind, can be empty string if not binding specific app name.
AppName pulumi.StringPtrInput
// create time.
CreateTime pulumi.StringPtrInput
// domain name hich you want to bind the transcode template.
DomainName pulumi.StringPtrInput
// stream name which you want to bind, can be empty string if not binding specific stream.
StreamName pulumi.StringPtrInput
// template created by css_live_transcode_template.
TemplateId pulumi.IntPtrInput
// update time.
UpdateTime pulumi.StringPtrInput
}
func (LiveTranscodeRuleAttachmentState) ElementType() reflect.Type {
return reflect.TypeOf((*liveTranscodeRuleAttachmentState)(nil)).Elem()
}
type liveTranscodeRuleAttachmentArgs struct {
// app name which you want to bind, can be empty string if not binding specific app name.
AppName string `pulumi:"appName"`
// domain name hich you want to bind the transcode template.
DomainName string `pulumi:"domainName"`
// stream name which you want to bind, can be empty string if not binding specific stream.
StreamName string `pulumi:"streamName"`
// template created by css_live_transcode_template.
TemplateId int `pulumi:"templateId"`
}
// The set of arguments for constructing a LiveTranscodeRuleAttachment resource.
type LiveTranscodeRuleAttachmentArgs struct {
// app name which you want to bind, can be empty string if not binding specific app name.
AppName pulumi.StringInput
// domain name hich you want to bind the transcode template.
DomainName pulumi.StringInput
// stream name which you want to bind, can be empty string if not binding specific stream.
StreamName pulumi.StringInput
// template created by css_live_transcode_template.
TemplateId pulumi.IntInput
}
func (LiveTranscodeRuleAttachmentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*liveTranscodeRuleAttachmentArgs)(nil)).Elem()
}
type LiveTranscodeRuleAttachmentInput interface {
pulumi.Input
ToLiveTranscodeRuleAttachmentOutput() LiveTranscodeRuleAttachmentOutput
ToLiveTranscodeRuleAttachmentOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentOutput
}
func (*LiveTranscodeRuleAttachment) ElementType() reflect.Type {
return reflect.TypeOf((**LiveTranscodeRuleAttachment)(nil)).Elem()
}
func (i *LiveTranscodeRuleAttachment) ToLiveTranscodeRuleAttachmentOutput() LiveTranscodeRuleAttachmentOutput {
return i.ToLiveTranscodeRuleAttachmentOutputWithContext(context.Background())
}
func (i *LiveTranscodeRuleAttachment) ToLiveTranscodeRuleAttachmentOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentOutput {
return pulumi.ToOutputWithContext(ctx, i).(LiveTranscodeRuleAttachmentOutput)
}
// LiveTranscodeRuleAttachmentArrayInput is an input type that accepts LiveTranscodeRuleAttachmentArray and LiveTranscodeRuleAttachmentArrayOutput values.
// You can construct a concrete instance of `LiveTranscodeRuleAttachmentArrayInput` via:
//
// LiveTranscodeRuleAttachmentArray{ LiveTranscodeRuleAttachmentArgs{...} }
type LiveTranscodeRuleAttachmentArrayInput interface {
pulumi.Input
ToLiveTranscodeRuleAttachmentArrayOutput() LiveTranscodeRuleAttachmentArrayOutput
ToLiveTranscodeRuleAttachmentArrayOutputWithContext(context.Context) LiveTranscodeRuleAttachmentArrayOutput
}
type LiveTranscodeRuleAttachmentArray []LiveTranscodeRuleAttachmentInput
func (LiveTranscodeRuleAttachmentArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LiveTranscodeRuleAttachment)(nil)).Elem()
}
func (i LiveTranscodeRuleAttachmentArray) ToLiveTranscodeRuleAttachmentArrayOutput() LiveTranscodeRuleAttachmentArrayOutput {
return i.ToLiveTranscodeRuleAttachmentArrayOutputWithContext(context.Background())
}
func (i LiveTranscodeRuleAttachmentArray) ToLiveTranscodeRuleAttachmentArrayOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(LiveTranscodeRuleAttachmentArrayOutput)
}
// LiveTranscodeRuleAttachmentMapInput is an input type that accepts LiveTranscodeRuleAttachmentMap and LiveTranscodeRuleAttachmentMapOutput values.
// You can construct a concrete instance of `LiveTranscodeRuleAttachmentMapInput` via:
//
// LiveTranscodeRuleAttachmentMap{ "key": LiveTranscodeRuleAttachmentArgs{...} }
type LiveTranscodeRuleAttachmentMapInput interface {
pulumi.Input
ToLiveTranscodeRuleAttachmentMapOutput() LiveTranscodeRuleAttachmentMapOutput
ToLiveTranscodeRuleAttachmentMapOutputWithContext(context.Context) LiveTranscodeRuleAttachmentMapOutput
}
type LiveTranscodeRuleAttachmentMap map[string]LiveTranscodeRuleAttachmentInput
func (LiveTranscodeRuleAttachmentMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LiveTranscodeRuleAttachment)(nil)).Elem()
}
func (i LiveTranscodeRuleAttachmentMap) ToLiveTranscodeRuleAttachmentMapOutput() LiveTranscodeRuleAttachmentMapOutput {
return i.ToLiveTranscodeRuleAttachmentMapOutputWithContext(context.Background())
}
func (i LiveTranscodeRuleAttachmentMap) ToLiveTranscodeRuleAttachmentMapOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(LiveTranscodeRuleAttachmentMapOutput)
}
type LiveTranscodeRuleAttachmentOutput struct{ *pulumi.OutputState }
func (LiveTranscodeRuleAttachmentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**LiveTranscodeRuleAttachment)(nil)).Elem()
}
func (o LiveTranscodeRuleAttachmentOutput) ToLiveTranscodeRuleAttachmentOutput() LiveTranscodeRuleAttachmentOutput {
return o
}
func (o LiveTranscodeRuleAttachmentOutput) ToLiveTranscodeRuleAttachmentOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentOutput {
return o
}
// app name which you want to bind, can be empty string if not binding specific app name.
func (o LiveTranscodeRuleAttachmentOutput) AppName() pulumi.StringOutput {
return o.ApplyT(func(v *LiveTranscodeRuleAttachment) pulumi.StringOutput { return v.AppName }).(pulumi.StringOutput)
}
// create time.
func (o LiveTranscodeRuleAttachmentOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *LiveTranscodeRuleAttachment) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// domain name hich you want to bind the transcode template.
func (o LiveTranscodeRuleAttachmentOutput) DomainName() pulumi.StringOutput {
return o.ApplyT(func(v *LiveTranscodeRuleAttachment) pulumi.StringOutput { return v.DomainName }).(pulumi.StringOutput)
}
// stream name which you want to bind, can be empty string if not binding specific stream.
func (o LiveTranscodeRuleAttachmentOutput) StreamName() pulumi.StringOutput {
return o.ApplyT(func(v *LiveTranscodeRuleAttachment) pulumi.StringOutput { return v.StreamName }).(pulumi.StringOutput)
}
// template created by css_live_transcode_template.
func (o LiveTranscodeRuleAttachmentOutput) TemplateId() pulumi.IntOutput {
return o.ApplyT(func(v *LiveTranscodeRuleAttachment) pulumi.IntOutput { return v.TemplateId }).(pulumi.IntOutput)
}
// update time.
func (o LiveTranscodeRuleAttachmentOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *LiveTranscodeRuleAttachment) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
type LiveTranscodeRuleAttachmentArrayOutput struct{ *pulumi.OutputState }
func (LiveTranscodeRuleAttachmentArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*LiveTranscodeRuleAttachment)(nil)).Elem()
}
func (o LiveTranscodeRuleAttachmentArrayOutput) ToLiveTranscodeRuleAttachmentArrayOutput() LiveTranscodeRuleAttachmentArrayOutput {
return o
}
func (o LiveTranscodeRuleAttachmentArrayOutput) ToLiveTranscodeRuleAttachmentArrayOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentArrayOutput {
return o
}
func (o LiveTranscodeRuleAttachmentArrayOutput) Index(i pulumi.IntInput) LiveTranscodeRuleAttachmentOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LiveTranscodeRuleAttachment {
return vs[0].([]*LiveTranscodeRuleAttachment)[vs[1].(int)]
}).(LiveTranscodeRuleAttachmentOutput)
}
type LiveTranscodeRuleAttachmentMapOutput struct{ *pulumi.OutputState }
func (LiveTranscodeRuleAttachmentMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*LiveTranscodeRuleAttachment)(nil)).Elem()
}
func (o LiveTranscodeRuleAttachmentMapOutput) ToLiveTranscodeRuleAttachmentMapOutput() LiveTranscodeRuleAttachmentMapOutput {
return o
}
func (o LiveTranscodeRuleAttachmentMapOutput) ToLiveTranscodeRuleAttachmentMapOutputWithContext(ctx context.Context) LiveTranscodeRuleAttachmentMapOutput {
return o
}
func (o LiveTranscodeRuleAttachmentMapOutput) MapIndex(k pulumi.StringInput) LiveTranscodeRuleAttachmentOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LiveTranscodeRuleAttachment {
return vs[0].(map[string]*LiveTranscodeRuleAttachment)[vs[1].(string)]
}).(LiveTranscodeRuleAttachmentOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*LiveTranscodeRuleAttachmentInput)(nil)).Elem(), &LiveTranscodeRuleAttachment{})
pulumi.RegisterInputType(reflect.TypeOf((*LiveTranscodeRuleAttachmentArrayInput)(nil)).Elem(), LiveTranscodeRuleAttachmentArray{})
pulumi.RegisterInputType(reflect.TypeOf((*LiveTranscodeRuleAttachmentMapInput)(nil)).Elem(), LiveTranscodeRuleAttachmentMap{})
pulumi.RegisterOutputType(LiveTranscodeRuleAttachmentOutput{})
pulumi.RegisterOutputType(LiveTranscodeRuleAttachmentArrayOutput{})
pulumi.RegisterOutputType(LiveTranscodeRuleAttachmentMapOutput{})
}