Skip to content

Commit

Permalink
feat: Enable REST transport for most of Java and Go clients
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 456641589
  • Loading branch information
Google APIs authored and copybara-github committed Jun 23, 2022
1 parent 49de8b0 commit 8a251f5
Show file tree
Hide file tree
Showing 273 changed files with 2,317 additions and 520 deletions.
774 changes: 774 additions & 0 deletions BUILD.bazel

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ rules_proto_dependencies()

rules_proto_toolchains()


##############################################################################
# Go
##############################################################################
Expand Down Expand Up @@ -116,21 +115,21 @@ _gapic_generator_go_version = "0.31.0"

http_archive(
name = "com_googleapis_gapic_generator_go",
strip_prefix = "gapic-generator-go-%s" % _gapic_generator_go_version,
urls = ["https://github.com/googleapis/gapic-generator-go/archive/v%s.tar.gz" % _gapic_generator_go_version],
repo_mapping = {
"@go_googleapis": "@com_google_googleapis",
"@go_googleapis": "@com_google_googleapis",
},
strip_prefix = "gapic-generator-go-%s" % _gapic_generator_go_version,
urls = ["https://github.com/googleapis/gapic-generator-go/archive/v%s.tar.gz" % _gapic_generator_go_version],
)

load("@com_googleapis_gapic_generator_go//:repositories.bzl", "com_googleapis_gapic_generator_go_repositories")

com_googleapis_gapic_generator_go_repositories()

# rules_gapic also depends on rules_go, so it must come after our own dependency on rules_go.
_rules_gapic_version = "0.13.0"
_rules_gapic_version = "0.14.1"

_rules_gapic_sha256 = "1ebbd74b064697f4ff01d8f59764ba8431d52673f48f636be6b135b6da640b8e"
_rules_gapic_sha256 = "8483dfe3def57fb6549167dfc9792cdb878af2d521340fc50f094050a7a4180d"

