forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadministrator.go
206 lines (175 loc) · 7.54 KB
/
administrator.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// 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 dbforpostgresql
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Represents an Active Directory administrator.
// Azure REST API version: 2022-12-01.
//
// Other available API versions: 2023-03-01-preview, 2023-06-01-preview, 2023-12-01-preview.
type Administrator struct {
pulumi.CustomResourceState
// The name of the resource
Name pulumi.StringOutput `pulumi:"name"`
// The objectId of the Active Directory administrator.
ObjectId pulumi.StringPtrOutput `pulumi:"objectId"`
// Active Directory administrator principal name.
PrincipalName pulumi.StringPtrOutput `pulumi:"principalName"`
// The principal type used to represent the type of Active Directory Administrator.
PrincipalType pulumi.StringPtrOutput `pulumi:"principalType"`
// Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData SystemDataResponseOutput `pulumi:"systemData"`
// The tenantId of the Active Directory administrator.
TenantId pulumi.StringPtrOutput `pulumi:"tenantId"`
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type pulumi.StringOutput `pulumi:"type"`
}
// NewAdministrator registers a new resource with the given unique name, arguments, and options.
func NewAdministrator(ctx *pulumi.Context,
name string, args *AdministratorArgs, opts ...pulumi.ResourceOption) (*Administrator, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.ServerName == nil {
return nil, errors.New("invalid value for required argument 'ServerName'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:dbforpostgresql/v20220308preview:Administrator"),
},
{
Type: pulumi.String("azure-native:dbforpostgresql/v20221201:Administrator"),
},
{
Type: pulumi.String("azure-native:dbforpostgresql/v20230301preview:Administrator"),
},
{
Type: pulumi.String("azure-native:dbforpostgresql/v20230601preview:Administrator"),
},
{
Type: pulumi.String("azure-native:dbforpostgresql/v20231201preview:Administrator"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource Administrator
err := ctx.RegisterResource("azure-native:dbforpostgresql:Administrator", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAdministrator gets an existing Administrator resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetAdministrator(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AdministratorState, opts ...pulumi.ResourceOption) (*Administrator, error) {
var resource Administrator
err := ctx.ReadResource("azure-native:dbforpostgresql:Administrator", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Administrator resources.
type administratorState struct {
}
type AdministratorState struct {
}
func (AdministratorState) ElementType() reflect.Type {
return reflect.TypeOf((*administratorState)(nil)).Elem()
}
type administratorArgs struct {
// Guid of the objectId for the administrator.
ObjectId *string `pulumi:"objectId"`
// Active Directory administrator principal name.
PrincipalName *string `pulumi:"principalName"`
// The principal type used to represent the type of Active Directory Administrator.
PrincipalType *string `pulumi:"principalType"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the server.
ServerName string `pulumi:"serverName"`
// The tenantId of the Active Directory administrator.
TenantId *string `pulumi:"tenantId"`
}
// The set of arguments for constructing a Administrator resource.
type AdministratorArgs struct {
// Guid of the objectId for the administrator.
ObjectId pulumi.StringPtrInput
// Active Directory administrator principal name.
PrincipalName pulumi.StringPtrInput
// The principal type used to represent the type of Active Directory Administrator.
PrincipalType pulumi.StringPtrInput
// The name of the resource group. The name is case insensitive.
ResourceGroupName pulumi.StringInput
// The name of the server.
ServerName pulumi.StringInput
// The tenantId of the Active Directory administrator.
TenantId pulumi.StringPtrInput
}
func (AdministratorArgs) ElementType() reflect.Type {
return reflect.TypeOf((*administratorArgs)(nil)).Elem()
}
type AdministratorInput interface {
pulumi.Input
ToAdministratorOutput() AdministratorOutput
ToAdministratorOutputWithContext(ctx context.Context) AdministratorOutput
}
func (*Administrator) ElementType() reflect.Type {
return reflect.TypeOf((**Administrator)(nil)).Elem()
}
func (i *Administrator) ToAdministratorOutput() AdministratorOutput {
return i.ToAdministratorOutputWithContext(context.Background())
}
func (i *Administrator) ToAdministratorOutputWithContext(ctx context.Context) AdministratorOutput {
return pulumi.ToOutputWithContext(ctx, i).(AdministratorOutput)
}
type AdministratorOutput struct{ *pulumi.OutputState }
func (AdministratorOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Administrator)(nil)).Elem()
}
func (o AdministratorOutput) ToAdministratorOutput() AdministratorOutput {
return o
}
func (o AdministratorOutput) ToAdministratorOutputWithContext(ctx context.Context) AdministratorOutput {
return o
}
// The name of the resource
func (o AdministratorOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Administrator) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The objectId of the Active Directory administrator.
func (o AdministratorOutput) ObjectId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Administrator) pulumi.StringPtrOutput { return v.ObjectId }).(pulumi.StringPtrOutput)
}
// Active Directory administrator principal name.
func (o AdministratorOutput) PrincipalName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Administrator) pulumi.StringPtrOutput { return v.PrincipalName }).(pulumi.StringPtrOutput)
}
// The principal type used to represent the type of Active Directory Administrator.
func (o AdministratorOutput) PrincipalType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Administrator) pulumi.StringPtrOutput { return v.PrincipalType }).(pulumi.StringPtrOutput)
}
// Azure Resource Manager metadata containing createdBy and modifiedBy information.
func (o AdministratorOutput) SystemData() SystemDataResponseOutput {
return o.ApplyT(func(v *Administrator) SystemDataResponseOutput { return v.SystemData }).(SystemDataResponseOutput)
}
// The tenantId of the Active Directory administrator.
func (o AdministratorOutput) TenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Administrator) pulumi.StringPtrOutput { return v.TenantId }).(pulumi.StringPtrOutput)
}
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
func (o AdministratorOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *Administrator) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(AdministratorOutput{})
}