/
getGroup.go
171 lines (151 loc) · 6.14 KB
/
getGroup.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
// 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 azuredevops
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Group within Azure DevOps
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleProject, err := azuredevops.LookupProject(ctx, &azuredevops.LookupProjectArgs{
// Name: pulumi.StringRef("Example Project"),
// }, nil)
// if err != nil {
// return err
// }
// exampleGroup, err := azuredevops.LookupGroup(ctx, &azuredevops.LookupGroupArgs{
// ProjectId: pulumi.StringRef(exampleProject.Id),
// Name: "Example Group",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("groupId", exampleGroup.Id)
// ctx.Export("groupDescriptor", exampleGroup.Descriptor)
// _, err = azuredevops.LookupGroup(ctx, &azuredevops.LookupGroupArgs{
// Name: "Project Collection Administrators",
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("collectionGroupId", exampleGroup.Id)
// ctx.Export("collectionGroupDescriptor", exampleGroup.Descriptor)
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Relevant Links
//
// - [Azure DevOps Service REST API 7.0 - Groups - Get](https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/groups/get?view=azure-devops-rest-7.0)
//
// ## PAT Permissions Required
//
// - **Graph**: Read
// - **Work Items**: Read
func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.InvokeOption) (*LookupGroupResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupGroupResult
err := ctx.Invoke("azuredevops:index/getGroup:getGroup", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getGroup.
type LookupGroupArgs struct {
// The Group Name.
Name string `pulumi:"name"`
// The Project ID. If no project ID is specified the project collection groups will be searched.
ProjectId *string `pulumi:"projectId"`
}
// A collection of values returned by getGroup.
type LookupGroupResult struct {
// The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
Descriptor string `pulumi:"descriptor"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// The type of source provider for the origin identifier (ex:AD, AAD, MSA)
Origin string `pulumi:"origin"`
// The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
OriginId string `pulumi:"originId"`
ProjectId *string `pulumi:"projectId"`
}
func LookupGroupOutput(ctx *pulumi.Context, args LookupGroupOutputArgs, opts ...pulumi.InvokeOption) LookupGroupResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupGroupResult, error) {
args := v.(LookupGroupArgs)
r, err := LookupGroup(ctx, &args, opts...)
var s LookupGroupResult
if r != nil {
s = *r
}
return s, err
}).(LookupGroupResultOutput)
}
// A collection of arguments for invoking getGroup.
type LookupGroupOutputArgs struct {
// The Group Name.
Name pulumi.StringInput `pulumi:"name"`
// The Project ID. If no project ID is specified the project collection groups will be searched.
ProjectId pulumi.StringPtrInput `pulumi:"projectId"`
}
func (LookupGroupOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGroupArgs)(nil)).Elem()
}
// A collection of values returned by getGroup.
type LookupGroupResultOutput struct{ *pulumi.OutputState }
func (LookupGroupResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupGroupResult)(nil)).Elem()
}
func (o LookupGroupResultOutput) ToLookupGroupResultOutput() LookupGroupResultOutput {
return o
}
func (o LookupGroupResultOutput) ToLookupGroupResultOutputWithContext(ctx context.Context) LookupGroupResultOutput {
return o
}
// The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.
func (o LookupGroupResultOutput) Descriptor() pulumi.StringOutput {
return o.ApplyT(func(v LookupGroupResult) string { return v.Descriptor }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupGroupResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupGroupResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupGroupResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupGroupResult) string { return v.Name }).(pulumi.StringOutput)
}
// The type of source provider for the origin identifier (ex:AD, AAD, MSA)
func (o LookupGroupResultOutput) Origin() pulumi.StringOutput {
return o.ApplyT(func(v LookupGroupResult) string { return v.Origin }).(pulumi.StringOutput)
}
// The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.
func (o LookupGroupResultOutput) OriginId() pulumi.StringOutput {
return o.ApplyT(func(v LookupGroupResult) string { return v.OriginId }).(pulumi.StringOutput)
}
func (o LookupGroupResultOutput) ProjectId() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupGroupResult) *string { return v.ProjectId }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupGroupResultOutput{})
}