-
Notifications
You must be signed in to change notification settings - Fork 9
/
team.go
140 lines (127 loc) · 5.5 KB
/
team.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
// *** 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/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides a GitHub team resource.
//
// This resource allows you to add/remove teams from your organization. When applied,
// a new team will be created. When destroyed, that team will be removed.
type Team struct {
pulumi.CustomResourceState
// A description of the team.
Description pulumi.StringPtrOutput `pulumi:"description"`
Etag pulumi.StringOutput `pulumi:"etag"`
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn pulumi.StringPtrOutput `pulumi:"ldapDn"`
// The name of the team.
Name pulumi.StringOutput `pulumi:"name"`
NodeId pulumi.StringOutput `pulumi:"nodeId"`
// The ID of the parent team, if this is a nested team.
ParentTeamId pulumi.IntPtrOutput `pulumi:"parentTeamId"`
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy pulumi.StringPtrOutput `pulumi:"privacy"`
// The slug of the created team, which may or may not differ from `name`,
// depending on whether `name` contains "URL-unsafe" characters.
// Useful when referencing the team in [`.BranchProtection`](https://www.terraform.io/docs/providers/github/r/branch_protection.html).
Slug pulumi.StringOutput `pulumi:"slug"`
}
// NewTeam registers a new resource with the given unique name, arguments, and options.
func NewTeam(ctx *pulumi.Context,
name string, args *TeamArgs, opts ...pulumi.ResourceOption) (*Team, error) {
if args == nil {
args = &TeamArgs{}
}
var resource Team
err := ctx.RegisterResource("github:index/team:Team", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTeam gets an existing Team 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 GetTeam(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TeamState, opts ...pulumi.ResourceOption) (*Team, error) {
var resource Team
err := ctx.ReadResource("github:index/team:Team", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Team resources.
type teamState struct {
// A description of the team.
Description *string `pulumi:"description"`
Etag *string `pulumi:"etag"`
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn *string `pulumi:"ldapDn"`
// The name of the team.
Name *string `pulumi:"name"`
NodeId *string `pulumi:"nodeId"`
// The ID of the parent team, if this is a nested team.
ParentTeamId *int `pulumi:"parentTeamId"`
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy *string `pulumi:"privacy"`
// The slug of the created team, which may or may not differ from `name`,
// depending on whether `name` contains "URL-unsafe" characters.
// Useful when referencing the team in [`.BranchProtection`](https://www.terraform.io/docs/providers/github/r/branch_protection.html).
Slug *string `pulumi:"slug"`
}
type TeamState struct {
// A description of the team.
Description pulumi.StringPtrInput
Etag pulumi.StringPtrInput
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn pulumi.StringPtrInput
// The name of the team.
Name pulumi.StringPtrInput
NodeId pulumi.StringPtrInput
// The ID of the parent team, if this is a nested team.
ParentTeamId pulumi.IntPtrInput
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy pulumi.StringPtrInput
// The slug of the created team, which may or may not differ from `name`,
// depending on whether `name` contains "URL-unsafe" characters.
// Useful when referencing the team in [`.BranchProtection`](https://www.terraform.io/docs/providers/github/r/branch_protection.html).
Slug pulumi.StringPtrInput
}
func (TeamState) ElementType() reflect.Type {
return reflect.TypeOf((*teamState)(nil)).Elem()
}
type teamArgs struct {
// A description of the team.
Description *string `pulumi:"description"`
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn *string `pulumi:"ldapDn"`
// The name of the team.
Name *string `pulumi:"name"`
// The ID of the parent team, if this is a nested team.
ParentTeamId *int `pulumi:"parentTeamId"`
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy *string `pulumi:"privacy"`
}
// The set of arguments for constructing a Team resource.
type TeamArgs struct {
// A description of the team.
Description pulumi.StringPtrInput
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn pulumi.StringPtrInput
// The name of the team.
Name pulumi.StringPtrInput
// The ID of the parent team, if this is a nested team.
ParentTeamId pulumi.IntPtrInput
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy pulumi.StringPtrInput
}
func (TeamArgs) ElementType() reflect.Type {
return reflect.TypeOf((*teamArgs)(nil)).Elem()
}