-
Notifications
You must be signed in to change notification settings - Fork 0
/
team.go
147 lines (131 loc) · 5.02 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
141
142
143
144
145
146
147
// *** 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 (
"github.com/pulumi/pulumi/sdk/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.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-github/blob/master/website/docs/r/team.html.markdown.
type Team struct {
s *pulumi.ResourceState
}
// NewTeam registers a new resource with the given unique name, arguments, and options.
func NewTeam(ctx *pulumi.Context,
name string, args *TeamArgs, opts ...pulumi.ResourceOpt) (*Team, error) {
inputs := make(map[string]interface{})
if args == nil {
inputs["description"] = nil
inputs["ldapDn"] = nil
inputs["name"] = nil
inputs["parentTeamId"] = nil
inputs["privacy"] = nil
} else {
inputs["description"] = args.Description
inputs["ldapDn"] = args.LdapDn
inputs["name"] = args.Name
inputs["parentTeamId"] = args.ParentTeamId
inputs["privacy"] = args.Privacy
}
inputs["etag"] = nil
inputs["slug"] = nil
s, err := ctx.RegisterResource("github:index/team:Team", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &Team{s: s}, 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.ID, state *TeamState, opts ...pulumi.ResourceOpt) (*Team, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["description"] = state.Description
inputs["etag"] = state.Etag
inputs["ldapDn"] = state.LdapDn
inputs["name"] = state.Name
inputs["parentTeamId"] = state.ParentTeamId
inputs["privacy"] = state.Privacy
inputs["slug"] = state.Slug
}
s, err := ctx.ReadResource("github:index/team:Team", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &Team{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *Team) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *Team) ID() *pulumi.IDOutput {
return r.s.ID()
}
// A description of the team.
func (r *Team) Description() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["description"])
}
func (r *Team) Etag() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["etag"])
}
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
func (r *Team) LdapDn() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["ldapDn"])
}
// The name of the team.
func (r *Team) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
// The ID of the parent team, if this is a nested team.
func (r *Team) ParentTeamId() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["parentTeamId"])
}
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
func (r *Team) Privacy() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["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).
func (r *Team) Slug() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["slug"])
}
// Input properties used for looking up and filtering Team resources.
type TeamState struct {
// A description of the team.
Description interface{}
Etag interface{}
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn interface{}
// The name of the team.
Name interface{}
// The ID of the parent team, if this is a nested team.
ParentTeamId interface{}
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy interface{}
// 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 interface{}
}
// The set of arguments for constructing a Team resource.
type TeamArgs struct {
// A description of the team.
Description interface{}
// The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.
LdapDn interface{}
// The name of the team.
Name interface{}
// The ID of the parent team, if this is a nested team.
ParentTeamId interface{}
// The level of privacy for the team. Must be one of `secret` or `closed`.
// Defaults to `secret`.
Privacy interface{}
}