/
getKnowledgeBase.go
94 lines (77 loc) · 3.86 KB
/
getKnowledgeBase.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
// 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 v2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Retrieves the specified knowledge base.
func LookupKnowledgeBase(ctx *pulumi.Context, args *LookupKnowledgeBaseArgs, opts ...pulumi.InvokeOption) (*LookupKnowledgeBaseResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupKnowledgeBaseResult
err := ctx.Invoke("google-native:dialogflow/v2:getKnowledgeBase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupKnowledgeBaseArgs struct {
KnowledgeBaseId string `pulumi:"knowledgeBaseId"`
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
}
type LookupKnowledgeBaseResult struct {
// The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.
DisplayName string `pulumi:"displayName"`
// Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, expect this to be present for non en-us languages. When unspecified, the default language code en-us applies.
LanguageCode string `pulumi:"languageCode"`
// The knowledge base resource name. The name must be empty when creating a knowledge base. Format: `projects//locations//knowledgeBases/`.
Name string `pulumi:"name"`
}
func LookupKnowledgeBaseOutput(ctx *pulumi.Context, args LookupKnowledgeBaseOutputArgs, opts ...pulumi.InvokeOption) LookupKnowledgeBaseResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupKnowledgeBaseResult, error) {
args := v.(LookupKnowledgeBaseArgs)
r, err := LookupKnowledgeBase(ctx, &args, opts...)
var s LookupKnowledgeBaseResult
if r != nil {
s = *r
}
return s, err
}).(LookupKnowledgeBaseResultOutput)
}
type LookupKnowledgeBaseOutputArgs struct {
KnowledgeBaseId pulumi.StringInput `pulumi:"knowledgeBaseId"`
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupKnowledgeBaseOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupKnowledgeBaseArgs)(nil)).Elem()
}
type LookupKnowledgeBaseResultOutput struct{ *pulumi.OutputState }
func (LookupKnowledgeBaseResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupKnowledgeBaseResult)(nil)).Elem()
}
func (o LookupKnowledgeBaseResultOutput) ToLookupKnowledgeBaseResultOutput() LookupKnowledgeBaseResultOutput {
return o
}
func (o LookupKnowledgeBaseResultOutput) ToLookupKnowledgeBaseResultOutputWithContext(ctx context.Context) LookupKnowledgeBaseResultOutput {
return o
}
// The display name of the knowledge base. The name must be 1024 bytes or less; otherwise, the creation request fails.
func (o LookupKnowledgeBaseResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupKnowledgeBaseResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// Language which represents the KnowledgeBase. When the KnowledgeBase is created/updated, expect this to be present for non en-us languages. When unspecified, the default language code en-us applies.
func (o LookupKnowledgeBaseResultOutput) LanguageCode() pulumi.StringOutput {
return o.ApplyT(func(v LookupKnowledgeBaseResult) string { return v.LanguageCode }).(pulumi.StringOutput)
}
// The knowledge base resource name. The name must be empty when creating a knowledge base. Format: `projects//locations//knowledgeBases/`.
func (o LookupKnowledgeBaseResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupKnowledgeBaseResult) string { return v.Name }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupKnowledgeBaseResultOutput{})
}