/
taxonomy.go
191 lines (158 loc) · 9.11 KB
/
taxonomy.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
// 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 taxonomy in a specified project. The taxonomy is initially empty, that is, it doesn't contain policy tags.
// Auto-naming is currently not supported for this resource.
type Taxonomy struct {
pulumi.CustomResourceState
// Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list.
ActivatedPolicyTypes pulumi.StringArrayOutput `pulumi:"activatedPolicyTypes"`
// Optional. Description of this taxonomy. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns, and page breaks, and be at most 2000 bytes long when encoded in UTF-8.
Description pulumi.StringOutput `pulumi:"description"`
// User-defined name of this taxonomy. The name can't start or end with spaces, must contain only Unicode letters, numbers, underscores, dashes, and spaces, and be at most 200 bytes long when encoded in UTF-8. The taxonomy display name must be unique within an organization.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
Location pulumi.StringOutput `pulumi:"location"`
// Resource name of this taxonomy in URL format. Note: Policy tag manager generates unique taxonomy IDs.
Name pulumi.StringOutput `pulumi:"name"`
// Number of policy tags in this taxonomy.
PolicyTagCount pulumi.IntOutput `pulumi:"policyTagCount"`
Project pulumi.StringOutput `pulumi:"project"`
// Identity of the service which owns the Taxonomy. This field is only populated when the taxonomy is created by a Google Cloud service. Currently only 'DATAPLEX' is supported.
Service GoogleCloudDatacatalogV1TaxonomyServiceResponseOutput `pulumi:"service"`
// Creation and modification timestamps of this taxonomy.
TaxonomyTimestamps GoogleCloudDatacatalogV1SystemTimestampsResponseOutput `pulumi:"taxonomyTimestamps"`
}
// NewTaxonomy registers a new resource with the given unique name, arguments, and options.
func NewTaxonomy(ctx *pulumi.Context,
name string, args *TaxonomyArgs, opts ...pulumi.ResourceOption) (*Taxonomy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Taxonomy
err := ctx.RegisterResource("google-native:datacatalog/v1:Taxonomy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTaxonomy gets an existing Taxonomy 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 GetTaxonomy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TaxonomyState, opts ...pulumi.ResourceOption) (*Taxonomy, error) {
var resource Taxonomy
err := ctx.ReadResource("google-native:datacatalog/v1:Taxonomy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Taxonomy resources.
type taxonomyState struct {
}
type TaxonomyState struct {
}
func (TaxonomyState) ElementType() reflect.Type {
return reflect.TypeOf((*taxonomyState)(nil)).Elem()
}
type taxonomyArgs struct {
// Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list.
ActivatedPolicyTypes []TaxonomyActivatedPolicyTypesItem `pulumi:"activatedPolicyTypes"`
// Optional. Description of this taxonomy. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns, and page breaks, and be at most 2000 bytes long when encoded in UTF-8.
Description *string `pulumi:"description"`
// User-defined name of this taxonomy. The name can't start or end with spaces, must contain only Unicode letters, numbers, underscores, dashes, and spaces, and be at most 200 bytes long when encoded in UTF-8. The taxonomy display name must be unique within an organization.
DisplayName string `pulumi:"displayName"`
Location *string `pulumi:"location"`
Project *string `pulumi:"project"`
}
// The set of arguments for constructing a Taxonomy resource.
type TaxonomyArgs struct {
// Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list.
ActivatedPolicyTypes TaxonomyActivatedPolicyTypesItemArrayInput
// Optional. Description of this taxonomy. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns, and page breaks, and be at most 2000 bytes long when encoded in UTF-8.
Description pulumi.StringPtrInput
// User-defined name of this taxonomy. The name can't start or end with spaces, must contain only Unicode letters, numbers, underscores, dashes, and spaces, and be at most 200 bytes long when encoded in UTF-8. The taxonomy display name must be unique within an organization.
DisplayName pulumi.StringInput
Location pulumi.StringPtrInput
Project pulumi.StringPtrInput
}
func (TaxonomyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*taxonomyArgs)(nil)).Elem()
}
type TaxonomyInput interface {
pulumi.Input
ToTaxonomyOutput() TaxonomyOutput
ToTaxonomyOutputWithContext(ctx context.Context) TaxonomyOutput
}
func (*Taxonomy) ElementType() reflect.Type {
return reflect.TypeOf((**Taxonomy)(nil)).Elem()
}
func (i *Taxonomy) ToTaxonomyOutput() TaxonomyOutput {
return i.ToTaxonomyOutputWithContext(context.Background())
}
func (i *Taxonomy) ToTaxonomyOutputWithContext(ctx context.Context) TaxonomyOutput {
return pulumi.ToOutputWithContext(ctx, i).(TaxonomyOutput)
}
type TaxonomyOutput struct{ *pulumi.OutputState }
func (TaxonomyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Taxonomy)(nil)).Elem()
}
func (o TaxonomyOutput) ToTaxonomyOutput() TaxonomyOutput {
return o
}
func (o TaxonomyOutput) ToTaxonomyOutputWithContext(ctx context.Context) TaxonomyOutput {
return o
}
// Optional. A list of policy types that are activated for this taxonomy. If not set, defaults to an empty list.
func (o TaxonomyOutput) ActivatedPolicyTypes() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.StringArrayOutput { return v.ActivatedPolicyTypes }).(pulumi.StringArrayOutput)
}
// Optional. Description of this taxonomy. If not set, defaults to empty. The description must contain only Unicode characters, tabs, newlines, carriage returns, and page breaks, and be at most 2000 bytes long when encoded in UTF-8.
func (o TaxonomyOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
}
// User-defined name of this taxonomy. The name can't start or end with spaces, must contain only Unicode letters, numbers, underscores, dashes, and spaces, and be at most 200 bytes long when encoded in UTF-8. The taxonomy display name must be unique within an organization.
func (o TaxonomyOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
func (o TaxonomyOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Resource name of this taxonomy in URL format. Note: Policy tag manager generates unique taxonomy IDs.
func (o TaxonomyOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Number of policy tags in this taxonomy.
func (o TaxonomyOutput) PolicyTagCount() pulumi.IntOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.IntOutput { return v.PolicyTagCount }).(pulumi.IntOutput)
}
func (o TaxonomyOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Taxonomy) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Identity of the service which owns the Taxonomy. This field is only populated when the taxonomy is created by a Google Cloud service. Currently only 'DATAPLEX' is supported.
func (o TaxonomyOutput) Service() GoogleCloudDatacatalogV1TaxonomyServiceResponseOutput {
return o.ApplyT(func(v *Taxonomy) GoogleCloudDatacatalogV1TaxonomyServiceResponseOutput { return v.Service }).(GoogleCloudDatacatalogV1TaxonomyServiceResponseOutput)
}
// Creation and modification timestamps of this taxonomy.
func (o TaxonomyOutput) TaxonomyTimestamps() GoogleCloudDatacatalogV1SystemTimestampsResponseOutput {
return o.ApplyT(func(v *Taxonomy) GoogleCloudDatacatalogV1SystemTimestampsResponseOutput { return v.TaxonomyTimestamps }).(GoogleCloudDatacatalogV1SystemTimestampsResponseOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TaxonomyInput)(nil)).Elem(), &Taxonomy{})
pulumi.RegisterOutputType(TaxonomyOutput{})
}