Skip to content

Commit 151bfba

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added ListWorkspaces, GetWorkspace, BatchDeleteRows APIs.
PiperOrigin-RevId: 358406243
1 parent b755429 commit 151bfba

3 files changed

Lines changed: 209 additions & 17 deletions

File tree

google/area120/tables/v1alpha1/area120tables_v1alpha1.yaml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,49 @@ authentication:
1313
canonical_scopes: |-
1414
https://www.googleapis.com/auth/drive,
1515
https://www.googleapis.com/auth/drive.file,
16-
https://www.googleapis.com/auth/spreadsheets
17-
- selector: google.area120.tables.v1alpha1.TablesService.GetRow
16+
https://www.googleapis.com/auth/drive.readonly,
17+
https://www.googleapis.com/auth/spreadsheets,
18+
https://www.googleapis.com/auth/spreadsheets.readonly,
19+
https://www.googleapis.com/auth/tables
20+
- selector: google.area120.tables.v1alpha1.TablesService.BatchCreateRows
1821
oauth:
1922
canonical_scopes: |-
2023
https://www.googleapis.com/auth/drive,
2124
https://www.googleapis.com/auth/drive.file,
22-
https://www.googleapis.com/auth/drive.readonly,
2325
https://www.googleapis.com/auth/spreadsheets,
24-
https://www.googleapis.com/auth/spreadsheets.readonly
25-
- selector: google.area120.tables.v1alpha1.TablesService.GetTable
26+
https://www.googleapis.com/auth/tables
27+
- selector: google.area120.tables.v1alpha1.TablesService.BatchDeleteRows
2628
oauth:
2729
canonical_scopes: |-
2830
https://www.googleapis.com/auth/drive,
2931
https://www.googleapis.com/auth/drive.file,
30-
https://www.googleapis.com/auth/drive.readonly,
3132
https://www.googleapis.com/auth/spreadsheets,
32-
https://www.googleapis.com/auth/spreadsheets.readonly
33-
- selector: google.area120.tables.v1alpha1.TablesService.ListRows
33+
https://www.googleapis.com/auth/tables
34+
- selector: google.area120.tables.v1alpha1.TablesService.BatchUpdateRows
35+
oauth:
36+
canonical_scopes: |-
37+
https://www.googleapis.com/auth/drive,
38+
https://www.googleapis.com/auth/drive.file,
39+
https://www.googleapis.com/auth/spreadsheets,
40+
https://www.googleapis.com/auth/tables
41+
- selector: google.area120.tables.v1alpha1.TablesService.CreateRow
42+
oauth:
43+
canonical_scopes: |-
44+
https://www.googleapis.com/auth/drive,
45+
https://www.googleapis.com/auth/drive.file,
46+
https://www.googleapis.com/auth/spreadsheets,
47+
https://www.googleapis.com/auth/tables
48+
- selector: google.area120.tables.v1alpha1.TablesService.DeleteRow
49+
oauth:
50+
canonical_scopes: |-
51+
https://www.googleapis.com/auth/drive,
52+
https://www.googleapis.com/auth/drive.file,
53+
https://www.googleapis.com/auth/spreadsheets,
54+
https://www.googleapis.com/auth/tables
55+
- selector: google.area120.tables.v1alpha1.TablesService.UpdateRow
3456
oauth:
3557
canonical_scopes: |-
3658
https://www.googleapis.com/auth/drive,
3759
https://www.googleapis.com/auth/drive.file,
38-
https://www.googleapis.com/auth/drive.readonly,
3960
https://www.googleapis.com/auth/spreadsheets,
40-
https://www.googleapis.com/auth/spreadsheets.readonly
61+
https://www.googleapis.com/auth/tables

google/area120/tables/v1alpha1/tables.proto

