/
getSchema.go
98 lines (81 loc) · 3.6 KB
/
getSchema.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
// 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 v1beta
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets a Schema.
func LookupSchema(ctx *pulumi.Context, args *LookupSchemaArgs, opts ...pulumi.InvokeOption) (*LookupSchemaResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSchemaResult
err := ctx.Invoke("google-native:discoveryengine/v1beta:getSchema", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupSchemaArgs struct {
CollectionId string `pulumi:"collectionId"`
DataStoreId string `pulumi:"dataStoreId"`
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
SchemaId string `pulumi:"schemaId"`
}
type LookupSchemaResult struct {
// The JSON representation of the schema.
JsonSchema string `pulumi:"jsonSchema"`
// Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
Name string `pulumi:"name"`
// The structured representation of the schema.
StructSchema map[string]string `pulumi:"structSchema"`
}
func LookupSchemaOutput(ctx *pulumi.Context, args LookupSchemaOutputArgs, opts ...pulumi.InvokeOption) LookupSchemaResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSchemaResult, error) {
args := v.(LookupSchemaArgs)
r, err := LookupSchema(ctx, &args, opts...)
var s LookupSchemaResult
if r != nil {
s = *r
}
return s, err
}).(LookupSchemaResultOutput)
}
type LookupSchemaOutputArgs struct {
CollectionId pulumi.StringInput `pulumi:"collectionId"`
DataStoreId pulumi.StringInput `pulumi:"dataStoreId"`
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
SchemaId pulumi.StringInput `pulumi:"schemaId"`
}
func (LookupSchemaOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSchemaArgs)(nil)).Elem()
}
type LookupSchemaResultOutput struct{ *pulumi.OutputState }
func (LookupSchemaResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSchemaResult)(nil)).Elem()
}
func (o LookupSchemaResultOutput) ToLookupSchemaResultOutput() LookupSchemaResultOutput {
return o
}
func (o LookupSchemaResultOutput) ToLookupSchemaResultOutputWithContext(ctx context.Context) LookupSchemaResultOutput {
return o
}
// The JSON representation of the schema.
func (o LookupSchemaResultOutput) JsonSchema() pulumi.StringOutput {
return o.ApplyT(func(v LookupSchemaResult) string { return v.JsonSchema }).(pulumi.StringOutput)
}
// Immutable. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
func (o LookupSchemaResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupSchemaResult) string { return v.Name }).(pulumi.StringOutput)
}
// The structured representation of the schema.
func (o LookupSchemaResultOutput) StructSchema() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupSchemaResult) map[string]string { return v.StructSchema }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSchemaResultOutput{})
}