Skip to content

Commit

Permalink
feat: added new Drive Labels API methods
Browse files Browse the repository at this point in the history
docs: updated comments

PiperOrigin-RevId: 590980233
  • Loading branch information
Google APIs authored and Copybara-Service committed Dec 14, 2023
1 parent fb027c8 commit ff9f02a
Show file tree
Hide file tree
Showing 14 changed files with 1,362 additions and 21 deletions.
19 changes: 14 additions & 5 deletions google/apps/drive/labels/v2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ proto_library(
"exception_detail.proto",
"field.proto",
"label.proto",
"label_limits.proto",
"label_lock.proto",
"label_permission.proto",
"label_service.proto",
"requests.proto",
"user_capabilities.proto",
],
deps = [
"//google/api:annotations_proto",
Expand All @@ -37,6 +40,8 @@ proto_library(
"//google/api:resource_proto",
"//google/type:color_proto",
"//google/type:date_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
Expand Down Expand Up @@ -139,6 +144,7 @@ go_gapic_library(
grpc_service_config = "drivelabels_v2_grpc_service_config.json",
importpath = "google.golang.org/google/apps/drive/labels/v2;labels",
metadata = True,
release_level = "ga",
rest_numeric_enums = True,
service_yaml = "drivelabels_v2.yaml",
transport = "grpc+rest",
Expand Down Expand Up @@ -176,7 +182,8 @@ py_gapic_library(
rest_numeric_enums = True,
service_yaml = "drivelabels_v2.yaml",
transport = "grpc+rest",
deps = [],
deps = [
],
)

py_test(
Expand Down Expand Up @@ -216,10 +223,13 @@ php_gapic_library(
name = "labels_php_gapic",
srcs = [":labels_proto_with_info"],
grpc_service_config = "drivelabels_v2_grpc_service_config.json",
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
rest_numeric_enums = True,
service_yaml = "drivelabels_v2.yaml",
transport = "grpc+rest",
deps = [":labels_php_proto"],
deps = [
":labels_php_proto",
],
)

# Open Source Packages
Expand Down Expand Up @@ -286,9 +296,7 @@ ruby_grpc_library(
ruby_cloud_gapic_library(
name = "labels_ruby_gapic",
srcs = [":labels_proto_with_info"],
extra_protoc_parameters = [
"ruby-cloud-gem-name=google-cloud-drive-labels-v2",
],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-drive-labels-v2"],
grpc_service_config = "drivelabels_v2_grpc_service_config.json",
rest_numeric_enums = True,
service_yaml = "drivelabels_v2.yaml",
Expand Down Expand Up @@ -322,6 +330,7 @@ load(

csharp_proto_library(
name = "labels_csharp_proto",
extra_opts = [],
deps = [":labels_proto"],
)

Expand Down
2 changes: 1 addition & 1 deletion google/apps/drive/labels/v2/common.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// 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.
Expand Down
49 changes: 46 additions & 3 deletions google/apps/drive/labels/v2/drivelabels_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,52 @@ apis:
documentation:
summary: An API for managing Drive Labels

backend:
authentication:
rules:
- selector: 'google.apps.drive.labels.v2.LabelService.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.labels
- selector: google.apps.drive.labels.v2.LabelService.GetLabel
deadline: 20.0
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.admin.labels.readonly,
https://www.googleapis.com/auth/drive.labels,
https://www.googleapis.com/auth/drive.labels.readonly
- selector: google.apps.drive.labels.v2.LabelService.GetLabelLimits
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.admin.labels.readonly,
https://www.googleapis.com/auth/drive.labels,
https://www.googleapis.com/auth/drive.labels.readonly
- selector: google.apps.drive.labels.v2.LabelService.GetUserCapabilities
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.admin.labels.readonly,
https://www.googleapis.com/auth/drive.labels,
https://www.googleapis.com/auth/drive.labels.readonly
- selector: google.apps.drive.labels.v2.LabelService.ListLabelLocks
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.admin.labels.readonly,
https://www.googleapis.com/auth/drive.labels,
https://www.googleapis.com/auth/drive.labels.readonly
- selector: google.apps.drive.labels.v2.LabelService.ListLabelPermissions
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.admin.labels.readonly,
https://www.googleapis.com/auth/drive.labels,
https://www.googleapis.com/auth/drive.labels.readonly
- selector: google.apps.drive.labels.v2.LabelService.ListLabels
deadline: 20.0
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/drive.admin.labels,
https://www.googleapis.com/auth/drive.admin.labels.readonly,
https://www.googleapis.com/auth/drive.labels,
https://www.googleapis.com/auth/drive.labels.readonly
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"methodConfig": [{
"name": [
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "GetUserCapabilities" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "ListLabels" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "GetLabel" }
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "GetLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "GetLabelLimits" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "ListLabelPermissions" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "ListLabelLocks" }
],
"timeout": "60s",
"retryPolicy": {
Expand All @@ -12,5 +16,22 @@
"backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE"]
}
},
{
"name": [
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "CreateLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "DeltaUpdateLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "UpdateLabelCopyMode" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "PublishLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "DisableLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "EnableLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "DeleteLabel" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "CreateLabelPermission" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "UpdateLabelPermission" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "DeleteLabelPermission" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "BatchUpdateLabelPermissions" },
{ "service": "google.apps.drive.labels.v2.LabelService.", "method": "BatchDeleteLabelPermissions" }
],
"timeout": "60s"
}]
}
2 changes: 1 addition & 1 deletion google/apps/drive/labels/v2/error_details.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// 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.
Expand Down
8 changes: 3 additions & 5 deletions google/apps/drive/labels/v2/exception_detail.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// 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.
Expand Down Expand Up @@ -108,10 +108,8 @@ enum ExceptionType {
INTERNAL_SERVER_ERROR = 500;
}

// Normalized internal-only message that identifies the exact exception that
// caused the error on the server.
// Exception detail.
message ExceptionDetail {
// The type of exception that occurred.
// required
// The type of exception that occurred. Required.
ExceptionType error_type = 1;
}
2 changes: 1 addition & 1 deletion google/apps/drive/labels/v2/field.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// 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.
Expand Down
15 changes: 14 additions & 1 deletion google/apps/drive/labels/v2/label.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// 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.
Expand Down Expand Up @@ -137,6 +137,10 @@ message Label {
// Admin-owned label. Only creatable and editable by admins. Supports some
// additional admin-only features.
ADMIN = 2;

// A label owned by an internal Google application rather than a customer.
// These labels are read-only.
GOOGLE_APP = 3;
}

// Output only. Resource name of the label. Will be in the form of either:
Expand Down Expand Up @@ -190,6 +194,15 @@ message Label {
google.protobuf.Timestamp disable_time = 12
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The customer this label belongs to.
// For example: "customers/123abc789."
string customer = 13 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "cloudidentity.googleapis.com/Customer"
}
];

// Required. The basic properties of the label.
Properties properties = 14 [(google.api.field_behavior) = REQUIRED];

Expand Down
155 changes: 155 additions & 0 deletions google/apps/drive/labels/v2/label_limits.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// 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
//
// http://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.apps.drive.labels.v2;

import "google/api/resource.proto";
import "google/type/date.proto";

option go_package = "google.golang.org/genproto/googleapis/apps/drive/labels/v2;labels";
option java_multiple_files = true;
option java_outer_classname = "LabelLimitsProto";
option java_package = "com.google.apps.drive.labels.v2";
option objc_class_prefix = "DLBL";

// Label constraints governing the structure of a Label; such as, the maximum
// number of Fields allowed and maximum length of the label title.
message LabelLimits {
option (google.api.resource) = {
type: "drivelabels.googleapis.com/LabelLimits"
pattern: "limits/label"
};

// Resource name.
string name = 1;

// The maximum number of characters allowed for the title.
int32 max_title_length = 2;

// The maximum number of characters allowed for the description.
int32 max_description_length = 3;

// The maximum number of Fields allowed within the label.
int32 max_fields = 4;

// The maximum number of published Fields that can be deleted.
int32 max_deleted_fields = 5;

// The maximum number of draft revisions that will be kept before deleting
// old drafts.
int32 max_draft_revisions = 6;

// The limits for Fields.
FieldLimits field_limits = 7;
}

// Field constants governing the structure of a Field; such as, the maximum
// title length, minimum and maximum field values or length, etc.
message FieldLimits {
// Max length for the id.
int32 max_id_length = 1;

// Limits for Field title.
int32 max_display_name_length = 2;

// Limits for Field description, also called help text.
int32 max_description_length = 3;

// The relevant limits for the specified Field.Type.
// Text Field limits.
TextLimits text_limits = 4;

// Long text Field limits.
LongTextLimits long_text_limits = 5;

// Integer Field limits.
IntegerLimits integer_limits = 6;

// Date Field limits.
DateLimits date_limits = 7;

// User Field limits.
UserLimits user_limits = 8;

// Selection Field limits.
SelectionLimits selection_limits = 9;
}

// Limits for list-variant of a Field type.
message ListLimits {
// Maximum number of values allowed for the Field type.
int32 max_entries = 1;
}

// Limits for text Field type.
message TextLimits {
// Minimum length allowed for a text Field type.
int32 min_length = 1;

// Maximum length allowed for a text Field type.
int32 max_length = 2;
}

// Limits for long text Field type.
message LongTextLimits {
// Minimum length allowed for a long text Field type.
int32 min_length = 1;

// Maximum length allowed for a long text Field type.
int32 max_length = 2;
}

// Limits for integer Field type.
message IntegerLimits {
// Minimum value for an integer Field type.
int64 min_value = 1;

// Maximum value for an integer Field type.
int64 max_value = 2;
}

// Limits for date Field type.
message DateLimits {
// Minimum value for the date Field type.
google.type.Date min_value = 1;

// Maximum value for the date Field type.
google.type.Date max_value = 2;
}

// Limits for selection Field type.
message SelectionLimits {
// Limits for list-variant of a Field type.
ListLimits list_limits = 1;

// Maximum ID length for a selection options.
int32 max_id_length = 2;

// Maximum length for display name.
int32 max_display_name_length = 3;

// The max number of choices.
int32 max_choices = 4;

// Maximum number of deleted choices.
int32 max_deleted_choices = 5;
}

// Limits for Field.Type.USER.
message UserLimits {
// Limits for list-variant of a Field type.
ListLimits list_limits = 1;
}

0 comments on commit ff9f02a

Please sign in to comment.