/
textChart.go
305 lines (255 loc) · 9.45 KB
/
textChart.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
// 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 signalfx
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-signalfx/sdk/v6/go/signalfx/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This special type of chart doesn’t display any metric data. Rather, it lets you place a text note on the dashboard.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-signalfx/sdk/v6/go/signalfx"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := signalfx.NewTextChart(ctx, "mynote0", &signalfx.TextChartArgs{
// Description: pulumi.String("Lorem ipsum dolor sit amet, laudem tibique iracundia at mea. Nam posse dolores ex, nec cu adhuc putent honestatis"),
// Markdown: pulumi.String(` 1. First ordered list item
// 2. Another item
// * Unordered sub-list.
// 1. Actual numbers don't matter, just that it's a number
// 1. Ordered sub-list
// 4. And another item.
//
// You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).
//
// To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅
// Note that this line is separate, but within the same paragraph.⋅⋅
// (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
//
// * Unordered list can use asterisks
// - Or minuses
// + Or pluses
//
// `),
//
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type TextChart struct {
pulumi.CustomResourceState
// Description of the text note.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Markdown text to display.
Markdown pulumi.StringOutput `pulumi:"markdown"`
// Name of the text note.
Name pulumi.StringOutput `pulumi:"name"`
// The URL of the chart.
Url pulumi.StringOutput `pulumi:"url"`
}
// NewTextChart registers a new resource with the given unique name, arguments, and options.
func NewTextChart(ctx *pulumi.Context,
name string, args *TextChartArgs, opts ...pulumi.ResourceOption) (*TextChart, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Markdown == nil {
return nil, errors.New("invalid value for required argument 'Markdown'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource TextChart
err := ctx.RegisterResource("signalfx:index/textChart:TextChart", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTextChart gets an existing TextChart 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 GetTextChart(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TextChartState, opts ...pulumi.ResourceOption) (*TextChart, error) {
var resource TextChart
err := ctx.ReadResource("signalfx:index/textChart:TextChart", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TextChart resources.
type textChartState struct {
// Description of the text note.
Description *string `pulumi:"description"`
// Markdown text to display.
Markdown *string `pulumi:"markdown"`
// Name of the text note.
Name *string `pulumi:"name"`
// The URL of the chart.
Url *string `pulumi:"url"`
}
type TextChartState struct {
// Description of the text note.
Description pulumi.StringPtrInput
// Markdown text to display.
Markdown pulumi.StringPtrInput
// Name of the text note.
Name pulumi.StringPtrInput
// The URL of the chart.
Url pulumi.StringPtrInput
}
func (TextChartState) ElementType() reflect.Type {
return reflect.TypeOf((*textChartState)(nil)).Elem()
}
type textChartArgs struct {
// Description of the text note.
Description *string `pulumi:"description"`
// Markdown text to display.
Markdown string `pulumi:"markdown"`
// Name of the text note.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a TextChart resource.
type TextChartArgs struct {
// Description of the text note.
Description pulumi.StringPtrInput
// Markdown text to display.
Markdown pulumi.StringInput
// Name of the text note.
Name pulumi.StringPtrInput
}
func (TextChartArgs) ElementType() reflect.Type {
return reflect.TypeOf((*textChartArgs)(nil)).Elem()
}
type TextChartInput interface {
pulumi.Input
ToTextChartOutput() TextChartOutput
ToTextChartOutputWithContext(ctx context.Context) TextChartOutput
}
func (*TextChart) ElementType() reflect.Type {
return reflect.TypeOf((**TextChart)(nil)).Elem()
}
func (i *TextChart) ToTextChartOutput() TextChartOutput {
return i.ToTextChartOutputWithContext(context.Background())
}
func (i *TextChart) ToTextChartOutputWithContext(ctx context.Context) TextChartOutput {
return pulumi.ToOutputWithContext(ctx, i).(TextChartOutput)
}
// TextChartArrayInput is an input type that accepts TextChartArray and TextChartArrayOutput values.
// You can construct a concrete instance of `TextChartArrayInput` via:
//
// TextChartArray{ TextChartArgs{...} }
type TextChartArrayInput interface {
pulumi.Input
ToTextChartArrayOutput() TextChartArrayOutput
ToTextChartArrayOutputWithContext(context.Context) TextChartArrayOutput
}
type TextChartArray []TextChartInput
func (TextChartArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TextChart)(nil)).Elem()
}
func (i TextChartArray) ToTextChartArrayOutput() TextChartArrayOutput {
return i.ToTextChartArrayOutputWithContext(context.Background())
}
func (i TextChartArray) ToTextChartArrayOutputWithContext(ctx context.Context) TextChartArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TextChartArrayOutput)
}
// TextChartMapInput is an input type that accepts TextChartMap and TextChartMapOutput values.
// You can construct a concrete instance of `TextChartMapInput` via:
//
// TextChartMap{ "key": TextChartArgs{...} }
type TextChartMapInput interface {
pulumi.Input
ToTextChartMapOutput() TextChartMapOutput
ToTextChartMapOutputWithContext(context.Context) TextChartMapOutput
}
type TextChartMap map[string]TextChartInput
func (TextChartMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TextChart)(nil)).Elem()
}
func (i TextChartMap) ToTextChartMapOutput() TextChartMapOutput {
return i.ToTextChartMapOutputWithContext(context.Background())
}
func (i TextChartMap) ToTextChartMapOutputWithContext(ctx context.Context) TextChartMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TextChartMapOutput)
}
type TextChartOutput struct{ *pulumi.OutputState }
func (TextChartOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TextChart)(nil)).Elem()
}
func (o TextChartOutput) ToTextChartOutput() TextChartOutput {
return o
}
func (o TextChartOutput) ToTextChartOutputWithContext(ctx context.Context) TextChartOutput {
return o
}
// Description of the text note.
func (o TextChartOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *TextChart) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Markdown text to display.
func (o TextChartOutput) Markdown() pulumi.StringOutput {
return o.ApplyT(func(v *TextChart) pulumi.StringOutput { return v.Markdown }).(pulumi.StringOutput)
}
// Name of the text note.
func (o TextChartOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *TextChart) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The URL of the chart.
func (o TextChartOutput) Url() pulumi.StringOutput {
return o.ApplyT(func(v *TextChart) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
}
type TextChartArrayOutput struct{ *pulumi.OutputState }
func (TextChartArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TextChart)(nil)).Elem()
}
func (o TextChartArrayOutput) ToTextChartArrayOutput() TextChartArrayOutput {
return o
}
func (o TextChartArrayOutput) ToTextChartArrayOutputWithContext(ctx context.Context) TextChartArrayOutput {
return o
}
func (o TextChartArrayOutput) Index(i pulumi.IntInput) TextChartOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TextChart {
return vs[0].([]*TextChart)[vs[1].(int)]
}).(TextChartOutput)
}
type TextChartMapOutput struct{ *pulumi.OutputState }
func (TextChartMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TextChart)(nil)).Elem()
}
func (o TextChartMapOutput) ToTextChartMapOutput() TextChartMapOutput {
return o
}
func (o TextChartMapOutput) ToTextChartMapOutputWithContext(ctx context.Context) TextChartMapOutput {
return o
}
func (o TextChartMapOutput) MapIndex(k pulumi.StringInput) TextChartOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TextChart {
return vs[0].(map[string]*TextChart)[vs[1].(string)]
}).(TextChartOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TextChartInput)(nil)).Elem(), &TextChart{})
pulumi.RegisterInputType(reflect.TypeOf((*TextChartArrayInput)(nil)).Elem(), TextChartArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TextChartMapInput)(nil)).Elem(), TextChartMap{})
pulumi.RegisterOutputType(TextChartOutput{})
pulumi.RegisterOutputType(TextChartArrayOutput{})
pulumi.RegisterOutputType(TextChartMapOutput{})
}