forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getClient.go
180 lines (154 loc) · 6.71 KB
/
getClient.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// 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 eventgrid
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get properties of a client.
// Azure REST API version: 2023-06-01-preview.
//
// Other available API versions: 2023-12-15-preview, 2024-06-01-preview.
func LookupClient(ctx *pulumi.Context, args *LookupClientArgs, opts ...pulumi.InvokeOption) (*LookupClientResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupClientResult
err := ctx.Invoke("azure-native:eventgrid:getClient", args, &rv, opts...)
if err != nil {
return nil, err
}
return rv.Defaults(), nil
}
type LookupClientArgs struct {
// Name of the client.
ClientName string `pulumi:"clientName"`
// Name of the namespace.
NamespaceName string `pulumi:"namespaceName"`
// The name of the resource group within the user's subscription.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// The Client resource.
type LookupClientResult struct {
// Attributes for the client. Supported values are int, bool, string, string[].
// Example:
// "attributes": { "room": "345", "floor": 12, "deviceTypes": ["Fan", "Light"] }
Attributes interface{} `pulumi:"attributes"`
// Authentication information for the client.
Authentication *ClientAuthenticationResponse `pulumi:"authentication"`
// The name presented by the client for authentication. The default value is the name of the resource.
AuthenticationName *string `pulumi:"authenticationName"`
// The client certificate authentication information.
ClientCertificateAuthentication *ClientCertificateAuthenticationResponse `pulumi:"clientCertificateAuthentication"`
// Description for the Client resource.
Description *string `pulumi:"description"`
// Fully qualified identifier of the resource.
Id string `pulumi:"id"`
// Name of the resource.
Name string `pulumi:"name"`
// Provisioning state of the Client resource.
ProvisioningState string `pulumi:"provisioningState"`
// Indicates if the client is enabled or not. Default value is Enabled.
State *string `pulumi:"state"`
// The system metadata relating to the Client resource.
SystemData SystemDataResponse `pulumi:"systemData"`
// Type of the resource.
Type string `pulumi:"type"`
}
// Defaults sets the appropriate defaults for LookupClientResult
func (val *LookupClientResult) Defaults() *LookupClientResult {
if val == nil {
return nil
}
tmp := *val
if tmp.State == nil {
state_ := "Enabled"
tmp.State = &state_
}
return &tmp
}
func LookupClientOutput(ctx *pulumi.Context, args LookupClientOutputArgs, opts ...pulumi.InvokeOption) LookupClientResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupClientResult, error) {
args := v.(LookupClientArgs)
r, err := LookupClient(ctx, &args, opts...)
var s LookupClientResult
if r != nil {
s = *r
}
return s, err
}).(LookupClientResultOutput)
}
type LookupClientOutputArgs struct {
// Name of the client.
ClientName pulumi.StringInput `pulumi:"clientName"`
// Name of the namespace.
NamespaceName pulumi.StringInput `pulumi:"namespaceName"`
// The name of the resource group within the user's subscription.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupClientOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupClientArgs)(nil)).Elem()
}
// The Client resource.
type LookupClientResultOutput struct{ *pulumi.OutputState }
func (LookupClientResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupClientResult)(nil)).Elem()
}
func (o LookupClientResultOutput) ToLookupClientResultOutput() LookupClientResultOutput {
return o
}
func (o LookupClientResultOutput) ToLookupClientResultOutputWithContext(ctx context.Context) LookupClientResultOutput {
return o
}
// Attributes for the client. Supported values are int, bool, string, string[].
// Example:
// "attributes": { "room": "345", "floor": 12, "deviceTypes": ["Fan", "Light"] }
func (o LookupClientResultOutput) Attributes() pulumi.AnyOutput {
return o.ApplyT(func(v LookupClientResult) interface{} { return v.Attributes }).(pulumi.AnyOutput)
}
// Authentication information for the client.
func (o LookupClientResultOutput) Authentication() ClientAuthenticationResponsePtrOutput {
return o.ApplyT(func(v LookupClientResult) *ClientAuthenticationResponse { return v.Authentication }).(ClientAuthenticationResponsePtrOutput)
}
// The name presented by the client for authentication. The default value is the name of the resource.
func (o LookupClientResultOutput) AuthenticationName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupClientResult) *string { return v.AuthenticationName }).(pulumi.StringPtrOutput)
}
// The client certificate authentication information.
func (o LookupClientResultOutput) ClientCertificateAuthentication() ClientCertificateAuthenticationResponsePtrOutput {
return o.ApplyT(func(v LookupClientResult) *ClientCertificateAuthenticationResponse {
return v.ClientCertificateAuthentication
}).(ClientCertificateAuthenticationResponsePtrOutput)
}
// Description for the Client resource.
func (o LookupClientResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupClientResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
// Fully qualified identifier of the resource.
func (o LookupClientResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupClientResult) string { return v.Id }).(pulumi.StringOutput)
}
// Name of the resource.
func (o LookupClientResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupClientResult) string { return v.Name }).(pulumi.StringOutput)
}
// Provisioning state of the Client resource.
func (o LookupClientResultOutput) ProvisioningState() pulumi.StringOutput {
return o.ApplyT(func(v LookupClientResult) string { return v.ProvisioningState }).(pulumi.StringOutput)
}
// Indicates if the client is enabled or not. Default value is Enabled.
func (o LookupClientResultOutput) State() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupClientResult) *string { return v.State }).(pulumi.StringPtrOutput)
}
// The system metadata relating to the Client resource.
func (o LookupClientResultOutput) SystemData() SystemDataResponseOutput {
return o.ApplyT(func(v LookupClientResult) SystemDataResponse { return v.SystemData }).(SystemDataResponseOutput)
}
// Type of the resource.
func (o LookupClientResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupClientResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupClientResultOutput{})
}