Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

feat: Add WriteDisposition to BigQuery Export API #80

Merged
merged 2 commits into from Dec 3, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -607,6 +607,19 @@ message ExportInsightsDataRequest {
string table = 2;
}

// Specifies the action that occurs if the destination table already exists.
enum WriteDisposition {
// Write disposition is not specified. Defaults to WRITE_TRUNCATE.
WRITE_DISPOSITION_UNSPECIFIED = 0;

// If the table already exists, BigQuery will overwrite the table data and
// use the schema from the load.
WRITE_TRUNCATE = 1;

// If the table already exists, BigQuery will append data to the table.
WRITE_APPEND = 2;
}

// Exporter destination.
oneof destination {
// Specified if sink is a BigQuery table.
Expand All @@ -629,6 +642,9 @@ message ExportInsightsDataRequest {
// Format:
// projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}
string kms_key = 4;

// Options for what to do if the destination table already exists.
WriteDisposition write_disposition = 5;
}

// Metadata for an export insights operation.
Expand Down
13 changes: 13 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -38,6 +38,10 @@ function main(parent) {
* projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}
*/
// const kmsKey = 'abc123'
/**
* Options for what to do if the destination table already exists.
*/
// const writeDisposition = {}

// Imports the Contactcenterinsights library
const {ContactCenterInsightsClient} =
Expand Down
2 changes: 2 additions & 0 deletions src/v1/contact_center_insights_client.ts
Expand Up @@ -2586,6 +2586,8 @@ export class ContactCenterInsightsClient {
* A fully qualified KMS key name for BigQuery tables protected by CMEK.
* Format:
* projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}/cryptoKeyVersions/{version}
* @param {google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.WriteDisposition} request.writeDisposition
* Options for what to do if the destination table already exists.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
Expand Down