/
getSource.go
136 lines (113 loc) · 4.72 KB
/
getSource.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
// 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 details of a single Source.
func LookupSource(ctx *pulumi.Context, args *LookupSourceArgs, opts ...pulumi.InvokeOption) (*LookupSourceResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSourceResult
err := ctx.Invoke("google-native:vmmigration/v1:getSource", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupSourceArgs struct {
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
SourceId string `pulumi:"sourceId"`
}
type LookupSourceResult struct {
// AWS type source details.
Aws AwsSourceDetailsResponse `pulumi:"aws"`
// Azure type source details.
Azure AzureSourceDetailsResponse `pulumi:"azure"`
// The create time timestamp.
CreateTime string `pulumi:"createTime"`
// User-provided description of the source.
Description string `pulumi:"description"`
// Optional. Immutable. The encryption details of the source data stored by the service.
Encryption EncryptionResponse `pulumi:"encryption"`
// The labels of the source.
Labels map[string]string `pulumi:"labels"`
// The Source name.
Name string `pulumi:"name"`
// The update time timestamp.
UpdateTime string `pulumi:"updateTime"`
// Vmware type source details.
Vmware VmwareSourceDetailsResponse `pulumi:"vmware"`
}
func LookupSourceOutput(ctx *pulumi.Context, args LookupSourceOutputArgs, opts ...pulumi.InvokeOption) LookupSourceResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSourceResult, error) {
args := v.(LookupSourceArgs)
r, err := LookupSource(ctx, &args, opts...)
var s LookupSourceResult
if r != nil {
s = *r
}
return s, err
}).(LookupSourceResultOutput)
}
type LookupSourceOutputArgs struct {
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
SourceId pulumi.StringInput `pulumi:"sourceId"`
}
func (LookupSourceOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSourceArgs)(nil)).Elem()
}
type LookupSourceResultOutput struct{ *pulumi.OutputState }
func (LookupSourceResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSourceResult)(nil)).Elem()
}
func (o LookupSourceResultOutput) ToLookupSourceResultOutput() LookupSourceResultOutput {
return o
}
func (o LookupSourceResultOutput) ToLookupSourceResultOutputWithContext(ctx context.Context) LookupSourceResultOutput {
return o
}
// AWS type source details.
func (o LookupSourceResultOutput) Aws() AwsSourceDetailsResponseOutput {
return o.ApplyT(func(v LookupSourceResult) AwsSourceDetailsResponse { return v.Aws }).(AwsSourceDetailsResponseOutput)
}
// Azure type source details.
func (o LookupSourceResultOutput) Azure() AzureSourceDetailsResponseOutput {
return o.ApplyT(func(v LookupSourceResult) AzureSourceDetailsResponse { return v.Azure }).(AzureSourceDetailsResponseOutput)
}
// The create time timestamp.
func (o LookupSourceResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupSourceResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// User-provided description of the source.
func (o LookupSourceResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupSourceResult) string { return v.Description }).(pulumi.StringOutput)
}
// Optional. Immutable. The encryption details of the source data stored by the service.
func (o LookupSourceResultOutput) Encryption() EncryptionResponseOutput {
return o.ApplyT(func(v LookupSourceResult) EncryptionResponse { return v.Encryption }).(EncryptionResponseOutput)
}
// The labels of the source.
func (o LookupSourceResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupSourceResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// The Source name.
func (o LookupSourceResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSourceResult) string { return v.Name }).(pulumi.StringOutput)
}
// The update time timestamp.
func (o LookupSourceResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupSourceResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
// Vmware type source details.
func (o LookupSourceResultOutput) Vmware() VmwareSourceDetailsResponseOutput {
return o.ApplyT(func(v LookupSourceResult) VmwareSourceDetailsResponse { return v.Vmware }).(VmwareSourceDetailsResponseOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSourceResultOutput{})
}