Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/getting-started/bazel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ your ``BUILD.bazel`` file. You can use the Python section of the Document AI
":documentai_py_gapic",
],
)

Some of the ``py_gapic_library`` rule that may be of interest:
* ``transport``: the desired transport(s) to generate, delimited by ``+`` e.g. ``grpc+rest``.
- Acceptable values are ``grpc`` and ``rest``.
- Defaults to ``grpc``.

* ``rest_numeric_enums``: if ``True``, enables generation of system parameter requesting response enums be encoded as numbers.
- Default is ``False``.
- Only effective when ``rest`` is included as a ``transport`` to be generated.

.. _BUILD.bazel: https://github.com/googleapis/googleapis/blob/master/google/cloud/documentai/v1beta2/BUILD.bazel

Compiling an API
Expand Down
4 changes: 4 additions & 0 deletions rules_python_gapic/py_gapic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def py_gapic_library(
metadata = True,
service_yaml = None,
transport = None,
rest_numeric_enums = False,
deps = [],
**kwargs):
srcjar_target_name = "%s_srcjar" % name
Expand All @@ -63,6 +64,9 @@ def py_gapic_library(
if transport:
opt_args = opt_args + ["transport=%s" % transport]

if rest_numeric_enums:
opt_args = opt_args + ["rest-numeric-enums"]

proto_custom_library(
name = srcjar_target_name,
deps = srcs,
Expand Down