/
datastore.go
186 lines (154 loc) · 6.58 KB
/
datastore.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
// 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"
)
// Create a Datastore for an org
// Auto-naming is currently not supported for this resource.
type Datastore struct {
pulumi.CustomResourceState
// Datastore create time, in milliseconds since the epoch of 1970-01-01T00:00:00Z
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Datastore Configurations.
DatastoreConfig GoogleCloudApigeeV1DatastoreConfigResponseOutput `pulumi:"datastoreConfig"`
// Display name in UI
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Datastore last update time, in milliseconds since the epoch of 1970-01-01T00:00:00Z
LastUpdateTime pulumi.StringOutput `pulumi:"lastUpdateTime"`
// Organization that the datastore belongs to
Org pulumi.StringOutput `pulumi:"org"`
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
// Resource link of Datastore. Example: `/organizations/{org}/analytics/datastores/{uuid}`
Self pulumi.StringOutput `pulumi:"self"`
// Destination storage type. Supported types `gcs` or `bigquery`.
TargetType pulumi.StringOutput `pulumi:"targetType"`
}
// NewDatastore registers a new resource with the given unique name, arguments, and options.
func NewDatastore(ctx *pulumi.Context,
name string, args *DatastoreArgs, opts ...pulumi.ResourceOption) (*Datastore, 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'")
}
if args.OrganizationId == nil {
return nil, errors.New("invalid value for required argument 'OrganizationId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"organizationId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Datastore
err := ctx.RegisterResource("google-native:apigee/v1:Datastore", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDatastore gets an existing Datastore 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 GetDatastore(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DatastoreState, opts ...pulumi.ResourceOption) (*Datastore, error) {
var resource Datastore
err := ctx.ReadResource("google-native:apigee/v1:Datastore", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Datastore resources.
type datastoreState struct {
}
type DatastoreState struct {
}
func (DatastoreState) ElementType() reflect.Type {
return reflect.TypeOf((*datastoreState)(nil)).Elem()
}
type datastoreArgs struct {
// Datastore Configurations.
DatastoreConfig *GoogleCloudApigeeV1DatastoreConfig `pulumi:"datastoreConfig"`
// Display name in UI
DisplayName string `pulumi:"displayName"`
OrganizationId string `pulumi:"organizationId"`
// Destination storage type. Supported types `gcs` or `bigquery`.
TargetType *string `pulumi:"targetType"`
}
// The set of arguments for constructing a Datastore resource.
type DatastoreArgs struct {
// Datastore Configurations.
DatastoreConfig GoogleCloudApigeeV1DatastoreConfigPtrInput
// Display name in UI
DisplayName pulumi.StringInput
OrganizationId pulumi.StringInput
// Destination storage type. Supported types `gcs` or `bigquery`.
TargetType pulumi.StringPtrInput
}
func (DatastoreArgs) ElementType() reflect.Type {
return reflect.TypeOf((*datastoreArgs)(nil)).Elem()
}
type DatastoreInput interface {
pulumi.Input
ToDatastoreOutput() DatastoreOutput
ToDatastoreOutputWithContext(ctx context.Context) DatastoreOutput
}
func (*Datastore) ElementType() reflect.Type {
return reflect.TypeOf((**Datastore)(nil)).Elem()
}
func (i *Datastore) ToDatastoreOutput() DatastoreOutput {
return i.ToDatastoreOutputWithContext(context.Background())
}
func (i *Datastore) ToDatastoreOutputWithContext(ctx context.Context) DatastoreOutput {
return pulumi.ToOutputWithContext(ctx, i).(DatastoreOutput)
}
type DatastoreOutput struct{ *pulumi.OutputState }
func (DatastoreOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Datastore)(nil)).Elem()
}
func (o DatastoreOutput) ToDatastoreOutput() DatastoreOutput {
return o
}
func (o DatastoreOutput) ToDatastoreOutputWithContext(ctx context.Context) DatastoreOutput {
return o
}
// Datastore create time, in milliseconds since the epoch of 1970-01-01T00:00:00Z
func (o DatastoreOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Datastore Configurations.
func (o DatastoreOutput) DatastoreConfig() GoogleCloudApigeeV1DatastoreConfigResponseOutput {
return o.ApplyT(func(v *Datastore) GoogleCloudApigeeV1DatastoreConfigResponseOutput { return v.DatastoreConfig }).(GoogleCloudApigeeV1DatastoreConfigResponseOutput)
}
// Display name in UI
func (o DatastoreOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Datastore last update time, in milliseconds since the epoch of 1970-01-01T00:00:00Z
func (o DatastoreOutput) LastUpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.LastUpdateTime }).(pulumi.StringOutput)
}
// Organization that the datastore belongs to
func (o DatastoreOutput) Org() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.Org }).(pulumi.StringOutput)
}
func (o DatastoreOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
// Resource link of Datastore. Example: `/organizations/{org}/analytics/datastores/{uuid}`
func (o DatastoreOutput) Self() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.Self }).(pulumi.StringOutput)
}
// Destination storage type. Supported types `gcs` or `bigquery`.
func (o DatastoreOutput) TargetType() pulumi.StringOutput {
return o.ApplyT(func(v *Datastore) pulumi.StringOutput { return v.TargetType }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DatastoreInput)(nil)).Elem(), &Datastore{})
pulumi.RegisterOutputType(DatastoreOutput{})
}