From 25aeca8f6c136d03d6029bda54e7cdab98af80ca Mon Sep 17 00:00:00 2001 From: Steffany Brown <30247553+steffnay@users.noreply.github.com> Date: Tue, 9 Jun 2020 16:16:14 -0700 Subject: [PATCH] feat(userAgent): allow for optional user agent to be provided (#671) * feat(userAgent): allow for optional user agent to be provided * chore: linted * updates @google-cloud/common version --- package.json | 2 +- src/bigquery.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e6c4dd25..22317d43 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "precompile": "gts clean" }, "dependencies": { - "@google-cloud/common": "^3.0.0", + "@google-cloud/common": "^3.1.0", "@google-cloud/paginator": "^3.0.0", "@google-cloud/promisify": "^2.0.0", "arrify": "^2.0.1", diff --git a/src/bigquery.ts b/src/bigquery.ts index 57f4d837..21b5434d 100644 --- a/src/bigquery.ts +++ b/src/bigquery.ts @@ -163,6 +163,7 @@ export interface BigQueryOptions extends common.GoogleAuthOptions { autoRetry?: boolean; maxRetries?: number; location?: string; + userAgent?: string; /** * The API endpoint of the service used to make requests. * Defaults to `bigquery.googleapis.com`. @@ -199,6 +200,8 @@ export interface BigQueryOptions extends common.GoogleAuthOptions { * native Promises. * @property {string} [location] The geographic location of all datasets and * jobs referenced and created through the client. + * @property {string} [userAgent] The value to be prepended to the User-Agent + * header in API requests. * @property {string[]} [scopes] Additional OAuth scopes to use in requests. For * example, to access an external data source, you may need the * `https://www.googleapis.com/auth/drive.readonly` scope.