-
Notifications
You must be signed in to change notification settings - Fork 9
/
actionsOrganizationVariable.go
374 lines (322 loc) · 15 KB
/
actionsOrganizationVariable.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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
// 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 github
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-github/sdk/v6/go/github/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This resource allows you to create and manage GitHub Actions variables within your GitHub organization.
// You must have write access to a repository to use this resource.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-github/sdk/v6/go/github"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := github.NewActionsOrganizationVariable(ctx, "exampleVariable", &github.ActionsOrganizationVariableArgs{
// Value: pulumi.String("example_variable_value"),
// VariableName: pulumi.String("example_variable_name"),
// Visibility: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-github/sdk/v6/go/github"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{
// FullName: pulumi.StringRef("my-org/repo"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = github.NewActionsOrganizationVariable(ctx, "exampleVariable", &github.ActionsOrganizationVariableArgs{
// VariableName: pulumi.String("example_variable_name"),
// Visibility: pulumi.String("selected"),
// Value: pulumi.String("example_variable_value"),
// SelectedRepositoryIds: pulumi.IntArray{
// pulumi.Int(repo.RepoId),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// This resource can be imported using an ID made up of the variable name:
//
// ```sh
// $ pulumi import github:index/actionsOrganizationVariable:ActionsOrganizationVariable test_variable test_variable_name
// ```
type ActionsOrganizationVariable struct {
pulumi.CustomResourceState
// Date of actionsVariable creation.
CreatedAt pulumi.StringOutput `pulumi:"createdAt"`
// An array of repository ids that can access the organization variable.
SelectedRepositoryIds pulumi.IntArrayOutput `pulumi:"selectedRepositoryIds"`
// Date of actionsVariable update.
UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"`
// Value of the variable
Value pulumi.StringOutput `pulumi:"value"`
// Name of the variable
VariableName pulumi.StringOutput `pulumi:"variableName"`
// Configures the access that repositories have to the organization variable.
// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`.
Visibility pulumi.StringOutput `pulumi:"visibility"`
}
// NewActionsOrganizationVariable registers a new resource with the given unique name, arguments, and options.
func NewActionsOrganizationVariable(ctx *pulumi.Context,
name string, args *ActionsOrganizationVariableArgs, opts ...pulumi.ResourceOption) (*ActionsOrganizationVariable, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
if args.VariableName == nil {
return nil, errors.New("invalid value for required argument 'VariableName'")
}
if args.Visibility == nil {
return nil, errors.New("invalid value for required argument 'Visibility'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ActionsOrganizationVariable
err := ctx.RegisterResource("github:index/actionsOrganizationVariable:ActionsOrganizationVariable", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetActionsOrganizationVariable gets an existing ActionsOrganizationVariable 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 GetActionsOrganizationVariable(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ActionsOrganizationVariableState, opts ...pulumi.ResourceOption) (*ActionsOrganizationVariable, error) {
var resource ActionsOrganizationVariable
err := ctx.ReadResource("github:index/actionsOrganizationVariable:ActionsOrganizationVariable", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ActionsOrganizationVariable resources.
type actionsOrganizationVariableState struct {
// Date of actionsVariable creation.
CreatedAt *string `pulumi:"createdAt"`
// An array of repository ids that can access the organization variable.
SelectedRepositoryIds []int `pulumi:"selectedRepositoryIds"`
// Date of actionsVariable update.
UpdatedAt *string `pulumi:"updatedAt"`
// Value of the variable
Value *string `pulumi:"value"`
// Name of the variable
VariableName *string `pulumi:"variableName"`
// Configures the access that repositories have to the organization variable.
// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`.
Visibility *string `pulumi:"visibility"`
}
type ActionsOrganizationVariableState struct {
// Date of actionsVariable creation.
CreatedAt pulumi.StringPtrInput
// An array of repository ids that can access the organization variable.
SelectedRepositoryIds pulumi.IntArrayInput
// Date of actionsVariable update.
UpdatedAt pulumi.StringPtrInput
// Value of the variable
Value pulumi.StringPtrInput
// Name of the variable
VariableName pulumi.StringPtrInput
// Configures the access that repositories have to the organization variable.
// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`.
Visibility pulumi.StringPtrInput
}
func (ActionsOrganizationVariableState) ElementType() reflect.Type {
return reflect.TypeOf((*actionsOrganizationVariableState)(nil)).Elem()
}
type actionsOrganizationVariableArgs struct {
// An array of repository ids that can access the organization variable.
SelectedRepositoryIds []int `pulumi:"selectedRepositoryIds"`
// Value of the variable
Value string `pulumi:"value"`
// Name of the variable
VariableName string `pulumi:"variableName"`
// Configures the access that repositories have to the organization variable.
// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`.
Visibility string `pulumi:"visibility"`
}
// The set of arguments for constructing a ActionsOrganizationVariable resource.
type ActionsOrganizationVariableArgs struct {
// An array of repository ids that can access the organization variable.
SelectedRepositoryIds pulumi.IntArrayInput
// Value of the variable
Value pulumi.StringInput
// Name of the variable
VariableName pulumi.StringInput
// Configures the access that repositories have to the organization variable.
// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`.
Visibility pulumi.StringInput
}
func (ActionsOrganizationVariableArgs) ElementType() reflect.Type {
return reflect.TypeOf((*actionsOrganizationVariableArgs)(nil)).Elem()
}
type ActionsOrganizationVariableInput interface {
pulumi.Input
ToActionsOrganizationVariableOutput() ActionsOrganizationVariableOutput
ToActionsOrganizationVariableOutputWithContext(ctx context.Context) ActionsOrganizationVariableOutput
}
func (*ActionsOrganizationVariable) ElementType() reflect.Type {
return reflect.TypeOf((**ActionsOrganizationVariable)(nil)).Elem()
}
func (i *ActionsOrganizationVariable) ToActionsOrganizationVariableOutput() ActionsOrganizationVariableOutput {
return i.ToActionsOrganizationVariableOutputWithContext(context.Background())
}
func (i *ActionsOrganizationVariable) ToActionsOrganizationVariableOutputWithContext(ctx context.Context) ActionsOrganizationVariableOutput {
return pulumi.ToOutputWithContext(ctx, i).(ActionsOrganizationVariableOutput)
}
// ActionsOrganizationVariableArrayInput is an input type that accepts ActionsOrganizationVariableArray and ActionsOrganizationVariableArrayOutput values.
// You can construct a concrete instance of `ActionsOrganizationVariableArrayInput` via:
//
// ActionsOrganizationVariableArray{ ActionsOrganizationVariableArgs{...} }
type ActionsOrganizationVariableArrayInput interface {
pulumi.Input
ToActionsOrganizationVariableArrayOutput() ActionsOrganizationVariableArrayOutput
ToActionsOrganizationVariableArrayOutputWithContext(context.Context) ActionsOrganizationVariableArrayOutput
}
type ActionsOrganizationVariableArray []ActionsOrganizationVariableInput
func (ActionsOrganizationVariableArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ActionsOrganizationVariable)(nil)).Elem()
}
func (i ActionsOrganizationVariableArray) ToActionsOrganizationVariableArrayOutput() ActionsOrganizationVariableArrayOutput {
return i.ToActionsOrganizationVariableArrayOutputWithContext(context.Background())
}
func (i ActionsOrganizationVariableArray) ToActionsOrganizationVariableArrayOutputWithContext(ctx context.Context) ActionsOrganizationVariableArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ActionsOrganizationVariableArrayOutput)
}
// ActionsOrganizationVariableMapInput is an input type that accepts ActionsOrganizationVariableMap and ActionsOrganizationVariableMapOutput values.
// You can construct a concrete instance of `ActionsOrganizationVariableMapInput` via:
//
// ActionsOrganizationVariableMap{ "key": ActionsOrganizationVariableArgs{...} }
type ActionsOrganizationVariableMapInput interface {
pulumi.Input
ToActionsOrganizationVariableMapOutput() ActionsOrganizationVariableMapOutput
ToActionsOrganizationVariableMapOutputWithContext(context.Context) ActionsOrganizationVariableMapOutput
}
type ActionsOrganizationVariableMap map[string]ActionsOrganizationVariableInput
func (ActionsOrganizationVariableMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ActionsOrganizationVariable)(nil)).Elem()
}
func (i ActionsOrganizationVariableMap) ToActionsOrganizationVariableMapOutput() ActionsOrganizationVariableMapOutput {
return i.ToActionsOrganizationVariableMapOutputWithContext(context.Background())
}
func (i ActionsOrganizationVariableMap) ToActionsOrganizationVariableMapOutputWithContext(ctx context.Context) ActionsOrganizationVariableMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ActionsOrganizationVariableMapOutput)
}
type ActionsOrganizationVariableOutput struct{ *pulumi.OutputState }
func (ActionsOrganizationVariableOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ActionsOrganizationVariable)(nil)).Elem()
}
func (o ActionsOrganizationVariableOutput) ToActionsOrganizationVariableOutput() ActionsOrganizationVariableOutput {
return o
}
func (o ActionsOrganizationVariableOutput) ToActionsOrganizationVariableOutputWithContext(ctx context.Context) ActionsOrganizationVariableOutput {
return o
}
// Date of actionsVariable creation.
func (o ActionsOrganizationVariableOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *ActionsOrganizationVariable) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput)
}
// An array of repository ids that can access the organization variable.
func (o ActionsOrganizationVariableOutput) SelectedRepositoryIds() pulumi.IntArrayOutput {
return o.ApplyT(func(v *ActionsOrganizationVariable) pulumi.IntArrayOutput { return v.SelectedRepositoryIds }).(pulumi.IntArrayOutput)
}
// Date of actionsVariable update.
func (o ActionsOrganizationVariableOutput) UpdatedAt() pulumi.StringOutput {
return o.ApplyT(func(v *ActionsOrganizationVariable) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput)
}
// Value of the variable
func (o ActionsOrganizationVariableOutput) Value() pulumi.StringOutput {
return o.ApplyT(func(v *ActionsOrganizationVariable) pulumi.StringOutput { return v.Value }).(pulumi.StringOutput)
}
// Name of the variable
func (o ActionsOrganizationVariableOutput) VariableName() pulumi.StringOutput {
return o.ApplyT(func(v *ActionsOrganizationVariable) pulumi.StringOutput { return v.VariableName }).(pulumi.StringOutput)
}
// Configures the access that repositories have to the organization variable.
// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`.
func (o ActionsOrganizationVariableOutput) Visibility() pulumi.StringOutput {
return o.ApplyT(func(v *ActionsOrganizationVariable) pulumi.StringOutput { return v.Visibility }).(pulumi.StringOutput)
}
type ActionsOrganizationVariableArrayOutput struct{ *pulumi.OutputState }
func (ActionsOrganizationVariableArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ActionsOrganizationVariable)(nil)).Elem()
}
func (o ActionsOrganizationVariableArrayOutput) ToActionsOrganizationVariableArrayOutput() ActionsOrganizationVariableArrayOutput {
return o
}
func (o ActionsOrganizationVariableArrayOutput) ToActionsOrganizationVariableArrayOutputWithContext(ctx context.Context) ActionsOrganizationVariableArrayOutput {
return o
}
func (o ActionsOrganizationVariableArrayOutput) Index(i pulumi.IntInput) ActionsOrganizationVariableOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ActionsOrganizationVariable {
return vs[0].([]*ActionsOrganizationVariable)[vs[1].(int)]
}).(ActionsOrganizationVariableOutput)
}
type ActionsOrganizationVariableMapOutput struct{ *pulumi.OutputState }
func (ActionsOrganizationVariableMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ActionsOrganizationVariable)(nil)).Elem()
}
func (o ActionsOrganizationVariableMapOutput) ToActionsOrganizationVariableMapOutput() ActionsOrganizationVariableMapOutput {
return o
}
func (o ActionsOrganizationVariableMapOutput) ToActionsOrganizationVariableMapOutputWithContext(ctx context.Context) ActionsOrganizationVariableMapOutput {
return o
}
func (o ActionsOrganizationVariableMapOutput) MapIndex(k pulumi.StringInput) ActionsOrganizationVariableOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ActionsOrganizationVariable {
return vs[0].(map[string]*ActionsOrganizationVariable)[vs[1].(string)]
}).(ActionsOrganizationVariableOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ActionsOrganizationVariableInput)(nil)).Elem(), &ActionsOrganizationVariable{})
pulumi.RegisterInputType(reflect.TypeOf((*ActionsOrganizationVariableArrayInput)(nil)).Elem(), ActionsOrganizationVariableArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ActionsOrganizationVariableMapInput)(nil)).Elem(), ActionsOrganizationVariableMap{})
pulumi.RegisterOutputType(ActionsOrganizationVariableOutput{})
pulumi.RegisterOutputType(ActionsOrganizationVariableArrayOutput{})
pulumi.RegisterOutputType(ActionsOrganizationVariableMapOutput{})
}