generated from pulumi/pulumi-tf-provider-boilerplate
/
getAzureDevOpsRepository.go
158 lines (137 loc) · 6.29 KB
/
getAzureDevOpsRepository.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
// 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 dbtcloud
import (
"context"
"reflect"
"github.com/a-schot/pulumi-dbtcloud/sdk/go/dbtcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve the ID and details of an Azure Dev Ops repository
// based on its name and the ID of the Azure Dev Ops project it belongs to.
//
// This data source requires connecting with a user token and doesn't work with a service token.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/a-schot/pulumi-dbtcloud/sdk/go/dbtcloud"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := dbtcloud.GetAzureDevOpsRepository(ctx, &dbtcloud.GetAzureDevOpsRepositoryArgs{
// Name: "my-repo-name",
// AzureDevOpsProjectId: data.Dbtcloud_azure_dev_ops_project.My_ado_project.Id,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetAzureDevOpsRepository(ctx *pulumi.Context, args *GetAzureDevOpsRepositoryArgs, opts ...pulumi.InvokeOption) (*GetAzureDevOpsRepositoryResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetAzureDevOpsRepositoryResult
err := ctx.Invoke("dbtcloud:index/getAzureDevOpsRepository:getAzureDevOpsRepository", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAzureDevOpsRepository.
type GetAzureDevOpsRepositoryArgs struct {
// The internal Azure Dev Ops ID of the ADO Project. Can be retrieved using the data source dbtcloud*azure*dev*ops*project and the project name
AzureDevOpsProjectId string `pulumi:"azureDevOpsProjectId"`
// The name of the ADO repository
Name string `pulumi:"name"`
}
// A collection of values returned by getAzureDevOpsRepository.
type GetAzureDevOpsRepositoryResult struct {
// The internal Azure Dev Ops ID of the ADO Project. Can be retrieved using the data source dbtcloud*azure*dev*ops*project and the project name
AzureDevOpsProjectId string `pulumi:"azureDevOpsProjectId"`
// The default branch of the ADO repository
DefaultBranch string `pulumi:"defaultBranch"`
// The URL of the ADO repository showing details about the repository and its attributes
DetailsUrl string `pulumi:"detailsUrl"`
// The internal Azure Dev Ops ID of the ADO Repository
Id string `pulumi:"id"`
// The name of the ADO repository
Name string `pulumi:"name"`
// The HTTP URL of the ADO repository used to connect to dbt Cloud
RemoteUrl string `pulumi:"remoteUrl"`
// The URL of the ADO repository accessible in the browser
WebUrl string `pulumi:"webUrl"`
}
func GetAzureDevOpsRepositoryOutput(ctx *pulumi.Context, args GetAzureDevOpsRepositoryOutputArgs, opts ...pulumi.InvokeOption) GetAzureDevOpsRepositoryResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetAzureDevOpsRepositoryResult, error) {
args := v.(GetAzureDevOpsRepositoryArgs)
r, err := GetAzureDevOpsRepository(ctx, &args, opts...)
var s GetAzureDevOpsRepositoryResult
if r != nil {
s = *r
}
return s, err
}).(GetAzureDevOpsRepositoryResultOutput)
}
// A collection of arguments for invoking getAzureDevOpsRepository.
type GetAzureDevOpsRepositoryOutputArgs struct {
// The internal Azure Dev Ops ID of the ADO Project. Can be retrieved using the data source dbtcloud*azure*dev*ops*project and the project name
AzureDevOpsProjectId pulumi.StringInput `pulumi:"azureDevOpsProjectId"`
// The name of the ADO repository
Name pulumi.StringInput `pulumi:"name"`
}
func (GetAzureDevOpsRepositoryOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetAzureDevOpsRepositoryArgs)(nil)).Elem()
}
// A collection of values returned by getAzureDevOpsRepository.
type GetAzureDevOpsRepositoryResultOutput struct{ *pulumi.OutputState }
func (GetAzureDevOpsRepositoryResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetAzureDevOpsRepositoryResult)(nil)).Elem()
}
func (o GetAzureDevOpsRepositoryResultOutput) ToGetAzureDevOpsRepositoryResultOutput() GetAzureDevOpsRepositoryResultOutput {
return o
}
func (o GetAzureDevOpsRepositoryResultOutput) ToGetAzureDevOpsRepositoryResultOutputWithContext(ctx context.Context) GetAzureDevOpsRepositoryResultOutput {
return o
}
// The internal Azure Dev Ops ID of the ADO Project. Can be retrieved using the data source dbtcloud*azure*dev*ops*project and the project name
func (o GetAzureDevOpsRepositoryResultOutput) AzureDevOpsProjectId() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.AzureDevOpsProjectId }).(pulumi.StringOutput)
}
// The default branch of the ADO repository
func (o GetAzureDevOpsRepositoryResultOutput) DefaultBranch() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.DefaultBranch }).(pulumi.StringOutput)
}
// The URL of the ADO repository showing details about the repository and its attributes
func (o GetAzureDevOpsRepositoryResultOutput) DetailsUrl() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.DetailsUrl }).(pulumi.StringOutput)
}
// The internal Azure Dev Ops ID of the ADO Repository
func (o GetAzureDevOpsRepositoryResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.Id }).(pulumi.StringOutput)
}
// The name of the ADO repository
func (o GetAzureDevOpsRepositoryResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.Name }).(pulumi.StringOutput)
}
// The HTTP URL of the ADO repository used to connect to dbt Cloud
func (o GetAzureDevOpsRepositoryResultOutput) RemoteUrl() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.RemoteUrl }).(pulumi.StringOutput)
}
// The URL of the ADO repository accessible in the browser
func (o GetAzureDevOpsRepositoryResultOutput) WebUrl() pulumi.StringOutput {
return o.ApplyT(func(v GetAzureDevOpsRepositoryResult) string { return v.WebUrl }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetAzureDevOpsRepositoryResultOutput{})
}