Skip to content

Commit 16f3e6f

Browse files
Google APIscopybara-github
authored andcommitted
feat: publishing OperationMetadata common proto
Committer: @alexander-fenster PiperOrigin-RevId: 379843367
1 parent 2d5f6e5 commit 16f3e6f

3 files changed

Lines changed: 190 additions & 0 deletions

File tree

google/cloud/common/BUILD.bazel

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
##############################################################################
4+
# Common
5+
##############################################################################
6+
load("@rules_proto//proto:defs.bzl", "proto_library")
7+
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
8+
9+
proto_library(
10+
name = "common_proto",
11+
srcs = [
12+
"operation_metadata.proto",
13+
],
14+
deps = [
15+
"//google/api:field_behavior_proto",
16+
"@com_google_protobuf//:timestamp_proto",
17+
],
18+
)
19+
20+
proto_library_with_info(
21+
name = "common_proto_with_info",
22+
deps = [
23+
":common_proto",
24+
"//google/cloud:common_resources_proto",
25+
],
26+
)
27+
28+
##############################################################################
29+
# Java
30+
##############################################################################
31+
load(
32+
"@com_google_googleapis_imports//:imports.bzl",
33+
"java_grpc_library",
34+
"java_proto_library",
35+
)
36+
37+
java_proto_library(
38+
name = "common_java_proto",
39+
deps = [":common_proto"],
40+
)
41+
42+
java_grpc_library(
43+
name = "common_java_grpc",
44+
srcs = [":common_proto"],
45+
deps = [":common_java_proto"],
46+
)
47+
48+
##############################################################################
49+
# Go
50+
##############################################################################
51+
load(
52+
"@com_google_googleapis_imports//:imports.bzl",
53+
"go_proto_library",
54+
)
55+
56+
go_proto_library(
57+
name = "common_go_proto",
58+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
59+
importpath = "google.golang.org/genproto/googleapis/cloud/common",
60+
protos = [":common_proto"],
61+
deps = [
62+
"//google/api:annotations_go_proto",
63+
],
64+
)
65+
66+
67+
##############################################################################
68+
# PHP
69+
##############################################################################
70+
load(
71+
"@com_google_googleapis_imports//:imports.bzl",
72+
"php_grpc_library",
73+
"php_proto_library",
74+
)
75+
76+
php_proto_library(
77+
name = "common_php_proto",
78+
deps = [":common_proto"],
79+
)
80+
81+
php_grpc_library(
82+
name = "common_php_grpc",
83+
srcs = [":common_proto"],
84+
deps = [":common_php_proto"],
85+
)
86+
87+
##############################################################################
88+
# Ruby
89+
##############################################################################
90+
load(
91+
"@com_google_googleapis_imports//:imports.bzl",
92+
"ruby_grpc_library",
93+
"ruby_proto_library",
94+
)
95+
96+
ruby_proto_library(
97+
name = "common_ruby_proto",
98+
deps = [":common_proto"],
99+
)
100+
101+
ruby_grpc_library(
102+
name = "common_ruby_grpc",
103+
srcs = [":common_proto"],
104+
deps = [":common_ruby_proto"],
105+
)
106+
107+
##############################################################################
108+
# C#
109+
##############################################################################
110+
load(
111+
"@com_google_googleapis_imports//:imports.bzl",
112+
"csharp_grpc_library",
113+
"csharp_proto_library",
114+
)
115+
116+
csharp_proto_library(
117+
name = "common_csharp_proto",
118+
deps = [":common_proto"],
119+
)
120+
121+
csharp_grpc_library(
122+
name = "common_csharp_grpc",
123+
srcs = [":common_proto"],
124+
deps = [":common_csharp_proto"],
125+
)
126+
127+
##############################################################################
128+
# C++
129+
##############################################################################
130+
# Put your C++ rules here

google/cloud/common/common.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: google.api.Service
2+
config_version: 3
3+
name: common.googleapis.com
4+
title: Common Operation Metadata type
5+
6+
types:
7+
- name: google.cloud.common.OperationMetadata
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.common;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/protobuf/timestamp.proto";
21+
22+
option go_package = "google.golang.org/genproto/googleapis/cloud/common;common";
23+
option java_multiple_files = true;
24+
option java_package = "com.google.cloud.common";
25+
26+
// Represents the metadata of the long-running operation.
27+
message OperationMetadata {
28+
// Output only. The time the operation was created.
29+
google.protobuf.Timestamp create_time = 1
30+
[(google.api.field_behavior) = OUTPUT_ONLY];
31+
32+
// Output only. The time the operation finished running.
33+
google.protobuf.Timestamp end_time = 2
34+
[(google.api.field_behavior) = OUTPUT_ONLY];
35+
36+
// Output only. Server-defined resource path for the target of the operation.
37+
string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
38+
39+
// Output only. Name of the verb executed by the operation.
40+
string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
41+
42+
// Output only. Human-readable status of the operation, if any.
43+
string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
44+
45+
// Output only. Identifies whether the user has requested cancellation
46+
// of the operation. Operations that have successfully been cancelled
47+
// have [Operation.error][] value with a [google.rpc.Status.code][] of 1,
48+
// corresponding to `Code.CANCELLED`.
49+
bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
50+
51+
// Output only. API version used to start the operation.
52+
string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
53+
}

0 commit comments

Comments
 (0)