Lines changed: 174 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -37,14 +37,19 @@ option java_package = "com.google.area120.tables.v1alpha1";
3737
//
3838
// - Each Table has a collection of [Row][google.area120.tables.v1alpha1.Row]
3939
// resources, named `tables/*/rows/*`
40+
//
41+
// - The API has a collection of
42+
// [Workspace][google.area120.tables.v1alpha1.Workspace]
43+
// resources, named `workspaces/*`.
4044
service TablesService {
4145
option (google.api.default_host) = "area120tables.googleapis.com";
4246
option (google.api.oauth_scopes) =
4347
"https://www.googleapis.com/auth/drive,"
4448
"https://www.googleapis.com/auth/drive.file,"
4549
"https://www.googleapis.com/auth/drive.readonly,"
4650
"https://www.googleapis.com/auth/spreadsheets,"
47-
"https://www.googleapis.com/auth/spreadsheets.readonly";
51+
"https://www.googleapis.com/auth/spreadsheets.readonly,"
52+
"https://www.googleapis.com/auth/tables";
4853

4954
// Gets a table. Returns NOT_FOUND if the table does not exist.
5055
rpc GetTable(GetTableRequest) returns (Table) {
@@ -61,6 +66,21 @@ service TablesService {
6166
};
6267
}
6368

69+
// Gets a workspace. Returns NOT_FOUND if the workspace does not exist.
70+
rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) {
71+
option (google.api.http) = {
72+
get: "/v1alpha1/{name=workspaces/*}"
73+
};
74+
option (google.api.method_signature) = "name";
75+
}
76+
77+
// Lists workspaces for the user.
78+
rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) {
79+
option (google.api.http) = {
80+
get: "/v1alpha1/workspaces"
81+
};
82+
}
83+
6484
// Gets a row. Returns NOT_FOUND if the row does not exist in the table.
6585
rpc GetRow(GetRowRequest) returns (Row) {
6686
option (google.api.http) = {
@@ -118,13 +138,26 @@ service TablesService {
118138
};
119139
option (google.api.method_signature) = "name";
120140
}
141+
142+
// Deletes multiple rows.
143+
rpc BatchDeleteRows(BatchDeleteRowsRequest) returns (google.protobuf.Empty) {
144+
option (google.api.http) = {
145+
post: "/v1alpha1/{parent=tables/*}/rows:batchDelete"
146+
body: "*"
147+
};
148+
}
121149
}
122150

123151
// Request message for TablesService.GetTable.
124152
message GetTableRequest {
125153
// Required. The name of the table to retrieve.
126154
// Format: tables/{table}
127-
string name = 1 [(google.api.field_behavior) = REQUIRED];
155+
string name = 1 [
156+
(google.api.field_behavior) = REQUIRED,
157+
(google.api.resource_reference) = {
158+
type: "area120tables.googleapis.com/Table"
159+
}
160+
];
128161
}
129162

130163
// Request message for TablesService.ListTables.
@@ -154,11 +187,55 @@ message ListTablesResponse {
154187
string next_page_token = 2;
155188
}
156189

190+
// Request message for TablesService.GetWorkspace.
191+
message GetWorkspaceRequest {
192+
// Required. The name of the workspace to retrieve.
193+
// Format: workspaces/{workspace}
194+
string name = 1 [
195+
(google.api.field_behavior) = REQUIRED,
196+
(google.api.resource_reference) = {
197+
type: "area120tables.googleapis.com/Workspace"
198+
}
199+
];
200+
}
201+
202+
// Request message for TablesService.ListWorkspaces.
203+
message ListWorkspacesRequest {
204+
// The maximum number of workspaces to return. The service may return fewer
205+
// than this value.
206+
//
207+
// If unspecified, at most 10 workspaces are returned. The maximum value is
208+
// 25; values above 25 are coerced to 25.
209+
int32 page_size = 1;
210+
211+
// A page token, received from a previous `ListWorkspaces` call.
212+
// Provide this to retrieve the subsequent page.
213+
//
214+
// When paginating, all other parameters provided to `ListWorkspaces` must
215+
// match the call that provided the page token.
216+
string page_token = 2;
217+
}
218+
219+
// Response message for TablesService.ListWorkspaces.
220+
message ListWorkspacesResponse {
221+
// The list of workspaces.
222+
repeated Workspace workspaces = 1;
223+
224+
// A token, which can be sent as `page_token` to retrieve the next page.
225+
// If this field is empty, there are no subsequent pages.
226+
string next_page_token = 2;
227+
}
228+
157229
// Request message for TablesService.GetRow.
158230
message GetRowRequest {
159231
// Required. The name of the row to retrieve.
160232
// Format: tables/{table}/rows/{row}
161-
string name = 1 [(google.api.field_behavior) = REQUIRED];
233+
string name = 1 [
234+
(google.api.field_behavior) = REQUIRED,
235+
(google.api.resource_reference) = {
236+
type: "area120tables.googleapis.com/Row"
237+
}
238+
];
162239

163240
// Optional. Column key to use for values in the row.
164241
// Defaults to user entered name.
@@ -188,6 +265,11 @@ message ListRowsRequest {
188265
// Optional. Column key to use for values in the row.
189266
// Defaults to user entered name.
190267
View view = 4 [(google.api.field_behavior) = OPTIONAL];
268+
269+
// Optional. Raw text query to search for in rows of the table.
270+
// Special characters must be escaped. Logical operators and field specific
271+
// filtering not supported.
272+
string filter = 5 [(google.api.field_behavior) = OPTIONAL];
191273
}
192274

193275
// Response message for TablesService.ListRows.
@@ -275,6 +357,29 @@ message DeleteRowRequest {
275357
];
276358
}
277359

