-
Notifications
You must be signed in to change notification settings - Fork 2
/
addon.go
88 lines (75 loc) · 2.89 KB
/
addon.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package pagerduty
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// With [add-ons](https://v2.developer.pagerduty.com/v2/page/api-reference#!/Add-ons/get_addons), third-party developers can write their own add-ons to PagerDuty's UI. Given a configuration containing a src parameter, that URL will be embedded in an iframe on a page that's available to users from a drop-down menu.
type Addon struct {
pulumi.CustomResourceState
// The name of the add-on.
Name pulumi.StringOutput `pulumi:"name"`
// The source URL to display in a frame in the PagerDuty UI. `HTTPS` is required.
Src pulumi.StringOutput `pulumi:"src"`
}
// NewAddon registers a new resource with the given unique name, arguments, and options.
func NewAddon(ctx *pulumi.Context,
name string, args *AddonArgs, opts ...pulumi.ResourceOption) (*Addon, error) {
if args == nil || args.Src == nil {
return nil, errors.New("missing required argument 'Src'")
}
if args == nil {
args = &AddonArgs{}
}
var resource Addon
err := ctx.RegisterResource("pagerduty:index/addon:Addon", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAddon gets an existing Addon 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 GetAddon(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AddonState, opts ...pulumi.ResourceOption) (*Addon, error) {
var resource Addon
err := ctx.ReadResource("pagerduty:index/addon:Addon", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Addon resources.
type addonState struct {
// The name of the add-on.
Name *string `pulumi:"name"`
// The source URL to display in a frame in the PagerDuty UI. `HTTPS` is required.
Src *string `pulumi:"src"`
}
type AddonState struct {
// The name of the add-on.
Name pulumi.StringPtrInput
// The source URL to display in a frame in the PagerDuty UI. `HTTPS` is required.
Src pulumi.StringPtrInput
}
func (AddonState) ElementType() reflect.Type {
return reflect.TypeOf((*addonState)(nil)).Elem()
}
type addonArgs struct {
// The name of the add-on.
Name *string `pulumi:"name"`
// The source URL to display in a frame in the PagerDuty UI. `HTTPS` is required.
Src string `pulumi:"src"`
}
// The set of arguments for constructing a Addon resource.
type AddonArgs struct {
// The name of the add-on.
Name pulumi.StringPtrInput
// The source URL to display in a frame in the PagerDuty UI. `HTTPS` is required.
Src pulumi.StringInput
}
func (AddonArgs) ElementType() reflect.Type {
return reflect.TypeOf((*addonArgs)(nil)).Elem()
}