/
attributeDefinition.go
235 lines (200 loc) · 12.4 KB
/
attributeDefinition.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
// 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 v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new Attribute definition in the parent consent store.
type AttributeDefinition struct {
pulumi.CustomResourceState
// Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation.
AllowedValues pulumi.StringArrayOutput `pulumi:"allowedValues"`
// Required. The ID of the Attribute definition to create. The string must match the following regex: `_a-zA-Z{0,255}` and must not be a reserved keyword within the Common Expression Language as listed on https://github.com/google/cel-spec/blob/master/doc/langdef.md.
AttributeDefinitionId pulumi.StringOutput `pulumi:"attributeDefinitionId"`
// The category of the attribute. The value of this field cannot be changed after creation.
Category pulumi.StringOutput `pulumi:"category"`
// Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
ConsentDefaultValues pulumi.StringArrayOutput `pulumi:"consentDefaultValues"`
ConsentStoreId pulumi.StringOutput `pulumi:"consentStoreId"`
// Optional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category `RESOURCE`.
DataMappingDefaultValue pulumi.StringOutput `pulumi:"dataMappingDefaultValue"`
DatasetId pulumi.StringOutput `pulumi:"datasetId"`
// Optional. A description of the attribute.
Description pulumi.StringOutput `pulumi:"description"`
Location pulumi.StringOutput `pulumi:"location"`
// Resource name of the Attribute definition, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id}`. Cannot be changed after creation.
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
}
// NewAttributeDefinition registers a new resource with the given unique name, arguments, and options.
func NewAttributeDefinition(ctx *pulumi.Context,
name string, args *AttributeDefinitionArgs, opts ...pulumi.ResourceOption) (*AttributeDefinition, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AllowedValues == nil {
return nil, errors.New("invalid value for required argument 'AllowedValues'")
}
if args.AttributeDefinitionId == nil {
return nil, errors.New("invalid value for required argument 'AttributeDefinitionId'")
}
if args.Category == nil {
return nil, errors.New("invalid value for required argument 'Category'")
}
if args.ConsentStoreId == nil {
return nil, errors.New("invalid value for required argument 'ConsentStoreId'")
}
if args.DatasetId == nil {
return nil, errors.New("invalid value for required argument 'DatasetId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"attributeDefinitionId",
"consentStoreId",
"datasetId",
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource AttributeDefinition
err := ctx.RegisterResource("google-native:healthcare/v1:AttributeDefinition", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAttributeDefinition gets an existing AttributeDefinition 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 GetAttributeDefinition(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AttributeDefinitionState, opts ...pulumi.ResourceOption) (*AttributeDefinition, error) {
var resource AttributeDefinition
err := ctx.ReadResource("google-native:healthcare/v1:AttributeDefinition", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AttributeDefinition resources.
type attributeDefinitionState struct {
}
type AttributeDefinitionState struct {
}
func (AttributeDefinitionState) ElementType() reflect.Type {
return reflect.TypeOf((*attributeDefinitionState)(nil)).Elem()
}
type attributeDefinitionArgs struct {
// Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation.
AllowedValues []string `pulumi:"allowedValues"`
// Required. The ID of the Attribute definition to create. The string must match the following regex: `_a-zA-Z{0,255}` and must not be a reserved keyword within the Common Expression Language as listed on https://github.com/google/cel-spec/blob/master/doc/langdef.md.
AttributeDefinitionId string `pulumi:"attributeDefinitionId"`
// The category of the attribute. The value of this field cannot be changed after creation.
Category AttributeDefinitionCategory `pulumi:"category"`
// Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
ConsentDefaultValues []string `pulumi:"consentDefaultValues"`
ConsentStoreId string `pulumi:"consentStoreId"`
// Optional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category `RESOURCE`.
DataMappingDefaultValue *string `pulumi:"dataMappingDefaultValue"`
DatasetId string `pulumi:"datasetId"`
// Optional. A description of the attribute.
Description *string `pulumi:"description"`
Location *string `pulumi:"location"`
// Resource name of the Attribute definition, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id}`. Cannot be changed after creation.
Name *string `pulumi:"name"`
Project *string `pulumi:"project"`
}
// The set of arguments for constructing a AttributeDefinition resource.
type AttributeDefinitionArgs struct {
// Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation.
AllowedValues pulumi.StringArrayInput
// Required. The ID of the Attribute definition to create. The string must match the following regex: `_a-zA-Z{0,255}` and must not be a reserved keyword within the Common Expression Language as listed on https://github.com/google/cel-spec/blob/master/doc/langdef.md.
AttributeDefinitionId pulumi.StringInput
// The category of the attribute. The value of this field cannot be changed after creation.
Category AttributeDefinitionCategoryInput
// Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
ConsentDefaultValues pulumi.StringArrayInput
ConsentStoreId pulumi.StringInput
// Optional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category `RESOURCE`.
DataMappingDefaultValue pulumi.StringPtrInput
DatasetId pulumi.StringInput
// Optional. A description of the attribute.
Description pulumi.StringPtrInput
Location pulumi.StringPtrInput
// Resource name of the Attribute definition, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id}`. Cannot be changed after creation.
Name pulumi.StringPtrInput
Project pulumi.StringPtrInput
}
func (AttributeDefinitionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*attributeDefinitionArgs)(nil)).Elem()
}
type AttributeDefinitionInput interface {
pulumi.Input
ToAttributeDefinitionOutput() AttributeDefinitionOutput
ToAttributeDefinitionOutputWithContext(ctx context.Context) AttributeDefinitionOutput
}
func (*AttributeDefinition) ElementType() reflect.Type {
return reflect.TypeOf((**AttributeDefinition)(nil)).Elem()
}
func (i *AttributeDefinition) ToAttributeDefinitionOutput() AttributeDefinitionOutput {
return i.ToAttributeDefinitionOutputWithContext(context.Background())
}
func (i *AttributeDefinition) ToAttributeDefinitionOutputWithContext(ctx context.Context) AttributeDefinitionOutput {
return pulumi.ToOutputWithContext(ctx, i).(AttributeDefinitionOutput)
}
type AttributeDefinitionOutput struct{ *pulumi.OutputState }
func (AttributeDefinitionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AttributeDefinition)(nil)).Elem()
}
func (o AttributeDefinitionOutput) ToAttributeDefinitionOutput() AttributeDefinitionOutput {
return o
}
func (o AttributeDefinitionOutput) ToAttributeDefinitionOutputWithContext(ctx context.Context) AttributeDefinitionOutput {
return o
}
// Possible values for the attribute. The number of allowed values must not exceed 500. An empty list is invalid. The list can only be expanded after creation.
func (o AttributeDefinitionOutput) AllowedValues() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringArrayOutput { return v.AllowedValues }).(pulumi.StringArrayOutput)
}
// Required. The ID of the Attribute definition to create. The string must match the following regex: `_a-zA-Z{0,255}` and must not be a reserved keyword within the Common Expression Language as listed on https://github.com/google/cel-spec/blob/master/doc/langdef.md.
func (o AttributeDefinitionOutput) AttributeDefinitionId() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.AttributeDefinitionId }).(pulumi.StringOutput)
}
// The category of the attribute. The value of this field cannot be changed after creation.
func (o AttributeDefinitionOutput) Category() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.Category }).(pulumi.StringOutput)
}
// Optional. Default values of the attribute in Consents. If no default values are specified, it defaults to an empty value.
func (o AttributeDefinitionOutput) ConsentDefaultValues() pulumi.StringArrayOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringArrayOutput { return v.ConsentDefaultValues }).(pulumi.StringArrayOutput)
}
func (o AttributeDefinitionOutput) ConsentStoreId() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.ConsentStoreId }).(pulumi.StringOutput)
}
// Optional. Default value of the attribute in User data mappings. If no default value is specified, it defaults to an empty value. This field is only applicable to attributes of the category `RESOURCE`.
func (o AttributeDefinitionOutput) DataMappingDefaultValue() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.DataMappingDefaultValue }).(pulumi.StringOutput)
}
func (o AttributeDefinitionOutput) DatasetId() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.DatasetId }).(pulumi.StringOutput)
}
// Optional. A description of the attribute.
func (o AttributeDefinitionOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
func (o AttributeDefinitionOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Resource name of the Attribute definition, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/attributeDefinitions/{attribute_definition_id}`. Cannot be changed after creation.
func (o AttributeDefinitionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o AttributeDefinitionOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *AttributeDefinition) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AttributeDefinitionInput)(nil)).Elem(), &AttributeDefinition{})
pulumi.RegisterOutputType(AttributeDefinitionOutput{})
}