Skip to content

Commit 17d3fb2

Browse files
Google APIscopybara-github
authored andcommitted
feat: added v3 proto for online/batch document translation and updated v3beta1 proto for format conversion
PiperOrigin-RevId: 393656336
1 parent e9da6f8 commit 17d3fb2

6 files changed

Lines changed: 671 additions & 36 deletions

File tree

google/cloud/translate/v3/BUILD.bazel

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -20,6 +29,8 @@ proto_library(
2029
"//google/api:field_behavior_proto",
2130
"//google/api:resource_proto",
2231
"//google/longrunning:operations_proto",
32+
"//google/rpc:status_proto",
33+
"@com_google_protobuf//:empty_proto",
2334
"@com_google_protobuf//:timestamp_proto",
2435
],
2536
)
@@ -58,12 +69,18 @@ java_grpc_library(
5869
java_gapic_library(
5970
name = "translation_java_gapic",
6071
srcs = [":translation_proto_with_info"],
72+
gapic_yaml = None,
6173
grpc_service_config = "translate_grpc_service_config.json",
74+
service_yaml = "translate_v3.yaml",
6275
test_deps = [
6376
":translation_java_grpc",
77+
"//google/cloud/location:location_java_grpc",
6478
],
6579
deps = [
6680
":translation_java_proto",
81+
"//google/api:api_java_proto",
82+
"//google/cloud/location:location_java_grpc",
83+
"//google/cloud/location:location_java_proto",
6784
],
6885
)
6986

@@ -83,6 +100,9 @@ java_gapic_assembly_gradle_pkg(
83100
":translation_java_grpc",
84101
":translation_java_proto",
85102
":translation_proto",
103+
"//google/cloud/location:location_java_grpc",
104+
"//google/cloud/location:location_java_proto",
105+
"//google/cloud/location:location_proto",
86106
],
87107
)
88108

@@ -105,6 +125,7 @@ go_proto_library(
105125
deps = [
106126
"//google/api:annotations_go_proto",
107127
"//google/longrunning:longrunning_go_proto",
128+
"//google/rpc:status_go_proto",
108129
],
109130
)
110131