360+
// Request message for TablesService.BatchDeleteRows
361+
message BatchDeleteRowsRequest {
362+
// Required. The parent table shared by all rows being deleted.
363+
// Format: tables/{table}
364+
string parent = 1 [
365+
(google.api.field_behavior) = REQUIRED,
366+
(google.api.resource_reference) = {
367+
type: "area120tables.googleapis.com/Table"
368+
}
369+
];
370+
371+
// Required. The names of the rows to delete. All rows must belong to the parent table
372+
// or else the entire batch will fail. A maximum of 500 rows can be deleted
373+
// in a batch.
374+
// Format: tables/{table}/rows/{row}
375+
repeated string names = 2 [
376+
(google.api.field_behavior) = REQUIRED,
377+
(google.api.resource_reference) = {
378+
type: "area120tables.googleapis.com/Row"
379+
}
380+
];
381+
}
382+
278383
// A single table.
279384
message Table {
280385
option (google.api.resource) = {
@@ -300,12 +405,57 @@ message ColumnDescription {
300405
string name = 1;
301406

302407
// Data type of the column
303-
// Supported types are number, text, boolean, number_list, text_list,
304-
// boolean_list.
408+
// Supported types are auto_id, boolean, boolean_list, creator,
409+
// create_timestamp, date, dropdown, location, integer,
410+
// integer_list, number, number_list, person, person_list, tags, check_list,
411+
// text, text_list, update_timestamp, updater, relationship,
412+
// file_attachment_list.
413+
// These types directly map to the column types supported on Tables website.
305414
string data_type = 2;
306415

307416
// Internal id for a column.
308417
string id = 3;
418+
419+
// Optional. Range of labeled values for the column.
420+
// Some columns like tags and drop-downs limit the values to a set of
421+
// possible values. We return the range of values in such cases to help
422+
// clients implement better user data validation.
423+
repeated LabeledItem labels = 4 [(google.api.field_behavior) = OPTIONAL];
424+
425+
// Optional. Additional details about a relationship column. Specified when data_type
426+
// is relationship.
427+
RelationshipDetails relationship_details = 5 [(google.api.field_behavior) = OPTIONAL];
428+
429+
// Optional. Indicates that this is a lookup column whose value is derived from the
430+
// relationship column specified in the details. Lookup columns can not be
431+
// updated directly. To change the value you must update the associated
432+
// relationship column.
433+
LookupDetails lookup_details = 6 [(google.api.field_behavior) = OPTIONAL];
434+
}
435+
436+
// A single item in a labeled column.
437+
message LabeledItem {
438+
// Display string as entered by user.
439+
string name = 1;
440+
441+
// Internal id associated with the item.
442+
string id = 2;
443+
}
444+
445+
// Details about a relationship column.
446+
message RelationshipDetails {
447+
// The name of the table this relationship is linked to.
448+
string linked_table = 1;
449+
}
450+
451+
// Details about a lookup column whose value comes from the associated
452+
// relationship.
453+
message LookupDetails {
454+
// The name of the relationship column associated with the lookup.
455+
string relationship_column = 1;
456+
457+
// The id of the relationship column.
458+
string relationship_column_id = 2;
309459
}
310460

311461
// A single row in a table.
@@ -326,6 +476,24 @@ message Row {
326476
map<string, google.protobuf.Value> values = 2;
327477
}
328478

479+
// A single workspace.
480+
message Workspace {
481+
option (google.api.resource) = {
482+
type: "area120tables.googleapis.com/Workspace"
483+
pattern: "workspaces/{workspace}"
484+
};
485+
486+
// The resource name of the workspace.
487+
// Workspace names have the form `workspaces/{workspace}`.
488+
string name = 1;
489+
490+
// The human readable title of the workspace.
491+
string display_name = 2;
492+
493+
// The list of tables in the workspace.
494+
repeated Table tables = 3;
495+
}
496+
329497
// Column identifier used for the values in the row.
330498
enum View {
331499
// Defaults to user entered text.

google/area120/tables/v1alpha1/tables_grpc_service_config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
},
1313
{
1414
"name": [
15+
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "ListWorkspaces" },
16+
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "GetWorkspace" },
1517
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "ListTables" },
1618
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "GetTable" },
1719
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "GetRow" },
@@ -20,7 +22,8 @@
2022
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "BatchCreateRows" },
2123
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "UpdateRow" },
2224
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "BatchUpdateRows" },
23-
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "DeleteRow" }
25+
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "DeleteRow" },
26+
{ "service": "google.area120.tables.v1alpha1.TablesService", "method": "BatchDeleteRows" }
2427
],
2528
"timeout": "60s"
2629
}]

0 commit comments

Comments
 (0)