diff --git a/generation/new_client/README.md b/generation/new_client/README.md index 390dd1f5f22b..f216d0294d96 100644 --- a/generation/new_client/README.md +++ b/generation/new_client/README.md @@ -172,17 +172,23 @@ Example: `https://cloud.google.com/alloydb/docs` ### REST Docs -The corresponding value in the Cloud Drop page is `documentation_uri`. +The corresponding value in the Cloud Drop page is `rest_reference_documentation_uri`. The value must starts with "https://". -Example: `https://cloud.google.com/alloydb/docs` +Example: `https://cloud.google.com/alloydb/docs/reference/rest` + +If they exist, add them as a flag to the python command below like: +`--rest-docs="https://cloud.google.com/alloydb/docs/reference/rest" \` ### RPC Docs -The corresponding value in the Cloud Drop page is `documentation_uri`. +The corresponding value in the Cloud Drop page is `proto_reference_documentation_uri`. The value must starts with "https://". -Example: `https://cloud.google.com/alloydb/docs` +Example: `https://cloud.google.com/speech-to-text/docs/reference/rpc` + +If they exist, add them as a flag to the python command below like: +`--rpc-docs="https://cloud.google.com/speech-to-text/docs/reference/rpc" \` ### API description diff --git a/generation/new_client/new-client.py b/generation/new_client/new-client.py index 454451b62912..452c99605732 100644 --- a/generation/new_client/new-client.py +++ b/generation/new_client/new-client.py @@ -150,6 +150,16 @@ def main(ctx): help="The URL of the repository that has generated Java code from proto " "service definition" ) +@click.option( + "--rest-docs", + type=str, + help="If it exists, link to the REST Documentation for a service" +) +@click.option( + "--rpc-docs", + type=str, + help="If it exists, link to the RPC Documentation for a service" +) def generate( api_shortname, name_pretty, @@ -168,6 +178,8 @@ def generate( owlbot_image, library_type, googleapis_gen_url, + rest_docs, + rpc_docs, ): cloud_prefix = "cloud-" if cloud_api else "" @@ -211,6 +223,11 @@ def generate( if requires_billing: repo_metadata["requires_billing"] = True + if rest_docs: + repo_metadata["rest_documentation"] = rest_docs + + if rpc_docs: + repo_metadata["rpc_documentation"] = rpc_docs # Initialize workdir workdir = Path(f"{sys.path[0]}/../../java-{output_name}").resolve() if os.path.isdir(workdir):