generated from pulumi/pulumi-tf-provider-boilerplate
/
getDependencies.go
210 lines (190 loc) · 6.89 KB
/
getDependencies.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// 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 functiongraph
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to filter dependent packages of FGS from HuaweiCloud.
//
// ## Example Usage
// ### Obtain all public dependent packages
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/FunctionGraph"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/FunctionGraph"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := FunctionGraph.GetDependencies(ctx, nil, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Obtain specific public dependent package by name
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/FunctionGraph"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/FunctionGraph"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := FunctionGraph.GetDependencies(ctx, &functiongraph.GetDependenciesArgs{
// Name: pulumi.StringRef("obssdk-3.0.2"),
// Type: pulumi.StringRef("public"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Obtain all public Python2.7 dependent packages
//
// ```go
// package main
//
// import (
//
// "github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/FunctionGraph"
// "github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/FunctionGraph"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := FunctionGraph.GetDependencies(ctx, &functiongraph.GetDependenciesArgs{
// Runtime: pulumi.StringRef("Python2.7"),
// Type: pulumi.StringRef("public"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetDependencies(ctx *pulumi.Context, args *GetDependenciesArgs, opts ...pulumi.InvokeOption) (*GetDependenciesResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetDependenciesResult
err := ctx.Invoke("huaweicloud:FunctionGraph/getDependencies:getDependencies", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDependencies.
type GetDependenciesArgs struct {
// Specifies the dependent package runtime to match.
Name *string `pulumi:"name"`
// Specifies the region in which to obtain the dependent packages. If omitted, the
// provider-level region will be used.
Region *string `pulumi:"region"`
// Specifies the dependent package runtime to match. Valid values: **Java8**,
// **Node.js6.10**, **Node.js8.10**, **Node.js10.16**, **Node.js12.13**, **Python2.7**, **Python3.6**, **Go1.8**,
// **Go1.x**, **C#(.NET Core 2.0)**, **C#(.NET Core 2.1)**, **C#(.NET Core 3.1)** and **PHP7.3**.
Runtime *string `pulumi:"runtime"`
// Specifies the dependent package type to match. Valid values: **public** and **private**.
Type *string `pulumi:"type"`
}
// A collection of values returned by getDependencies.
type GetDependenciesResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Dependent package name.
Name *string `pulumi:"name"`
// All dependent packages that match.
Packages []GetDependenciesPackage `pulumi:"packages"`
Region string `pulumi:"region"`
// Dependent package runtime.
Runtime *string `pulumi:"runtime"`
Type *string `pulumi:"type"`
}
func GetDependenciesOutput(ctx *pulumi.Context, args GetDependenciesOutputArgs, opts ...pulumi.InvokeOption) GetDependenciesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetDependenciesResult, error) {
args := v.(GetDependenciesArgs)
r, err := GetDependencies(ctx, &args, opts...)
var s GetDependenciesResult
if r != nil {
s = *r
}
return s, err
}).(GetDependenciesResultOutput)
}
// A collection of arguments for invoking getDependencies.
type GetDependenciesOutputArgs struct {
// Specifies the dependent package runtime to match.
Name pulumi.StringPtrInput `pulumi:"name"`
// Specifies the region in which to obtain the dependent packages. If omitted, the
// provider-level region will be used.
Region pulumi.StringPtrInput `pulumi:"region"`
// Specifies the dependent package runtime to match. Valid values: **Java8**,
// **Node.js6.10**, **Node.js8.10**, **Node.js10.16**, **Node.js12.13**, **Python2.7**, **Python3.6**, **Go1.8**,
// **Go1.x**, **C#(.NET Core 2.0)**, **C#(.NET Core 2.1)**, **C#(.NET Core 3.1)** and **PHP7.3**.
Runtime pulumi.StringPtrInput `pulumi:"runtime"`
// Specifies the dependent package type to match. Valid values: **public** and **private**.
Type pulumi.StringPtrInput `pulumi:"type"`
}
func (GetDependenciesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetDependenciesArgs)(nil)).Elem()
}
// A collection of values returned by getDependencies.
type GetDependenciesResultOutput struct{ *pulumi.OutputState }
func (GetDependenciesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetDependenciesResult)(nil)).Elem()
}
func (o GetDependenciesResultOutput) ToGetDependenciesResultOutput() GetDependenciesResultOutput {
return o
}
func (o GetDependenciesResultOutput) ToGetDependenciesResultOutputWithContext(ctx context.Context) GetDependenciesResultOutput {
return o
}
// The provider-assigned unique ID for this managed resource.
func (o GetDependenciesResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetDependenciesResult) string { return v.Id }).(pulumi.StringOutput)
}
// Dependent package name.
func (o GetDependenciesResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDependenciesResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
// All dependent packages that match.
func (o GetDependenciesResultOutput) Packages() GetDependenciesPackageArrayOutput {
return o.ApplyT(func(v GetDependenciesResult) []GetDependenciesPackage { return v.Packages }).(GetDependenciesPackageArrayOutput)
}
func (o GetDependenciesResultOutput) Region() pulumi.StringOutput {
return o.ApplyT(func(v GetDependenciesResult) string { return v.Region }).(pulumi.StringOutput)
}
// Dependent package runtime.
func (o GetDependenciesResultOutput) Runtime() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDependenciesResult) *string { return v.Runtime }).(pulumi.StringPtrOutput)
}
func (o GetDependenciesResultOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDependenciesResult) *string { return v.Type }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetDependenciesResultOutput{})
}