-
Notifications
You must be signed in to change notification settings - Fork 9
/
organizationWebhook.go
138 lines (125 loc) · 5.58 KB
/
organizationWebhook.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
// *** 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 github
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// This resource allows you to create and manage webhooks for GitHub organization.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-github/sdk/go/github"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := github.NewOrganizationWebhook(ctx, "foo", &github.OrganizationWebhookArgs{
// Active: pulumi.Bool(false),
// Configuration: &github.OrganizationWebhookConfigurationArgs{
// ContentType: pulumi.String("form"),
// InsecureSsl: pulumi.Bool(false),
// Url: pulumi.String("https://google.de/"),
// },
// Events: pulumi.StringArray{
// pulumi.String("issues"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type OrganizationWebhook struct {
pulumi.CustomResourceState
// Indicate of the webhook should receive events. Defaults to `true`.
Active pulumi.BoolPtrOutput `pulumi:"active"`
// key/value pair of configuration for this webhook. Available keys are `url`, `contentType`, `secret` and `insecureSsl`.
Configuration OrganizationWebhookConfigurationPtrOutput `pulumi:"configuration"`
Etag pulumi.StringOutput `pulumi:"etag"`
// A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/)
Events pulumi.StringArrayOutput `pulumi:"events"`
// URL of the webhook
Url pulumi.StringOutput `pulumi:"url"`
}
// NewOrganizationWebhook registers a new resource with the given unique name, arguments, and options.
func NewOrganizationWebhook(ctx *pulumi.Context,
name string, args *OrganizationWebhookArgs, opts ...pulumi.ResourceOption) (*OrganizationWebhook, error) {
if args == nil || args.Events == nil {
return nil, errors.New("missing required argument 'Events'")
}
if args == nil {
args = &OrganizationWebhookArgs{}
}
var resource OrganizationWebhook
err := ctx.RegisterResource("github:index/organizationWebhook:OrganizationWebhook", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetOrganizationWebhook gets an existing OrganizationWebhook 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 GetOrganizationWebhook(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *OrganizationWebhookState, opts ...pulumi.ResourceOption) (*OrganizationWebhook, error) {
var resource OrganizationWebhook
err := ctx.ReadResource("github:index/organizationWebhook:OrganizationWebhook", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering OrganizationWebhook resources.
type organizationWebhookState struct {
// Indicate of the webhook should receive events. Defaults to `true`.
Active *bool `pulumi:"active"`
// key/value pair of configuration for this webhook. Available keys are `url`, `contentType`, `secret` and `insecureSsl`.
Configuration *OrganizationWebhookConfiguration `pulumi:"configuration"`
Etag *string `pulumi:"etag"`
// A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/)
Events []string `pulumi:"events"`
// URL of the webhook
Url *string `pulumi:"url"`
}
type OrganizationWebhookState struct {
// Indicate of the webhook should receive events. Defaults to `true`.
Active pulumi.BoolPtrInput
// key/value pair of configuration for this webhook. Available keys are `url`, `contentType`, `secret` and `insecureSsl`.
Configuration OrganizationWebhookConfigurationPtrInput
Etag pulumi.StringPtrInput
// A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/)
Events pulumi.StringArrayInput
// URL of the webhook
Url pulumi.StringPtrInput
}
func (OrganizationWebhookState) ElementType() reflect.Type {
return reflect.TypeOf((*organizationWebhookState)(nil)).Elem()
}
type organizationWebhookArgs struct {
// Indicate of the webhook should receive events. Defaults to `true`.
Active *bool `pulumi:"active"`
// key/value pair of configuration for this webhook. Available keys are `url`, `contentType`, `secret` and `insecureSsl`.
Configuration *OrganizationWebhookConfiguration `pulumi:"configuration"`
// A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/)
Events []string `pulumi:"events"`
}
// The set of arguments for constructing a OrganizationWebhook resource.
type OrganizationWebhookArgs struct {
// Indicate of the webhook should receive events. Defaults to `true`.
Active pulumi.BoolPtrInput
// key/value pair of configuration for this webhook. Available keys are `url`, `contentType`, `secret` and `insecureSsl`.
Configuration OrganizationWebhookConfigurationPtrInput
// A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/)
Events pulumi.StringArrayInput
}
func (OrganizationWebhookArgs) ElementType() reflect.Type {
return reflect.TypeOf((*organizationWebhookArgs)(nil)).Elem()
}