/
getArea.go
176 lines (155 loc) · 6.16 KB
/
getArea.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
// 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 Area (Component) 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.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
// WorkItemTemplate: pulumi.String("Agile"),
// VersionControl: pulumi.String("Git"),
// Visibility: pulumi.String("private"),
// Description: pulumi.String("Managed by Terraform"),
// })
// if err != nil {
// return err
// }
// _ = exampleProject.ID().ApplyT(func(id string) (azuredevops.GetAreaResult, error) {
// return azuredevops.GetAreaOutput(ctx, azuredevops.GetAreaOutputArgs{
// ProjectId: id,
// Path: "/",
// FetchChildren: false,
// }, nil), nil
// }).(azuredevops.GetAreaResultOutput)
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Relevant Links
//
// - [Azure DevOps Service REST API 7.0 - Classification Nodes - Get Classification Nodes](https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/classification-nodes/create-or-update?view=azure-devops-rest-7.0)
//
// ## PAT Permissions Required
//
// - **Project & Team**: vso.work - Grants the ability to read work items, queries, boards, area and iterations paths, and other work item tracking related metadata. Also grants the ability to execute queries, search work items and to receive notifications about work item events via service hooks.
func GetArea(ctx *pulumi.Context, args *GetAreaArgs, opts ...pulumi.InvokeOption) (*GetAreaResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetAreaResult
err := ctx.Invoke("azuredevops:index/getArea:getArea", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getArea.
type GetAreaArgs struct {
// Read children nodes, _Depth_: 1, _Default_: `true`
FetchChildren *bool `pulumi:"fetchChildren"`
// The path to the Area; _Format_: URL relative; if omitted, or value `"/"` is used, the root Area will be returned
Path *string `pulumi:"path"`
// The project ID.
ProjectId string `pulumi:"projectId"`
}
// A collection of values returned by getArea.
type GetAreaResult struct {
// A list of `children` blocks as defined below, empty if `hasChildren == false`
Childrens []GetAreaChildren `pulumi:"childrens"`
FetchChildren *bool `pulumi:"fetchChildren"`
// Indicator if the child Area node has child nodes
HasChildren bool `pulumi:"hasChildren"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The name of the child Area node
Name string `pulumi:"name"`
// The complete path (in relative URL format) of the child Area
Path string `pulumi:"path"`
// The project ID of the child Area node
ProjectId string `pulumi:"projectId"`
}
func GetAreaOutput(ctx *pulumi.Context, args GetAreaOutputArgs, opts ...pulumi.InvokeOption) GetAreaResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetAreaResult, error) {
args := v.(GetAreaArgs)
r, err := GetArea(ctx, &args, opts...)
var s GetAreaResult
if r != nil {
s = *r
}
return s, err
}).(GetAreaResultOutput)
}
// A collection of arguments for invoking getArea.
type GetAreaOutputArgs struct {
// Read children nodes, _Depth_: 1, _Default_: `true`
FetchChildren pulumi.BoolPtrInput `pulumi:"fetchChildren"`
// The path to the Area; _Format_: URL relative; if omitted, or value `"/"` is used, the root Area will be returned
Path pulumi.StringPtrInput `pulumi:"path"`
// The project ID.
ProjectId pulumi.StringInput `pulumi:"projectId"`
}
func (GetAreaOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetAreaArgs)(nil)).Elem()
}
// A collection of values returned by getArea.
type GetAreaResultOutput struct{ *pulumi.OutputState }
func (GetAreaResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetAreaResult)(nil)).Elem()
}
func (o GetAreaResultOutput) ToGetAreaResultOutput() GetAreaResultOutput {
return o
}
func (o GetAreaResultOutput) ToGetAreaResultOutputWithContext(ctx context.Context) GetAreaResultOutput {
return o
}
// A list of `children` blocks as defined below, empty if `hasChildren == false`
func (o GetAreaResultOutput) Childrens() GetAreaChildrenArrayOutput {
return o.ApplyT(func(v GetAreaResult) []GetAreaChildren { return v.Childrens }).(GetAreaChildrenArrayOutput)
}
func (o GetAreaResultOutput) FetchChildren() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetAreaResult) *bool { return v.FetchChildren }).(pulumi.BoolPtrOutput)
}
// Indicator if the child Area node has child nodes
func (o GetAreaResultOutput) HasChildren() pulumi.BoolOutput {
return o.ApplyT(func(v GetAreaResult) bool { return v.HasChildren }).(pulumi.BoolOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetAreaResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetAreaResult) string { return v.Id }).(pulumi.StringOutput)
}
// The name of the child Area node
func (o GetAreaResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetAreaResult) string { return v.Name }).(pulumi.StringOutput)
}
// The complete path (in relative URL format) of the child Area
func (o GetAreaResultOutput) Path() pulumi.StringOutput {
return o.ApplyT(func(v GetAreaResult) string { return v.Path }).(pulumi.StringOutput)
}
// The project ID of the child Area node
func (o GetAreaResultOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v GetAreaResult) string { return v.ProjectId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetAreaResultOutput{})
}