@@ -113,9 +134,11 @@ go_gapic_library(
113134
srcs = [":translation_proto_with_info"],
114135
grpc_service_config = "translate_grpc_service_config.json",
115136
importpath = "cloud.google.com/go/translate/apiv3;translate",
137+
metadata = True,
116138
service_yaml = "translate_v3.yaml",
117139
deps = [
118140
":translation_go_proto",
141+
"//google/cloud/location:location_go_proto",
119142
"//google/longrunning:longrunning_go_proto",
120143
"@com_google_cloud_go//longrunning:go_default_library",
121144
"@com_google_cloud_go//longrunning/autogen:go_default_library",
@@ -134,6 +157,7 @@ go_gapic_assembly_pkg(
134157
name = "gapi-cloud-translation-v3-go",
135158
deps = [
136159
":translation_go_gapic",
160+
":translation_go_gapic_srcjar-metadata.srcjar",
137161
":translation_go_gapic_srcjar-test.srcjar",
138162
":translation_go_proto",
139163
],
@@ -155,6 +179,7 @@ py_gapic_library(
155179
opt_args = ["python-gapic-name=translate"],
156180
)
157181

182+
# Open Source Packages
158183
py_gapic_assembly_pkg(
159184
name = "translation-v3-py",
160185
deps = [
@@ -188,6 +213,7 @@ php_gapic_library(
188213
name = "translation_php_gapic",
189214
srcs = [":translation_proto_with_info"],
190215
grpc_service_config = "translate_grpc_service_config.json",
216+
service_yaml = "translate_v3.yaml",
191217
deps = [
192218
":translation_php_grpc",
193219
":translation_php_proto",
@@ -258,11 +284,11 @@ ruby_cloud_gapic_library(
258284
name = "translation_ruby_gapic",
259285
srcs = [":translation_proto_with_info"],
260286
extra_protoc_parameters = [
261-
"ruby-cloud-gem-name=google-cloud-translate-v3",
262-
"ruby-cloud-env-prefix=TRANSLATE",
263-
"ruby-cloud-product-url=https://cloud.google.com/translate",
264287
"ruby-cloud-api-id=translate.googleapis.com",
265288
"ruby-cloud-api-shortname=translate",
289+
"ruby-cloud-env-prefix=TRANSLATE",
290+
"ruby-cloud-gem-name=google-cloud-translate-v3",
291+
"ruby-cloud-product-url=https://cloud.google.com/translate",
266292
],
267293
grpc_service_config = "translate_grpc_service_config.json",
268294
ruby_cloud_description = "Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service.",

google/cloud/translate/v3/translate_grpc_service_config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
{
4848
"service": "google.cloud.translation.v3.TranslationService",
4949
"method": "CreateGlossary"
50+
},
51+
{
52+
"service": "google.cloud.translation.v3.TranslationService",
53+
"method": "TranslateDocument"
54+
},
55+
{
56+
"service": "google.cloud.translation.v3.TranslationService",
57+
"method": "BatchTranslateDocument"
5058
}
5159
],
5260
"timeout": "600s"

google/cloud/translate/v3/translate_v3.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,64 @@ apis:
88

99
documentation:
1010
summary: Integrates text translation into your website or application.
11+
rules:
12+
- selector: google.cloud.location.Locations.GetLocation
13+
description: Gets information about a location.
14+
15+
- selector: google.cloud.location.Locations.ListLocations
16+
description: Lists information about the supported locations for this service.
1117

1218
backend:
1319
rules:
20+
- selector: google.cloud.location.Locations.GetLocation
21+
deadline: 30.0
22+
- selector: google.cloud.location.Locations.ListLocations
23+
deadline: 30.0
1424
- selector: 'google.longrunning.Operations.*'
1525
deadline: 60.0
1626
- selector: google.longrunning.Operations.WaitOperation
1727
deadline: 120.0
1828

29+
http:
30+
rules:
31+
- selector: google.cloud.location.Locations.GetLocation
32+
get: '/v3/{name=projects/*/locations/*}'
33+
- selector: google.cloud.location.Locations.ListLocations
34+
get: '/v3/{name=projects/*}/locations'
35+
- selector: google.longrunning.Operations.CancelOperation
36+
post: '/v3/{name=projects/*/locations/*/operations/*}:cancel'
37+
body: '*'
38+
- selector: google.longrunning.Operations.DeleteOperation
39+
delete: '/v3/{name=projects/*/locations/*/operations/*}'
40+
- selector: google.longrunning.Operations.GetOperation
41+
get: '/v3/{name=projects/*/locations/*/operations/*}'
42+
- selector: google.longrunning.Operations.ListOperations
43+
get: '/v3/{name=projects/*/locations/*}/operations'
44+
- selector: google.longrunning.Operations.WaitOperation
45+
post: '/v3/{name=projects/*/locations/*/operations/*}:wait'
46+
body: '*'
47+
1948
authentication:
2049
rules:
50+
- selector: google.cloud.location.Locations.GetLocation
51+
oauth:
52+
canonical_scopes: |-
53+
https://www.googleapis.com/auth/cloud-platform,
54+
https://www.googleapis.com/auth/cloud-translation
55+
- selector: google.cloud.location.Locations.ListLocations
56+
oauth:
57+
canonical_scopes: |-
58+
https://www.googleapis.com/auth/cloud-platform,
59+
https://www.googleapis.com/auth/cloud-translation
2160
- selector: 'google.cloud.translation.v3.TranslationService.*'
2261
oauth:
2362
canonical_scopes: |-
2463
https://www.googleapis.com/auth/cloud-platform,
2564
https://www.googleapis.com/auth/cloud-translation
65+
- selector: google.cloud.translation.v3.TranslationService.BatchTranslateDocument
66+
oauth:
67+
canonical_scopes: |-
68+
https://www.googleapis.com/auth/cloud-platform
2669
- selector: google.cloud.translation.v3.TranslationService.BatchTranslateText
2770
oauth:
2871
canonical_scopes: |-

0 commit comments

Comments
 (0)