forked from googleapis/google-cloudevents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.proto
More file actions
361 lines (295 loc) · 12.2 KB
/
data.proto
File metadata and controls
361 lines (295 loc) · 12.2 KB
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.events.firebase.dataconnect.v1;
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/code.proto";
option csharp_namespace = "Google.Events.Protobuf.Firebase.DataConnect.V1";
option php_namespace = "Google\\Events\\Firebase\\DataConnect\\V1";
option ruby_package = "Google::Events::Firebase::DataConnect::V1";
// A Firebase Data Connect service.
message Service {
// Identifier. The relative resource name of the Firebase Data Connect
// service, in the format:
// ```
// projects/{project}/locations/{location}/services/{service}
// ```
// Note that the service ID is specific to Firebase Data Connect and does not
// correspond to any of the instance IDs of the underlying data source
// connections.
string name = 1;
// Output only. [Output only] Create time stamp.
google.protobuf.Timestamp create_time = 2;
// Output only. [Output only] Update time stamp.
google.protobuf.Timestamp update_time = 3;
// Optional. Labels as key value pairs.
map<string, string> labels = 4;
// Optional. Stores small amounts of arbitrary data.
map<string, string> annotations = 5;
// Output only. System-assigned, unique identifier.
string uid = 6;
// Output only. A field that if true, indicates that the system is working
// update the service.
bool reconciling = 7;
// Optional. Mutable human-readable name. 63 character limit.
string display_name = 8;
// Output only. This checksum is computed by the server based on the value of
// other fields, and may be sent on update and delete requests to ensure the
// client has an up-to-date value before proceeding.
// [AIP-154](https://google.aip.dev/154)
string etag = 99;
}
// A data source that backs Firebase Data Connect services.
message Datasource {
// Settings and configurations of the underlying data source.
oneof configuration {
// PostgreSQL configurations.
PostgreSql postgresql = 2;
}
}
// Settings for PostgreSQL data source.
message PostgreSql {
// Configure the behavior before deploying this schema.
// Default to `schema_validation=STRICT` if not specified.
oneof before_deploy {
// Optional. Configure how much Postgresql schema validation to perform.
SqlSchemaValidation schema_validation = 3;
// Optional. Configure how to perform Postgresql schema migration.
SqlSchemaMigration schema_migration = 5;
}
// Settings and configurations of the underlying database.
oneof configuration {
// No Postgres data source is linked.
// If set, don't allow `database` and `schema_validation` to be configured.
bool unlinked = 4;
// Cloud SQL configurations.
CloudSqlInstance cloud_sql = 2;
}
// Required. Name of the PostgreSQL database.
string database = 1;
}
// Settings for CloudSQL instance configuration.
message CloudSqlInstance {
// Required. Name of the CloudSQL instance, in the format:
// ```
// projects/{project}/locations/{location}/instances/{instance}
// ```
string instance = 1;
}
// The application schema of a Firebase Data Connect service.
message Schema {
// Identifier. The relative resource name of the schema, in the format:
// ```
// projects/{project}/locations/{location}/services/{service}/schemas/{schema}
// ```
// Right now, the only supported schema is "main".
string name = 1;
// Output only. [Output only] Create time stamp.
google.protobuf.Timestamp create_time = 2;
// Output only. [Output only] Update time stamp.
google.protobuf.Timestamp update_time = 3;
// Optional. Labels as key value pairs.
map<string, string> labels = 4;
// Optional. Stores small amounts of arbitrary data.
map<string, string> annotations = 5;
// Required. The data sources linked in the schema.
repeated Datasource datasources = 11;
// Required. The source files that comprise the application schema.
Source source = 7;
// Output only. System-assigned, unique identifier.
string uid = 8;
// Output only. A field that if true, indicates that the system is working to
// compile and deploy the schema.
bool reconciling = 9;
// Optional. Mutable human-readable name. 63 character limit.
string display_name = 10;
// Output only. This checksum is computed by the server based on the value of
// other fields, and may be sent on update and delete requests to ensure the
// client has an up-to-date value before proceeding.
// [AIP-154](https://google.aip.dev/154)
string etag = 99;
}
// Connector consists of a set of operations, i.e. queries and mutations.
message Connector {
// Identifier. The relative resource name of the connector, in the format:
// ```
// projects/{project}/locations/{location}/services/{service}/connectors/{connector}
// ```
string name = 1;
// Output only. [Output only] Create time stamp.
google.protobuf.Timestamp create_time = 2;
// Output only. [Output only] Update time stamp.
google.protobuf.Timestamp update_time = 3;
// Optional. Labels as key value pairs.
map<string, string> labels = 4;
// Optional. Stores small amounts of arbitrary data.
map<string, string> annotations = 5;
// Required. The source files that comprise the connector.
Source source = 6;
// Output only. System-assigned, unique identifier.
string uid = 7;
// Output only. A field that if true, indicates that the system is working to
// compile and deploy the connector.
bool reconciling = 8;
// Optional. Mutable human-readable name. 63 character limit.
string display_name = 9;
// Output only. This checksum is computed by the server based on the value of
// other fields, and may be sent on update and delete requests to ensure the
// client has an up-to-date value before proceeding.
// [AIP-154](https://google.aip.dev/154)
string etag = 99;
}
// Used to represent a set of source files.
message Source {
// Required. The files that comprise the source set.
repeated File files = 1;
}
// Individual files.
message File {
// Required. The file name including folder path, if applicable. The path
// should be relative to a local workspace (e.g.
// dataconnect/(schema|connector)/*.gql) and not an absolute path (e.g.
// /absolute/path/(schema|connector)/*.gql).
string path = 1;
// Required. The file's textual content.
string content = 2;
}
// Configure how much SQL Schema to perform for the given schema.
enum SqlSchemaValidation {
// Unspecified SQL schema validation.
// Default to STRICT.
SQL_SCHEMA_VALIDATION_UNSPECIFIED = 0;
// Skip no SQL schema validation. Use it with extreme caution.
// CreateSchema or UpdateSchema will succeed even if SQL database is
// unavailable or SQL schema is incompatible.
// Generated SQL may fail at execution time.
NONE = 1;
// Connect to the SQL database and validate that the SQL DDL matches the
// schema exactly. Surface any discrepancies as `FAILED_PRECONDITION` with an
// `IncompatibleSqlSchemaError` error detail.
STRICT = 2;
// Connect to the SQL database and validate that the SQL DDL has all the SQL
// resources used in the given Firebase Data Connect Schema. Surface any
// missing resources as `FAILED_PRECONDITION` with an
// `IncompatibleSqlSchemaError` error detail. Succeed even if there are
// unknown tables and columns.
COMPATIBLE = 3;
}
// Configure how to perform SQL Schema migration before deploying the Schema.
enum SqlSchemaMigration {
// Unspecified SQL schema migration.
SQL_SCHEMA_MIGRATION_UNSPECIFIED = 0;
// Connect to the SQL database and identify any missing SQL resources used
// in the given Firebase Data Connect Schema.
// Automatically create necessary SQL resources (SQL table, column, etc)
// before deploying the schema.
// During migration steps, the SQL Schema must comply with the previous
// before_deploy setting in case the migration is interrupted.
// Therefore, the previous before_deploy setting must not be
// `schema_validation=STRICT`.
MIGRATE_COMPATIBLE = 1;
}
// The data within all Service events.
message ServiceEventData {
// Optional. The Service event payload. Unset for deletion events.
Service payload = 1;
}
// The data within all Schema events.
message SchemaEventData {
// Optional. The Schema event payload. Unset for deletion events.
Schema payload = 1;
}
// The data within all Connector events.
message ConnectorEventData {
// Optional. The Connector event payload. Unset for deletion events.
Connector payload = 1;
}
// GraphqlError contains the error information of a GraphQL query or mutation.
message GraphqlError {
// The detailed error message.
// The message should help developer understand the underlying problem without
// leaking internal data.
string message = 1;
// The source locations where the error occurred.
// Locations should help developers and toolings identify the source of error
// quickly.
//
// Included in admin endpoints (`ExecuteGraphql`, `ExecuteGraphqlRead`,
// `IntrospectGraphql`, `ImpersonateQuery` and `ImpersonateMutation`,
// `UpdateSchema` and `UpdateConnector`) to reference the provided GraphQL
// GQL document.
//
// Omitted in `ExecuteMutation` and `ExecuteQuery` since the caller shouldn't
// have access access the underlying GQL source.
repeated SourceLocation locations = 2;
// The result field which could not be populated due to error.
//
// Clients can use path to identify whether a null result is intentional or
// caused by a runtime error.
// It should be a list of string or index from the root of GraphQL query
// document.
google.protobuf.ListValue path = 3;
// Additional error information.
GraphqlErrorExtensions extensions = 4;
}
// GraphqlErrorExtensions contains additional information of `GraphqlError`.
message GraphqlErrorExtensions {
// The source file name where the error occurred.
// Included only for `UpdateSchema` and `UpdateConnector`, it corresponds
// to `File.path` of the provided `Source`.
string file = 1;
// Maps to canonical gRPC codes.
// If not specified, it represents `Code.INTERNAL`.
google.rpc.Code code = 2;
// More detailed error message to assist debugging.
// It contains application business logic that are inappropriate to leak
// publicly.
//
// In the emulator, Data Connect API always includes it to assist local
// development and debugging.
// In the backend, ConnectorService always hides it.
// GraphqlService without impersonation always include it.
// GraphqlService with impersonation includes it only if explicitly opted-in
// with `include_debug_details` in `GraphqlRequestExtensions`.
string debug_details = 3;
}
// SourceLocation references a location in a GraphQL source.
message SourceLocation {
// Line number starting at 1.
int32 line = 1;
// Column number starting at 1.
int32 column = 2;
}
message Mutation {
// The result of the execution of the requested operation.
// If an error was raised before execution begins, the data entry should not
// be present in the result. (a request error:
// https://spec.graphql.org/draft/#sec-Errors.Request-Errors) If an error was
// raised during the execution that prevented a valid response, the data entry
// in the response should be null. (a field error:
// https://spec.graphql.org/draft/#sec-Errors.Error-Result-Format)
google.protobuf.Struct data = 1;
// Values for GraphQL variables provided in this request.
google.protobuf.Struct variables = 3;
// Errors of this response.
// If the data entry in the response is not present, the errors entry must be
// present.
// It conforms to https://spec.graphql.org/draft/#sec-Errors.
repeated GraphqlError errors = 2;
}
// The data within all Mutation events.
message MutationEventData {
Mutation payload = 1;
}