-
Notifications
You must be signed in to change notification settings - Fork 9
/
repositoryWebhook.go
121 lines (108 loc) · 5.88 KB
/
repositoryWebhook.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
// *** 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 repositories within your
// GitHub organization or personal account.
type RepositoryWebhook 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`. `secret` is [the shared secret, see API documentation](https://developer.github.com/v3/repos/hooks/#create-a-hook).
Configuration RepositoryWebhookConfigurationPtrOutput `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"`
// The repository of the webhook.
Repository pulumi.StringOutput `pulumi:"repository"`
// URL of the webhook
Url pulumi.StringOutput `pulumi:"url"`
}
// NewRepositoryWebhook registers a new resource with the given unique name, arguments, and options.
func NewRepositoryWebhook(ctx *pulumi.Context,
name string, args *RepositoryWebhookArgs, opts ...pulumi.ResourceOption) (*RepositoryWebhook, error) {
if args == nil || args.Events == nil {
return nil, errors.New("missing required argument 'Events'")
}
if args == nil || args.Repository == nil {
return nil, errors.New("missing required argument 'Repository'")
}
if args == nil {
args = &RepositoryWebhookArgs{}
}
var resource RepositoryWebhook
err := ctx.RegisterResource("github:index/repositoryWebhook:RepositoryWebhook", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRepositoryWebhook gets an existing RepositoryWebhook 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 GetRepositoryWebhook(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RepositoryWebhookState, opts ...pulumi.ResourceOption) (*RepositoryWebhook, error) {
var resource RepositoryWebhook
err := ctx.ReadResource("github:index/repositoryWebhook:RepositoryWebhook", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RepositoryWebhook resources.
type repositoryWebhookState 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`. `secret` is [the shared secret, see API documentation](https://developer.github.com/v3/repos/hooks/#create-a-hook).
Configuration *RepositoryWebhookConfiguration `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"`
// The repository of the webhook.
Repository *string `pulumi:"repository"`
// URL of the webhook
Url *string `pulumi:"url"`
}
type RepositoryWebhookState 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`. `secret` is [the shared secret, see API documentation](https://developer.github.com/v3/repos/hooks/#create-a-hook).
Configuration RepositoryWebhookConfigurationPtrInput
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
// The repository of the webhook.
Repository pulumi.StringPtrInput
// URL of the webhook
Url pulumi.StringPtrInput
}
func (RepositoryWebhookState) ElementType() reflect.Type {
return reflect.TypeOf((*repositoryWebhookState)(nil)).Elem()
}
type repositoryWebhookArgs 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`. `secret` is [the shared secret, see API documentation](https://developer.github.com/v3/repos/hooks/#create-a-hook).
Configuration *RepositoryWebhookConfiguration `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 repository of the webhook.
Repository string `pulumi:"repository"`
}
// The set of arguments for constructing a RepositoryWebhook resource.
type RepositoryWebhookArgs 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`. `secret` is [the shared secret, see API documentation](https://developer.github.com/v3/repos/hooks/#create-a-hook).
Configuration RepositoryWebhookConfigurationPtrInput
// 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
// The repository of the webhook.
Repository pulumi.StringInput
}
func (RepositoryWebhookArgs) ElementType() reflect.Type {
return reflect.TypeOf((*repositoryWebhookArgs)(nil)).Elem()
}