Client libraries

This reference describes where to download client library tar (*.tar.gz) files, and how to use them. These tar files were created with Bazel.

C Sharp

Download google-cloud-ces-v1-csharp.tar.gz.

Download google-cloud-ces-v1beta-csharp.tar.gz.

Talk to your Google Account contact for instructions.

Go

Download gapi-cloud-ces-v1-go.tar.gz.

Download gapi-cloud-ces-v1beta-go.tar.gz.

Clone cloud.google.com/go and capture the path like so:

git clone https://github.com/googleapis/google-cloud-go
export CLOUD_GO=`pwd`/google-cloud-go

Unpack the tar file: tar -xzpf gapi-cloud-ces-v1-go.tar.gz. Then, copy the sources to the CLOUD_GO directory.

cp -r ./cloud.google.com/go/gapi-cloud-ces-v1-go $CLOUD_GO

From the root directory of a Go module utilizing the client, replace the client dependency with the local clone.

Note: If this is not a brand new module, and a submodule has been published to CLOUD_GO, then target that module dependency with the following command instead.

go mod edit -replace=cloud.google.com/go=$CLOUD_GO

Now the locally generated client library is ready for use.

Java

Download google-cloud-ces-v1-java.tar.gz.

Download google-cloud-ces-v1beta-java.tar.gz.

You may choose one of the two possible options:

Option 1 (recommended): Install the client in a local maven cache: cd /path/to/library ./gradlew clean publishToMavenLocal

After that the client can be consumed from any Gradle or Maven project in a conventional way. See the following for an example of adding the locally built Java client library to a Maven project:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>gapic-google-cloud-ces-v1-java</artifactId>
            <version>0.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.google.api</groupId>
            <artifactId>gax-bom</artifactId>
            <version>${gax-bom.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>gapic-google-cloud-ces-v1-java</artifactId>
    </dependency>
    <dependency>
        <groupId>com.google.api</groupId>
        <artifactId>gax</artifactId>
    </dependency>
    <dependency>
        <groupId>com.google.api</groupId>
        <artifactId>gax-grpc</artifactId>
    </dependency>
    <dependency>
        <groupId>com.google.api</groupId>
        <artifactId>gax-httpjson</artifactId>
    </dependency>
</dependencies>

Option 2: Just build the client jar and pull all of its dependencies in a single folder: ./gradlew clean allJars

After that check the all-jars folder, it should contain all the jars needed to run the client (i.e. the client itself and all of its direct and transitive dependencies).

Node.js

Download ces-v1-nodejs.tar.gz.

Download ces-v1beta-nodejs.tar.gz.

NPM supports local installs using the tar file produced by npm pack.

First, unpack the file produced by Bazel:

tar xzf path/to/ces-v1-nodejs.tar.gz
cd ces-v1-nodejs

In the unpacked folder, run npm install to compile the library and npm pack to pack the result into the .tgz file to be consumed by npm:

npm install
npm pack

The resulting file can be passed to npm install:

npm install RESULTING_FILE

It can also be distributed within the project.

PHP

Download google-cloud-ces-v1-php.tar.gz.

Download google-cloud-ces-v1beta-php.tar.gz.

Unpack this into a folder in your project, for example:

tar xvf path/to/LIBRARY.tar.gz

This will unpack the client library to a local the folder. Move this folder into the root of your project, and add the following to your project's composer.json (or create one if it doesn't exist):

{
    "require": {
        "google/gax": "^1.34"
    },
    "autoload": {
        "classmap": [
            "LIBRARY/src",
            "LIBRARY/proto/src"
        ]
    }
}

This adds the google/gax dependency, and identifies the directories where the class files can be found and autoloaded by composer.

Run composer install, include vendor/autoload.php in your code, and you're ready to go.

Python

Download ces-v1-py.tar.gz.

Set up a virtual environment first:

python3 -m venv env
source env/bin/activate

Then install the library from the tar file: pip install ces-v1-py.tar.gz

Ruby

Download google-cloud-ces-v1-ruby.tar.gz.

Download google-cloud-ces-v1beta-ruby.tar.gz.

Talk to your Google Account contact for instructions.