当前位置: 首页>>代码示例>>Python>>正文


Python gcp.GAPICBazel方法代码示例

本文整理汇总了Python中synthtool.gcp.GAPICBazel方法的典型用法代码示例。如果您正苦于以下问题:Python gcp.GAPICBazel方法的具体用法?Python gcp.GAPICBazel怎么用?Python gcp.GAPICBazel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在synthtool.gcp的用法示例。


在下文中一共展示了gcp.GAPICBazel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: bazel_library

# 需要导入模块: from synthtool import gcp [as 别名]
# 或者: from synthtool.gcp import GAPICBazel [as 别名]
def bazel_library(
    service: str,
    version: str,
    package_pattern: str = "com.google.cloud.{service}.{version}",
    gapic: gcp.GAPICBazel = None,
    destination_name: str = None,
    **kwargs,
) -> Path:
    """Generate a Java library using the gapic-generator via bazel.

    Generates code into a temp directory, fixes missing header fields, and
    copies into the expected locations.

    Args:
        service (str): Name of the service.
        version (str): Service API version.
        package_pattern (str, optional): Package name template for fixing file
            headers. Defaults to "com.google.cloud.{service}.{version}".
        gapic (GAPICBazel, optional): Generator instance.
        destination_name (str, optional): Override the service name for the
            destination of the output code. Defaults to the service name.
        **kwargs: Additional options for gapic.java_library()

    Returns:
        The path to the temp directory containing the generated client.
    """
    if gapic is None:
        gapic = gcp.GAPICBazel()

    library = gapic.java_library(service=service, version=version, **kwargs)

    _common_generation(
        service=service,
        version=version,
        library=library / f"google-cloud-{service}-{version}-java",
        package_pattern=package_pattern,
        suffix="-java",
        destination_name=destination_name,
    )

    return library 
开发者ID:googleapis,项目名称:synthtool,代码行数:43,代码来源:java.py


注:本文中的synthtool.gcp.GAPICBazel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。