generated from pulumi/pulumi-tf-provider-boilerplate
/
watermark.go
307 lines (254 loc) · 9.51 KB
/
watermark.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
// 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"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Watermark struct {
pulumi.CustomResourceState
// height of the picture.
Height pulumi.IntPtrOutput `pulumi:"height"`
// watermark url.
PictureUrl pulumi.StringOutput `pulumi:"pictureUrl"`
// status. 0: not used, 1: used.
Status pulumi.IntOutput `pulumi:"status"`
// watermark name.
WatermarkName pulumi.StringOutput `pulumi:"watermarkName"`
// width of the picture.
Width pulumi.IntPtrOutput `pulumi:"width"`
// x position of the picture.
XPosition pulumi.IntPtrOutput `pulumi:"xPosition"`
// y position of the picture.
YPosition pulumi.IntPtrOutput `pulumi:"yPosition"`
}
// NewWatermark registers a new resource with the given unique name, arguments, and options.
func NewWatermark(ctx *pulumi.Context,
name string, args *WatermarkArgs, opts ...pulumi.ResourceOption) (*Watermark, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.PictureUrl == nil {
return nil, errors.New("invalid value for required argument 'PictureUrl'")
}
if args.WatermarkName == nil {
return nil, errors.New("invalid value for required argument 'WatermarkName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Watermark
err := ctx.RegisterResource("tencentcloud:Css/watermark:Watermark", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetWatermark gets an existing Watermark 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 GetWatermark(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *WatermarkState, opts ...pulumi.ResourceOption) (*Watermark, error) {
var resource Watermark
err := ctx.ReadResource("tencentcloud:Css/watermark:Watermark", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Watermark resources.
type watermarkState struct {
// height of the picture.
Height *int `pulumi:"height"`
// watermark url.
PictureUrl *string `pulumi:"pictureUrl"`
// status. 0: not used, 1: used.
Status *int `pulumi:"status"`
// watermark name.
WatermarkName *string `pulumi:"watermarkName"`
// width of the picture.
Width *int `pulumi:"width"`
// x position of the picture.
XPosition *int `pulumi:"xPosition"`
// y position of the picture.
YPosition *int `pulumi:"yPosition"`
}
type WatermarkState struct {
// height of the picture.
Height pulumi.IntPtrInput
// watermark url.
PictureUrl pulumi.StringPtrInput
// status. 0: not used, 1: used.
Status pulumi.IntPtrInput
// watermark name.
WatermarkName pulumi.StringPtrInput
// width of the picture.
Width pulumi.IntPtrInput
// x position of the picture.
XPosition pulumi.IntPtrInput
// y position of the picture.
YPosition pulumi.IntPtrInput
}
func (WatermarkState) ElementType() reflect.Type {
return reflect.TypeOf((*watermarkState)(nil)).Elem()
}
type watermarkArgs struct {
// height of the picture.
Height *int `pulumi:"height"`
// watermark url.
PictureUrl string `pulumi:"pictureUrl"`
// watermark name.
WatermarkName string `pulumi:"watermarkName"`
// width of the picture.
Width *int `pulumi:"width"`
// x position of the picture.
XPosition *int `pulumi:"xPosition"`
// y position of the picture.
YPosition *int `pulumi:"yPosition"`
}
// The set of arguments for constructing a Watermark resource.
type WatermarkArgs struct {
// height of the picture.
Height pulumi.IntPtrInput
// watermark url.
PictureUrl pulumi.StringInput
// watermark name.
WatermarkName pulumi.StringInput
// width of the picture.
Width pulumi.IntPtrInput
// x position of the picture.
XPosition pulumi.IntPtrInput
// y position of the picture.
YPosition pulumi.IntPtrInput
}
func (WatermarkArgs) ElementType() reflect.Type {
return reflect.TypeOf((*watermarkArgs)(nil)).Elem()
}
type WatermarkInput interface {
pulumi.Input
ToWatermarkOutput() WatermarkOutput
ToWatermarkOutputWithContext(ctx context.Context) WatermarkOutput
}
func (*Watermark) ElementType() reflect.Type {
return reflect.TypeOf((**Watermark)(nil)).Elem()
}
func (i *Watermark) ToWatermarkOutput() WatermarkOutput {
return i.ToWatermarkOutputWithContext(context.Background())
}
func (i *Watermark) ToWatermarkOutputWithContext(ctx context.Context) WatermarkOutput {
return pulumi.ToOutputWithContext(ctx, i).(WatermarkOutput)
}
// WatermarkArrayInput is an input type that accepts WatermarkArray and WatermarkArrayOutput values.
// You can construct a concrete instance of `WatermarkArrayInput` via:
//
// WatermarkArray{ WatermarkArgs{...} }
type WatermarkArrayInput interface {
pulumi.Input
ToWatermarkArrayOutput() WatermarkArrayOutput
ToWatermarkArrayOutputWithContext(context.Context) WatermarkArrayOutput
}
type WatermarkArray []WatermarkInput
func (WatermarkArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Watermark)(nil)).Elem()
}
func (i WatermarkArray) ToWatermarkArrayOutput() WatermarkArrayOutput {
return i.ToWatermarkArrayOutputWithContext(context.Background())
}
func (i WatermarkArray) ToWatermarkArrayOutputWithContext(ctx context.Context) WatermarkArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(WatermarkArrayOutput)
}
// WatermarkMapInput is an input type that accepts WatermarkMap and WatermarkMapOutput values.
// You can construct a concrete instance of `WatermarkMapInput` via:
//
// WatermarkMap{ "key": WatermarkArgs{...} }
type WatermarkMapInput interface {
pulumi.Input
ToWatermarkMapOutput() WatermarkMapOutput
ToWatermarkMapOutputWithContext(context.Context) WatermarkMapOutput
}
type WatermarkMap map[string]WatermarkInput
func (WatermarkMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Watermark)(nil)).Elem()
}
func (i WatermarkMap) ToWatermarkMapOutput() WatermarkMapOutput {
return i.ToWatermarkMapOutputWithContext(context.Background())
}
func (i WatermarkMap) ToWatermarkMapOutputWithContext(ctx context.Context) WatermarkMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(WatermarkMapOutput)
}
type WatermarkOutput struct{ *pulumi.OutputState }
func (WatermarkOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Watermark)(nil)).Elem()
}
func (o WatermarkOutput) ToWatermarkOutput() WatermarkOutput {
return o
}
func (o WatermarkOutput) ToWatermarkOutputWithContext(ctx context.Context) WatermarkOutput {
return o
}
// height of the picture.
func (o WatermarkOutput) Height() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Watermark) pulumi.IntPtrOutput { return v.Height }).(pulumi.IntPtrOutput)
}
// watermark url.
func (o WatermarkOutput) PictureUrl() pulumi.StringOutput {
return o.ApplyT(func(v *Watermark) pulumi.StringOutput { return v.PictureUrl }).(pulumi.StringOutput)
}
// status. 0: not used, 1: used.
func (o WatermarkOutput) Status() pulumi.IntOutput {
return o.ApplyT(func(v *Watermark) pulumi.IntOutput { return v.Status }).(pulumi.IntOutput)
}
// watermark name.
func (o WatermarkOutput) WatermarkName() pulumi.StringOutput {
return o.ApplyT(func(v *Watermark) pulumi.StringOutput { return v.WatermarkName }).(pulumi.StringOutput)
}
// width of the picture.
func (o WatermarkOutput) Width() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Watermark) pulumi.IntPtrOutput { return v.Width }).(pulumi.IntPtrOutput)
}
// x position of the picture.
func (o WatermarkOutput) XPosition() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Watermark) pulumi.IntPtrOutput { return v.XPosition }).(pulumi.IntPtrOutput)
}
// y position of the picture.
func (o WatermarkOutput) YPosition() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Watermark) pulumi.IntPtrOutput { return v.YPosition }).(pulumi.IntPtrOutput)
}
type WatermarkArrayOutput struct{ *pulumi.OutputState }
func (WatermarkArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Watermark)(nil)).Elem()
}
func (o WatermarkArrayOutput) ToWatermarkArrayOutput() WatermarkArrayOutput {
return o
}
func (o WatermarkArrayOutput) ToWatermarkArrayOutputWithContext(ctx context.Context) WatermarkArrayOutput {
return o
}
func (o WatermarkArrayOutput) Index(i pulumi.IntInput) WatermarkOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Watermark {
return vs[0].([]*Watermark)[vs[1].(int)]
}).(WatermarkOutput)
}
type WatermarkMapOutput struct{ *pulumi.OutputState }
func (WatermarkMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Watermark)(nil)).Elem()
}
func (o WatermarkMapOutput) ToWatermarkMapOutput() WatermarkMapOutput {
return o
}
func (o WatermarkMapOutput) ToWatermarkMapOutputWithContext(ctx context.Context) WatermarkMapOutput {
return o
}
func (o WatermarkMapOutput) MapIndex(k pulumi.StringInput) WatermarkOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Watermark {
return vs[0].(map[string]*Watermark)[vs[1].(string)]
}).(WatermarkOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*WatermarkInput)(nil)).Elem(), &Watermark{})
pulumi.RegisterInputType(reflect.TypeOf((*WatermarkArrayInput)(nil)).Elem(), WatermarkArray{})
pulumi.RegisterInputType(reflect.TypeOf((*WatermarkMapInput)(nil)).Elem(), WatermarkMap{})
pulumi.RegisterOutputType(WatermarkOutput{})
pulumi.RegisterOutputType(WatermarkArrayOutput{})
pulumi.RegisterOutputType(WatermarkMapOutput{})
}