/
getApi.go
120 lines (99 loc) · 4.32 KB
/
getApi.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets an API proxy including a list of existing revisions.
func LookupApi(ctx *pulumi.Context, args *LookupApiArgs, opts ...pulumi.InvokeOption) (*LookupApiResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupApiResult
err := ctx.Invoke("google-native:apigee/v1:getApi", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupApiArgs struct {
ApiId string `pulumi:"apiId"`
OrganizationId string `pulumi:"organizationId"`
}
type LookupApiResult struct {
// The type of the API proxy.
ApiProxyType string `pulumi:"apiProxyType"`
// User labels applied to this API Proxy.
Labels map[string]string `pulumi:"labels"`
// The id of the most recently created revision for this api proxy.
LatestRevisionId string `pulumi:"latestRevisionId"`
// Metadata describing the API proxy.
MetaData GoogleCloudApigeeV1EntityMetadataResponse `pulumi:"metaData"`
// Name of the API proxy.
Name string `pulumi:"name"`
// Whether this proxy is read-only. A read-only proxy cannot have new revisions created through calls to CreateApiProxyRevision. A proxy is read-only if it was generated by an archive.
ReadOnly bool `pulumi:"readOnly"`
// List of revisions defined for the API proxy.
Revision []string `pulumi:"revision"`
}
func LookupApiOutput(ctx *pulumi.Context, args LookupApiOutputArgs, opts ...pulumi.InvokeOption) LookupApiResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupApiResult, error) {
args := v.(LookupApiArgs)
r, err := LookupApi(ctx, &args, opts...)
var s LookupApiResult
if r != nil {
s = *r
}
return s, err
}).(LookupApiResultOutput)
}
type LookupApiOutputArgs struct {
ApiId pulumi.StringInput `pulumi:"apiId"`
OrganizationId pulumi.StringInput `pulumi:"organizationId"`
}
func (LookupApiOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupApiArgs)(nil)).Elem()
}
type LookupApiResultOutput struct{ *pulumi.OutputState }
func (LookupApiResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupApiResult)(nil)).Elem()
}
func (o LookupApiResultOutput) ToLookupApiResultOutput() LookupApiResultOutput {
return o
}
func (o LookupApiResultOutput) ToLookupApiResultOutputWithContext(ctx context.Context) LookupApiResultOutput {
return o
}
// The type of the API proxy.
func (o LookupApiResultOutput) ApiProxyType() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.ApiProxyType }).(pulumi.StringOutput)
}
// User labels applied to this API Proxy.
func (o LookupApiResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupApiResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// The id of the most recently created revision for this api proxy.
func (o LookupApiResultOutput) LatestRevisionId() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.LatestRevisionId }).(pulumi.StringOutput)
}
// Metadata describing the API proxy.
func (o LookupApiResultOutput) MetaData() GoogleCloudApigeeV1EntityMetadataResponseOutput {
return o.ApplyT(func(v LookupApiResult) GoogleCloudApigeeV1EntityMetadataResponse { return v.MetaData }).(GoogleCloudApigeeV1EntityMetadataResponseOutput)
}
// Name of the API proxy.
func (o LookupApiResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupApiResult) string { return v.Name }).(pulumi.StringOutput)
}
// Whether this proxy is read-only. A read-only proxy cannot have new revisions created through calls to CreateApiProxyRevision. A proxy is read-only if it was generated by an archive.
func (o LookupApiResultOutput) ReadOnly() pulumi.BoolOutput {
return o.ApplyT(func(v LookupApiResult) bool { return v.ReadOnly }).(pulumi.BoolOutput)
}
// List of revisions defined for the API proxy.
func (o LookupApiResultOutput) Revision() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupApiResult) []string { return v.Revision }).(pulumi.StringArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupApiResultOutput{})
}