/
consent.go
259 lines (221 loc) · 13.4 KB
/
consent.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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
// 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 Consent in the parent consent store.
type Consent struct {
pulumi.CustomResourceState
// The resource name of the Consent artifact that contains proof of the end user's consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consentArtifacts/{consent_artifact_id}`.
ConsentArtifact pulumi.StringOutput `pulumi:"consentArtifact"`
ConsentStoreId pulumi.StringOutput `pulumi:"consentStoreId"`
DatasetId pulumi.StringOutput `pulumi:"datasetId"`
// Timestamp in UTC of when this Consent is considered expired.
ExpireTime pulumi.StringOutput `pulumi:"expireTime"`
Location pulumi.StringOutput `pulumi:"location"`
// Optional. User-supplied key-value pairs used to organize Consent resources. Metadata keys must: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - begin with a letter - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes Metadata values must be: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes No more than 64 metadata entries can be associated with a given consent.
Metadata pulumi.StringMapOutput `pulumi:"metadata"`
// Resource name of the Consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}`. Cannot be changed after creation.
Name pulumi.StringOutput `pulumi:"name"`
// Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions.
Policies GoogleCloudHealthcareV1ConsentPolicyResponseArrayOutput `pulumi:"policies"`
Project pulumi.StringOutput `pulumi:"project"`
// The timestamp that the revision was created.
RevisionCreateTime pulumi.StringOutput `pulumi:"revisionCreateTime"`
// The revision ID of the Consent. The format is an 8-character hexadecimal string. Refer to a specific revision of a Consent by appending `@{revision_id}` to the Consent's resource name.
RevisionId pulumi.StringOutput `pulumi:"revisionId"`
// Indicates the current state of this Consent.
State pulumi.StringOutput `pulumi:"state"`
// Input only. The time to live for this Consent from when it is created.
Ttl pulumi.StringOutput `pulumi:"ttl"`
// User's UUID provided by the client.
UserId pulumi.StringOutput `pulumi:"userId"`
}
// NewConsent registers a new resource with the given unique name, arguments, and options.
func NewConsent(ctx *pulumi.Context,
name string, args *ConsentArgs, opts ...pulumi.ResourceOption) (*Consent, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ConsentArtifact == nil {
return nil, errors.New("invalid value for required argument 'ConsentArtifact'")
}
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'")
}
if args.State == nil {
return nil, errors.New("invalid value for required argument 'State'")
}
if args.UserId == nil {
return nil, errors.New("invalid value for required argument 'UserId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"consentStoreId",
"datasetId",
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Consent
err := ctx.RegisterResource("google-native:healthcare/v1:Consent", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetConsent gets an existing Consent 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 GetConsent(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ConsentState, opts ...pulumi.ResourceOption) (*Consent, error) {
var resource Consent
err := ctx.ReadResource("google-native:healthcare/v1:Consent", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Consent resources.
type consentState struct {
}
type ConsentState struct {
}
func (ConsentState) ElementType() reflect.Type {
return reflect.TypeOf((*consentState)(nil)).Elem()
}
type consentArgs struct {
// The resource name of the Consent artifact that contains proof of the end user's consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consentArtifacts/{consent_artifact_id}`.
ConsentArtifact string `pulumi:"consentArtifact"`
ConsentStoreId string `pulumi:"consentStoreId"`
DatasetId string `pulumi:"datasetId"`
// Timestamp in UTC of when this Consent is considered expired.
ExpireTime *string `pulumi:"expireTime"`
Location *string `pulumi:"location"`
// Optional. User-supplied key-value pairs used to organize Consent resources. Metadata keys must: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - begin with a letter - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes Metadata values must be: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes No more than 64 metadata entries can be associated with a given consent.
Metadata map[string]string `pulumi:"metadata"`
// Resource name of the Consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}`. Cannot be changed after creation.
Name *string `pulumi:"name"`
// Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions.
Policies []GoogleCloudHealthcareV1ConsentPolicy `pulumi:"policies"`
Project *string `pulumi:"project"`
// Indicates the current state of this Consent.
State ConsentStateEnum `pulumi:"state"`
// Input only. The time to live for this Consent from when it is created.
Ttl *string `pulumi:"ttl"`
// User's UUID provided by the client.
UserId string `pulumi:"userId"`
}
// The set of arguments for constructing a Consent resource.
type ConsentArgs struct {
// The resource name of the Consent artifact that contains proof of the end user's consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consentArtifacts/{consent_artifact_id}`.
ConsentArtifact pulumi.StringInput
ConsentStoreId pulumi.StringInput
DatasetId pulumi.StringInput
// Timestamp in UTC of when this Consent is considered expired.
ExpireTime pulumi.StringPtrInput
Location pulumi.StringPtrInput
// Optional. User-supplied key-value pairs used to organize Consent resources. Metadata keys must: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - begin with a letter - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes Metadata values must be: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes No more than 64 metadata entries can be associated with a given consent.
Metadata pulumi.StringMapInput
// Resource name of the Consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}`. Cannot be changed after creation.
Name pulumi.StringPtrInput
// Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions.
Policies GoogleCloudHealthcareV1ConsentPolicyArrayInput
Project pulumi.StringPtrInput
// Indicates the current state of this Consent.
State ConsentStateEnumInput
// Input only. The time to live for this Consent from when it is created.
Ttl pulumi.StringPtrInput
// User's UUID provided by the client.
UserId pulumi.StringInput
}
func (ConsentArgs) ElementType() reflect.Type {
return reflect.TypeOf((*consentArgs)(nil)).Elem()
}
type ConsentInput interface {
pulumi.Input
ToConsentOutput() ConsentOutput
ToConsentOutputWithContext(ctx context.Context) ConsentOutput
}
func (*Consent) ElementType() reflect.Type {
return reflect.TypeOf((**Consent)(nil)).Elem()
}
func (i *Consent) ToConsentOutput() ConsentOutput {
return i.ToConsentOutputWithContext(context.Background())
}
func (i *Consent) ToConsentOutputWithContext(ctx context.Context) ConsentOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConsentOutput)
}
type ConsentOutput struct{ *pulumi.OutputState }
func (ConsentOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Consent)(nil)).Elem()
}
func (o ConsentOutput) ToConsentOutput() ConsentOutput {
return o
}
func (o ConsentOutput) ToConsentOutputWithContext(ctx context.Context) ConsentOutput {
return o
}
// The resource name of the Consent artifact that contains proof of the end user's consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consentArtifacts/{consent_artifact_id}`.
func (o ConsentOutput) ConsentArtifact() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.ConsentArtifact }).(pulumi.StringOutput)
}
func (o ConsentOutput) ConsentStoreId() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.ConsentStoreId }).(pulumi.StringOutput)
}
func (o ConsentOutput) DatasetId() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.DatasetId }).(pulumi.StringOutput)
}
// Timestamp in UTC of when this Consent is considered expired.
func (o ConsentOutput) ExpireTime() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.ExpireTime }).(pulumi.StringOutput)
}
func (o ConsentOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Optional. User-supplied key-value pairs used to organize Consent resources. Metadata keys must: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - begin with a letter - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes Metadata values must be: - be between 1 and 63 characters long - have a UTF-8 encoding of maximum 128 bytes - consist of up to 63 characters including lowercase letters, numeric characters, underscores, and dashes No more than 64 metadata entries can be associated with a given consent.
func (o ConsentOutput) Metadata() pulumi.StringMapOutput {
return o.ApplyT(func(v *Consent) pulumi.StringMapOutput { return v.Metadata }).(pulumi.StringMapOutput)
}
// Resource name of the Consent, of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}`. Cannot be changed after creation.
func (o ConsentOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Optional. Represents a user's consent in terms of the resources that can be accessed and under what conditions.
func (o ConsentOutput) Policies() GoogleCloudHealthcareV1ConsentPolicyResponseArrayOutput {
return o.ApplyT(func(v *Consent) GoogleCloudHealthcareV1ConsentPolicyResponseArrayOutput { return v.Policies }).(GoogleCloudHealthcareV1ConsentPolicyResponseArrayOutput)
}
func (o ConsentOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The timestamp that the revision was created.
func (o ConsentOutput) RevisionCreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.RevisionCreateTime }).(pulumi.StringOutput)
}
// The revision ID of the Consent. The format is an 8-character hexadecimal string. Refer to a specific revision of a Consent by appending `@{revision_id}` to the Consent's resource name.
func (o ConsentOutput) RevisionId() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.RevisionId }).(pulumi.StringOutput)
}
// Indicates the current state of this Consent.
func (o ConsentOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Input only. The time to live for this Consent from when it is created.
func (o ConsentOutput) Ttl() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.Ttl }).(pulumi.StringOutput)
}
// User's UUID provided by the client.
func (o ConsentOutput) UserId() pulumi.StringOutput {
return o.ApplyT(func(v *Consent) pulumi.StringOutput { return v.UserId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ConsentInput)(nil)).Elem(), &Consent{})
pulumi.RegisterOutputType(ConsentOutput{})
}