forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
listAdminKey.go
94 lines (78 loc) · 3.54 KB
/
listAdminKey.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 search
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service.
// Azure REST API version: 2022-09-01.
//
// Other available API versions: 2015-02-28, 2021-04-01-preview, 2023-11-01, 2024-03-01-preview.
func ListAdminKey(ctx *pulumi.Context, args *ListAdminKeyArgs, opts ...pulumi.InvokeOption) (*ListAdminKeyResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv ListAdminKeyResult
err := ctx.Invoke("azure-native:search:listAdminKey", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type ListAdminKeyArgs struct {
// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the Azure Cognitive Search service associated with the specified resource group.
SearchServiceName string `pulumi:"searchServiceName"`
}
// Response containing the primary and secondary admin API keys for a given Azure Cognitive Search service.
type ListAdminKeyResult struct {
// The primary admin API key of the search service.
PrimaryKey string `pulumi:"primaryKey"`
// The secondary admin API key of the search service.
SecondaryKey string `pulumi:"secondaryKey"`
}
func ListAdminKeyOutput(ctx *pulumi.Context, args ListAdminKeyOutputArgs, opts ...pulumi.InvokeOption) ListAdminKeyResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (ListAdminKeyResult, error) {
args := v.(ListAdminKeyArgs)
r, err := ListAdminKey(ctx, &args, opts...)
var s ListAdminKeyResult
if r != nil {
s = *r
}
return s, err
}).(ListAdminKeyResultOutput)
}
type ListAdminKeyOutputArgs struct {
// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// The name of the Azure Cognitive Search service associated with the specified resource group.
SearchServiceName pulumi.StringInput `pulumi:"searchServiceName"`
}
func (ListAdminKeyOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*ListAdminKeyArgs)(nil)).Elem()
}
// Response containing the primary and secondary admin API keys for a given Azure Cognitive Search service.
type ListAdminKeyResultOutput struct{ *pulumi.OutputState }
func (ListAdminKeyResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*ListAdminKeyResult)(nil)).Elem()
}
func (o ListAdminKeyResultOutput) ToListAdminKeyResultOutput() ListAdminKeyResultOutput {
return o
}
func (o ListAdminKeyResultOutput) ToListAdminKeyResultOutputWithContext(ctx context.Context) ListAdminKeyResultOutput {
return o
}
// The primary admin API key of the search service.
func (o ListAdminKeyResultOutput) PrimaryKey() pulumi.StringOutput {
return o.ApplyT(func(v ListAdminKeyResult) string { return v.PrimaryKey }).(pulumi.StringOutput)
}
// The secondary admin API key of the search service.
func (o ListAdminKeyResultOutput) SecondaryKey() pulumi.StringOutput {
return o.ApplyT(func(v ListAdminKeyResult) string { return v.SecondaryKey }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(ListAdminKeyResultOutput{})
}