http_archive(
name = "rules_gapic",
Expand Down Expand Up @@ -192,12 +191,13 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS")
# dependencies through maven_install.
# https://github.com/protocolbuffers/protobuf/issues/9132
RULES_JVM_EXTERNAL_TAG = "4.2"

RULES_JVM_EXTERNAL_SHA = "cd1a77b7b02e8e008439ca76fd34f5b07aecb8c752961f9640dea15e9e5ba1ca"

http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

Expand Down Expand Up @@ -343,6 +343,7 @@ gapic_generator_php_repositories()

# Required to access the C#-specific common resources config.
_gax_dotnet_version = "Google.Api.Gax-3.3.0"

_gax_dotnet_sha256 = "c4d31345a226987e8551cb81afa685c9322d3f806077d9f02011676cf00c15d9"

http_archive(
Expand All @@ -354,6 +355,7 @@ http_archive(
)

_gapic_generator_csharp_version = "1.4.2"

_gapic_generator_csharp_sha256 = "8141912164b242dfa25d7b10118faac68ce04b209112170057da7b95962a15c6"

http_archive(
Expand All @@ -364,27 +366,29 @@ http_archive(
)

load("@gapic_generator_csharp//:repositories.bzl", "gapic_generator_csharp_repositories")
gapic_generator_csharp_repositories()

gapic_generator_csharp_repositories()

# Version of C# generator targeting GAX v3. This is present so that teams that
# do not want to move immediately to GAX v4 when it comes out (e.g. Ads) are
# able to stick with the GAX-v3-based generator.

_gapic_generator_csharp_gax_v3_version = "1.3.19"

_gapic_generator_csharp_gax_v3_sha256 = "0e624db75f11a4d8ca1f8cc5c619c143be312aef892f76fc94695f9723a9c1e9"

http_archive(
name = "gapic_generator_csharp_gax_v3",
sha256 = _gapic_generator_csharp_gax_v3_sha256,
strip_prefix = "gapic-generator-csharp-%s" % _gapic_generator_csharp_gax_v3_version,
urls = ["https://github.com/googleapis/gapic-generator-csharp/archive/refs/tags/v%s.tar.gz" % _gapic_generator_csharp_gax_v3_version],
repo_mapping = {
"@gapic_generator_restore": "@gapic_generator_restore_gax_v3",
},
sha256 = _gapic_generator_csharp_gax_v3_sha256,
strip_prefix = "gapic-generator-csharp-%s" % _gapic_generator_csharp_gax_v3_version,
urls = ["https://github.com/googleapis/gapic-generator-csharp/archive/refs/tags/v%s.tar.gz" % _gapic_generator_csharp_gax_v3_version],
)

load("@gapic_generator_csharp_gax_v3//:repositories.bzl", gapic_generator_csharp_repositories_gax_v3 = "gapic_generator_csharp_repositories")

gapic_generator_csharp_repositories_gax_v3(gapic_generator_suffix = "_gax_v3")

##############################################################################
Expand Down
5 changes: 3 additions & 2 deletions google/ads/admob/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ java_gapic_library(
],
gapic_yaml = "admob_gapic.yaml",
grpc_service_config = "//google/ads/admob:admob_grpc_service_config.json",
transport = "rest",
test_deps = [
":admob_java_grpc",
],
transport = "rest",
deps = [
":admob_java_proto",
],
Expand All @@ -91,7 +91,7 @@ java_gapic_test(
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-ads-admob-v1-java",
transport = "rest",
transport = "grpc+rest",
deps = [
":admob_java_gapic",
":admob_java_grpc",
Expand Down Expand Up @@ -128,6 +128,7 @@ go_gapic_library(
grpc_service_config = None,
importpath = "google.golang.org/google/ads/admob/v1;admob",
service_yaml = "//google/ads/admob:admob_v1.yaml",
transport = "grpc+rest",
deps = [
":admob_go_proto",
],
Expand Down
3 changes: 2 additions & 1 deletion google/analytics/admin/v1alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ java_gapic_library(
java_gapic_test(
name = "admin_java_gapic_test_suite",
test_classes = [
"com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClientTest",
"com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClientHttpJsonTest",
"com.google.analytics.admin.v1alpha.AnalyticsAdminServiceClientTest",
],
runtime_deps = [":admin_java_gapic_test"],
)
Expand Down Expand Up @@ -128,6 +128,7 @@ go_gapic_library(
grpc_service_config = "admin_grpc_service_config.json",
importpath = "google.golang.org/google/analytics/admin/v1alpha;admin",
service_yaml = "analyticsadmin_v1alpha.yaml",
transport = "grpc+rest",
deps = [
":admin_go_proto",
],
Expand Down
3 changes: 2 additions & 1 deletion google/analytics/data/v1alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ java_gapic_library(
java_gapic_test(
name = "data_java_gapic_test_suite",
test_classes = [
"com.google.analytics.data.v1alpha.AlphaAnalyticsDataClientTest",
"com.google.analytics.data.v1alpha.AlphaAnalyticsDataClientHttpJsonTest",
"com.google.analytics.data.v1alpha.AlphaAnalyticsDataClientTest",
],
runtime_deps = [":data_java_gapic_test"],
)
Expand Down Expand Up @@ -127,6 +127,7 @@ go_gapic_library(
importpath = "google.golang.org/google/analytics/data/v1alpha;data",
metadata = True,
service_yaml = "analyticsdata_v1alpha.yaml",
transport = "grpc+rest",
deps = [
":data_go_proto",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
Expand Down
3 changes: 2 additions & 1 deletion google/analytics/data/v1beta/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ java_gapic_library(
java_gapic_test(
name = "data_java_gapic_test_suite",
test_classes = [
"com.google.analytics.data.v1beta.BetaAnalyticsDataClientTest",
"com.google.analytics.data.v1beta.BetaAnalyticsDataClientHttpJsonTest",
"com.google.analytics.data.v1beta.BetaAnalyticsDataClientTest",
],
runtime_deps = [":data_java_gapic_test"],
)
Expand Down Expand Up @@ -125,6 +125,7 @@ go_gapic_library(
importpath = "google.golang.org/google/analytics/data/v1beta;data",
metadata = True,
service_yaml = "analyticsdata_v1beta.yaml",
transport = "grpc+rest",
deps = [
":data_go_proto",
],
Expand Down
12 changes: 7 additions & 5 deletions google/api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,17 @@ proto_library(
proto_library(
name = "visibility_proto",
srcs = ["visibility.proto"],
deps = ["@com_google_protobuf//:descriptor_proto"],
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:descriptor_proto"],
)

##############################################################################
# Java
##############################################################################
load("@com_google_googleapis_imports//:imports.bzl",
"java_proto_library",
"java_gapic_assembly_gradle_pkg"
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_proto_library",
)

java_proto_library(
Expand Down Expand Up @@ -298,8 +299,8 @@ java_proto_library(
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-api-java",
transport = "grpc+rest",
deps = [
":api_java_proto",
"annotations_proto",
"auth_proto",
"backend_proto",
Expand Down Expand Up @@ -331,6 +332,7 @@ java_gapic_assembly_gradle_pkg(
"system_parameter_proto",
"usage_proto",
"visibility_proto",
":api_java_proto",
],
)

Expand Down
5 changes: 3 additions & 2 deletions google/api/servicecontrol/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ java_gapic_library(
java_gapic_test(
name = "servicecontrol_java_gapic_test_suite",
test_classes = [
"com.google.api.servicecontrol.v1.QuotaControllerClientTest",
"com.google.api.servicecontrol.v1.ServiceControllerClientTest",
"com.google.api.servicecontrol.v1.QuotaControllerClientHttpJsonTest",
"com.google.api.servicecontrol.v1.QuotaControllerClientTest",
"com.google.api.servicecontrol.v1.ServiceControllerClientHttpJsonTest",
"com.google.api.servicecontrol.v1.ServiceControllerClientTest",
],
runtime_deps = [":servicecontrol_java_gapic_test"],
)
Expand Down Expand Up @@ -141,6 +141,7 @@ go_gapic_library(
importpath = "cloud.google.com/go/api/servicecontrol/apiv1;servicecontrol",
metadata = True,
service_yaml = "servicecontrol.yaml",
transport = "grpc+rest",
deps = [
":servicecontrol_go_proto",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
Expand Down
3 changes: 2 additions & 1 deletion google/api/servicecontrol/v2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ java_gapic_library(
java_gapic_test(
name = "servicecontrol_java_gapic_test_suite",
test_classes = [
"com.google.api.servicecontrol.v2.ServiceControllerClientTest",
"com.google.api.servicecontrol.v2.ServiceControllerClientHttpJsonTest",
"com.google.api.servicecontrol.v2.ServiceControllerClientTest",
],
runtime_deps = [":servicecontrol_java_gapic_test"],
)
Expand Down Expand Up @@ -130,6 +130,7 @@ go_gapic_library(
importpath = "cloud.google.com/go/api/servicecontrol/apiv2;servicecontrol",
metadata = True,
service_yaml = "servicecontrol.yaml",
transport = "grpc+rest",
deps = [
":servicecontrol_go_proto",
],
Expand Down
3 changes: 2 additions & 1 deletion google/api/servicemanagement/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ java_gapic_library(
java_gapic_test(
name = "servicemanagement_java_gapic_test_suite",
test_classes = [
"com.google.cloud.api.servicemanagement.v1.ServiceManagerClientTest",
"com.google.cloud.api.servicemanagement.v1.ServiceManagerClientHttpJsonTest",
"com.google.cloud.api.servicemanagement.v1.ServiceManagerClientTest",
],
runtime_deps = [":servicemanagement_java_gapic_test"],
)
Expand Down Expand Up @@ -135,6 +135,7 @@ go_gapic_library(
importpath = "cloud.google.com/go/api/servicemanagement/apiv1;servicemanagement",
metadata = True,
service_yaml = "servicemanagement_v1.yaml",
transport = "grpc+rest",
deps = [
":servicemanagement_go_proto",
"//google/api:serviceconfig_go_proto",
Expand Down
2 changes: 1 addition & 1 deletion google/api/serviceusage/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ java_gapic_library(
java_gapic_test(
name = "serviceusage_java_gapic_test_suite",
test_classes = [
"com.google.api.serviceusage.v1.ServiceUsageClientTest",
"com.google.api.serviceusage.v1.ServiceUsageClientHttpJsonTest",
"com.google.api.serviceusage.v1.ServiceUsageClientTest",
],
runtime_deps = [":serviceusage_java_gapic_test"],
)
Expand Down
3 changes: 2 additions & 1 deletion google/api/serviceusage/v1beta1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ java_gapic_library(
java_gapic_test(
name = "serviceusage_java_gapic_test_suite",
test_classes = [
"com.google.api.serviceusage.v1beta1.ServiceUsageClientTest",
"com.google.api.serviceusage.v1beta1.ServiceUsageClientHttpJsonTest",
"com.google.api.serviceusage.v1beta1.ServiceUsageClientTest",
],
runtime_deps = [":serviceusage_java_gapic_test"],
)
Expand Down Expand Up @@ -137,6 +137,7 @@ go_gapic_library(
importpath = "cloud.google.com/go/api/serviceusage/apiv1beta1;serviceusage",
metadata = True,
service_yaml = "serviceusage_v1beta1.yaml",
transport = "grpc+rest",
deps = [
":serviceusage_go_proto",
"//google/longrunning:longrunning_go_proto",
Expand Down
13 changes: 12 additions & 1 deletion google/appengine/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ java_gapic_library(
test_deps = [
":appengine_java_grpc",
],
transport = "grpc+rest",
deps = [
":appengine_java_proto",
],
Expand All @@ -97,13 +98,21 @@ java_gapic_library(
java_gapic_test(
name = "appengine_java_gapic_test_suite",
test_classes = [
"com.google.appengine.v1.ApplicationsClientHttpJsonTest",
"com.google.appengine.v1.ApplicationsClientTest",
"com.google.appengine.v1.AuthorizedCertificatesClientHttpJsonTest",
"com.google.appengine.v1.AuthorizedCertificatesClientTest",
"com.google.appengine.v1.AuthorizedDomainsClientHttpJsonTest",
"com.google.appengine.v1.AuthorizedDomainsClientTest",
"com.google.appengine.v1.DomainMappingsClientHttpJsonTest",
"com.google.appengine.v1.DomainMappingsClientTest",
"com.google.appengine.v1.FirewallClientHttpJsonTest",
"com.google.appengine.v1.FirewallClientTest",
"com.google.appengine.v1.InstancesClientHttpJsonTest",
"com.google.appengine.v1.InstancesClientTest",
"com.google.appengine.v1.ServicesClientHttpJsonTest",
"com.google.appengine.v1.ServicesClientTest",
"com.google.appengine.v1.VersionsClientHttpJsonTest",
"com.google.appengine.v1.VersionsClientTest",
],
runtime_deps = [":appengine_java_gapic_test"],
Expand All @@ -112,6 +121,7 @@ java_gapic_test(
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-appengine-v1-java",
transport = "grpc+rest",
deps = [
":appengine_java_gapic",
":appengine_java_grpc",
Expand Down Expand Up @@ -149,6 +159,7 @@ go_gapic_library(
importpath = "cloud.google.com/go/appengine/apiv1;appengine",
metadata = True,
service_yaml = "appengine_v1.yaml",
transport = "grpc+rest",
deps = [
":appengine_go_proto",
"//google/longrunning:longrunning_go_proto",
Expand Down Expand Up @@ -280,8 +291,8 @@ nodejs_gapic_assembly_pkg(
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_gapic_assembly_pkg",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
Expand Down
Loading

0 comments on commit 8a251f5

Please sign in to comment.