Skip to content

Commit 4adc478

Browse files
Google APIscopybara-github
authored andcommitted
feat: added support for AppliedLabelChange
`ActionDetail` now include `AppliedLabelChange`, which details Labels applied, removed, or modified on Drive items. PiperOrigin-RevId: 475855752
1 parent b7c271c commit 4adc478

File tree

8 files changed

+176
-15
lines changed

8 files changed

+176
-15
lines changed

google/apps/drive/activity/v2/BUILD.bazel

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,17 @@ java_grpc_library(
7070
java_gapic_library(
7171
name = "activity_java_gapic",
7272
srcs = [":activity_proto_with_info"],
73+
gapic_yaml = None,
7374
grpc_service_config = "driveactivity_grpc_service_config.json",
75+
rest_numeric_enums = False,
76+
service_yaml = "driveactivity_v2.yaml",
7477
test_deps = [
7578
":activity_java_grpc",
7679
],
7780
transport = "grpc+rest",
7881
deps = [
7982
":activity_java_proto",
83+
"//google/api:api_java_proto",
8084
],
8185
)
8286

@@ -92,6 +96,7 @@ java_gapic_test(
9296
# Open Source Packages
9397
java_gapic_assembly_gradle_pkg(
9498
name = "google-apps-drive-activity-v2-java",
99+
include_samples = True,
95100
transport = "grpc+rest",
96101
deps = [
97102
":activity_java_gapic",
@@ -128,6 +133,7 @@ go_gapic_library(
128133
grpc_service_config = "driveactivity_grpc_service_config.json",
129134
importpath = "google.golang.org/google/apps/drive/activity/v2;activity",
130135
metadata = True,
136+
rest_numeric_enums = False,
131137
service_yaml = "driveactivity_v2.yaml",
132138
transport = "grpc+rest",
133139
deps = [
@@ -167,7 +173,11 @@ py_gapic_library(
167173
name = "activity_py_gapic",
168174
srcs = [":activity_proto"],
169175
grpc_service_config = "driveactivity_grpc_service_config.json",
176+
rest_numeric_enums = False,
177+
service_yaml = "driveactivity_v2.yaml",
170178
transport = "grpc",
179+
deps = [
180+
],
171181
)
172182

173183
py_test(
@@ -214,6 +224,8 @@ php_gapic_library(
214224
name = "activity_php_gapic",
215225
srcs = [":activity_proto_with_info"],
216226
grpc_service_config = "driveactivity_grpc_service_config.json",
227+
rest_numeric_enums = False,
228+
service_yaml = "driveactivity_v2.yaml",
217229
deps = [
218230
":activity_php_grpc",
219231
":activity_php_proto",
@@ -246,6 +258,7 @@ nodejs_gapic_library(
246258
extra_protoc_parameters = ["metadata"],
247259
grpc_service_config = "driveactivity_grpc_service_config.json",
248260
package = "google.apps.drive.activity.v2",
261+
rest_numeric_enums = False,
249262
service_yaml = "driveactivity_v2.yaml",
250263
deps = [],
251264
)
@@ -285,6 +298,8 @@ ruby_cloud_gapic_library(
285298
srcs = [":activity_proto_with_info"],
286299
extra_protoc_parameters = ["ruby-cloud-gem-name=google-apps-drive-activity-v2"],
287300
grpc_service_config = "driveactivity_grpc_service_config.json",
301+
rest_numeric_enums = False,
302+
service_yaml = "driveactivity_v2.yaml",
288303
deps = [
289304
":activity_ruby_grpc",
290305
":activity_ruby_proto",
@@ -328,6 +343,7 @@ csharp_gapic_library(
328343
srcs = [":activity_proto_with_info"],
329344
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
330345
grpc_service_config = "driveactivity_grpc_service_config.json",
346+
rest_numeric_enums = False,
331347
service_yaml = "driveactivity_v2.yaml",
332348
deps = [
333349
":activity_csharp_grpc",

google/apps/drive/activity/v2/action.proto

Lines changed: 152 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.
@@ -88,6 +88,9 @@ message ActionDetail {
8888

8989
// Settings were changed.
9090
SettingsChange settings_change = 13;
91+
92+
// Label was changed.
93+
AppliedLabelChange applied_label_change = 19;
9194
}
9295
}
9396

@@ -192,11 +195,6 @@ message PermissionChange {
192195

193196
// The permission setting of an object.
194197
message Permission {
195-
// Represents any user (including a logged out user).
196-
message Anyone {
197-
198-
}
199-
200198
// The [Google Drive permissions
201199
// roles](https://developers.google.com/drive/web/manage-sharing#roles).
202200
enum Role {
@@ -230,6 +228,11 @@ message Permission {
230228
PUBLISHED_VIEWER = 7;
231229
}
232230

231+
// Represents any user (including a logged out user).
232+
message Anyone {
233+
234+
}
235+
233236
// Indicates the
234237
// [Google Drive permissions
235238
// role](https://developers.google.com/drive/web/manage-sharing#roles). The
@@ -458,3 +461,146 @@ message SettingsChange {
458461
// The set of changes made to restrictions.
459462
repeated RestrictionChange restriction_changes = 1;
460463
}
464+
465+
// Label changes that were made on the Target.
466+
message AppliedLabelChange {
467+
// A change made to a Label on the Target.
468+
message AppliedLabelChangeDetail {
469+
// Change to a Field value.
470+
message FieldValueChange {
471+
// Contains a value of a Field.
472+
message FieldValue {
473+
// Wrapper for Text Field value.
474+
message Text {
475+
// Value of Text Field.
476+
optional string value = 1;
477+
}
478+
479+
// Wrapper for Text List Field value.
480+
message TextList {
481+
// Text values.
482+
repeated Text values = 1;
483+
}
484+
485+
// Wrapper for Selection Field value as combined value/display_name
486+
// pair for selected choice.
487+
message Selection {
488+
// Selection value as Field Choice ID.
489+
optional string value = 1;
490+
491+
// Selection value as human-readable display string.
492+
optional string display_name = 2;
493+
}
494+
495+
// Wrapper for SelectionList Field value.
496+
message SelectionList {
497+
// Selection values.
498+
repeated Selection values = 1;
499+
}
500+
501+
// Wrapper for Integer Field value.
502+
message Integer {
503+
// Integer value.
504+
optional int64 value = 1;
505+
}
506+
507+
// Wrapper for User Field value.
508+
message SingleUser {
509+
// User value as email.
510+
optional string value = 1;
511+
}
512+
513+
// Wrapper for UserList Field value.
514+
message UserList {
515+
// User values.
516+
repeated SingleUser values = 1;
517+
}
518+
519+
// Wrapper for Date Field value.
520+
message Date {
521+
// Date value.
522+
optional google.protobuf.Timestamp value = 1;
523+
}
524+
525+
// Field values for all Field types.
526+
oneof value {
527+
// Text Field value.
528+
Text text = 1;
529+
530+
// Text List Field value.
531+
TextList text_list = 3;
532+
533+
// Selection Field value.
534+
Selection selection = 4;
535+
536+
// Selection List Field value.
537+
SelectionList selection_list = 5;
538+
539+
// Integer Field value.
540+
Integer integer = 6;
541+
542+
// User Field value.
543+
SingleUser user = 7;
544+
545+
// User List Field value.
546+
UserList user_list = 8;
547+
548+
// Date Field value.
549+
Date date = 9;
550+
}
551+
}
552+
553+
// The ID of this field. Field IDs are unique within a Label.
554+
optional string field_id = 1;
555+
556+
// The value that was previously set on the field. If not present,
557+
// the field was newly set. At least one of {old_value|new_value} is
558+
// always set.
559+
optional FieldValue old_value = 2;
560+
561+
// The value that is now set on the field. If not present, the field was
562+
// cleared. At least one of {old_value|new_value} is always set.
563+
optional FieldValue new_value = 3;
564+
565+
// The human-readable display name for this field.
566+
optional string display_name = 4;
567+
}
568+
569+
// The type of Label change
570+
enum Type {
571+
// The type of change to this Label is not available.
572+
TYPE_UNSPECIFIED = 0;
573+
574+
// The identified Label was added to the Target.
575+
LABEL_ADDED = 1;
576+
577+
// The identified Label was removed from the Target.
578+
LABEL_REMOVED = 2;
579+
580+
// Field values were changed on the Target.
581+
LABEL_FIELD_VALUE_CHANGED = 3;
582+
583+
// The Label was applied as a side-effect of Drive item creation.
584+
LABEL_APPLIED_BY_ITEM_CREATE = 4;
585+
}
586+
587+
// The Label name representing the Label that changed.
588+
// This name always contains the revision of the Label that was used
589+
// when this Action occurred. The format is
590+
// `labels/id@revision`.
591+
string label = 1;
592+
593+
// The types of changes made to the Label on the Target.
594+
repeated Type types = 2;
595+
596+
// The human-readable title of the label that changed.
597+
string title = 3;
598+
599+
// Field Changes. Only present if `types` contains
600+
// `LABEL_FIELD_VALUE_CHANGED`.
601+
repeated FieldValueChange field_changes = 4;
602+
}
603+
604+
// Changes that were made to the Label on the Target.
605+
repeated AppliedLabelChangeDetail changes = 1;
606+
}

google/apps/drive/activity/v2/actor.proto

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.
@@ -16,8 +16,6 @@ syntax = "proto3";
1616

1717
package google.apps.drive.activity.v2;
1818

19-
import "google/apps/drive/activity/v2/common.proto";
20-
2119
option csharp_namespace = "Google.Apps.Drive.Activity.V2";
2220
option go_package = "google.golang.org/genproto/googleapis/apps/drive/activity/v2;activity";
2321
option java_multiple_files = true;

google/apps/drive/activity/v2/common.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.

google/apps/drive/activity/v2/drive_activity_service.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.
@@ -17,9 +17,9 @@ syntax = "proto3";
1717
package google.apps.drive.activity.v2;
1818

1919
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
2021
import "google/apps/drive/activity/v2/query_drive_activity_request.proto";
2122
import "google/apps/drive/activity/v2/query_drive_activity_response.proto";
22-
import "google/api/client.proto";
2323

2424
option csharp_namespace = "Google.Apps.Drive.Activity.V2";
2525
option go_package = "google.golang.org/genproto/googleapis/apps/drive/activity/v2;activity";

google/apps/drive/activity/v2/query_drive_activity_request.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.
@@ -73,6 +73,7 @@ message QueryDriveActivityRequest {
7373
// - `detail.action_detail_case: RENAME`
7474
// - `detail.action_detail_case:(CREATE EDIT)`
7575
// - `-detail.action_detail_case:MOVE`
76+
//
7677
string filter = 8;
7778
}
7879

google/apps/drive/activity/v2/query_drive_activity_response.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.

google/apps/drive/activity/v2/target.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 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.

0 commit comments

Comments
 (0)