diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto index a464645b5ac..37accec99ff 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto @@ -313,6 +313,7 @@ message DataSource { option (google.api.resource) = { type: "bigquerydatatransfer.googleapis.com/DataSource" pattern: "projects/{project}/dataSources/{data_source}" + pattern: "projects/{project}/locations/{location}/dataSources/{data_source}" }; // The type of authorization needed for this data source. @@ -417,7 +418,8 @@ message DataSource { // A request to get data source info. message GetDataSourceRequest { // Required. The field will contain name of the resource requested, for example: - // `projects/{project_id}/dataSources/{data_source_id}` + // `projects/{project_id}/dataSources/{data_source_id}` or + // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -429,11 +431,12 @@ message GetDataSourceRequest { // Request to list supported data sources and their data transfer settings. message ListDataSourcesRequest { // Required. The BigQuery project id for which data sources should be returned. - // Must be in the form: `projects/{project_id}` + // Must be in the form: `projects/{project_id}` or + // `projects/{project_id}/locations/{location_id} string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" + child_type: "bigquerydatatransfer.googleapis.com/DataSource" } ]; @@ -468,13 +471,13 @@ message ListDataSourcesResponse { // with the calling user. message CreateTransferConfigRequest { // Required. The BigQuery project id where the transfer configuration should be created. - // Must be in the format projects/{project_id}/locations/{location_id} - // If specified location and location of the destination bigquery dataset - // do not match - the request will fail. + // Must be in the format projects/{project_id}/locations/{location_id} or + // projects/{project_id}. If specified location and location of the + // destination bigquery dataset do not match - the request will fail. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" + child_type: "bigquerydatatransfer.googleapis.com/TransferConfig" } ]; @@ -506,6 +509,12 @@ message CreateTransferConfigRequest { // version_info back in the authorization response which be be put in a JWT // claim in the token request. string version_info = 5; + + // Optional service account name. If this field is set, transfer config will + // be created with this service account credentials. It requires that + // requesting user calling this API has permissions to act as this service + // account. + string service_account_name = 6; } // A request to update a transfer configuration. To update the user id of the @@ -542,12 +551,20 @@ message UpdateTransferConfigRequest { // version_info back in the authorization response which be be put in a JWT // claim in the token request. string version_info = 5; + + // Optional service account name. If this field is set and + // "service_account_name" is set in update_mask, transfer config will be + // updated to use this service account credentials. It requires that + // requesting user calling this API has permissions to act as this service + // account. + string service_account_name = 6; } // A request to get data transfer information. message GetTransferConfigRequest { // Required. The field will contain name of the resource requested, for example: - // `projects/{project_id}/transferConfigs/{config_id}` + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -560,7 +577,8 @@ message GetTransferConfigRequest { // and log messages will be deleted as well. message DeleteTransferConfigRequest { // Required. The field will contain name of the resource requested, for example: - // `projects/{project_id}/transferConfigs/{config_id}` + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -572,11 +590,12 @@ message DeleteTransferConfigRequest { // A request to get data transfer run information. message GetTransferRunRequest { // Required. The field will contain name of the resource requested, for example: - // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigquerydatatransfer.googleapis.com/TransferRun" + type: "bigquerydatatransfer.googleapis.com/Run" } ]; } @@ -584,11 +603,12 @@ message GetTransferRunRequest { // A request to delete data transfer run information. message DeleteTransferRunRequest { // Required. The field will contain name of the resource requested, for example: - // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigquerydatatransfer.googleapis.com/TransferRun" + type: "bigquerydatatransfer.googleapis.com/Run" } ]; } @@ -596,11 +616,12 @@ message DeleteTransferRunRequest { // A request to list data transfers configured for a BigQuery project. message ListTransferConfigsRequest { // Required. The BigQuery project id for which data sources - // should be returned: `projects/{project_id}`. + // should be returned: `projects/{project_id}` or + // `projects/{project_id}/locations/{location_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" + child_type: "bigquerydatatransfer.googleapis.com/TransferConfig" } ]; @@ -645,11 +666,12 @@ message ListTransferRunsRequest { // Required. Name of transfer configuration for which transfer runs should be retrieved. // Format of transfer configuration resource name is: - // `projects/{project_id}/transferConfigs/{config_id}`. + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigquerydatatransfer.googleapis.com/TransferConfig" + child_type: "bigquerydatatransfer.googleapis.com/Run" } ]; @@ -685,11 +707,12 @@ message ListTransferRunsResponse { // A request to get user facing log messages associated with data transfer run. message ListTransferLogsRequest { // Required. Transfer run name in the form: - // `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + // `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigquerydatatransfer.googleapis.com/TransferRun" + type: "bigquerydatatransfer.googleapis.com/Run" } ]; @@ -728,7 +751,8 @@ message ListTransferLogsResponse { // already valid merely based on the user id. message CheckValidCredsRequest { // Required. The data source in the form: - // `projects/{project_id}/dataSources/{data_source_id}` + // `projects/{project_id}/dataSources/{data_source_id}` or + // `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -746,7 +770,8 @@ message CheckValidCredsResponse { // A request to schedule transfer runs for a time range. message ScheduleTransferRunsRequest { // Required. Transfer configuration name in the form: - // `projects/{project_id}/transferConfigs/{config_id}`. + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -788,7 +813,8 @@ message StartManualTransferRunsRequest { } // Transfer configuration name in the form: - // `projects/{project_id}/transferConfigs/{config_id}`. + // `projects/{project_id}/transferConfigs/{config_id}` or + // `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. string parent = 1 [(google.api.resource_reference) = { type: "bigquerydatatransfer.googleapis.com/TransferConfig" }]; diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto index b0982d28686..941c266758d 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto @@ -30,6 +30,11 @@ option java_outer_classname = "TransferProto"; option java_package = "com.google.cloud.bigquery.datatransfer.v1"; option objc_class_prefix = "GCBDT"; option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1"; +option (google.api.resource_definition) = { + type: "bigquerydatatransfer.google.com/Parent" + pattern: "projects/{project}" + pattern: "projects/{project}/locations/{location}" +}; // DEPRECATED. Represents data transfer type. enum TransferType { @@ -68,6 +73,13 @@ enum TransferState { CANCELLED = 6; } +// Represents preferences for sending email notifications for transfer run +// events. +message EmailPreferences { + // If true, email notifications will be sent on transfer run failures. + bool enable_failure_email = 1; +} + // Options customizing the data transfer schedule. message ScheduleOptions { // If true, automatic scheduling of data transfer runs for this configuration @@ -100,6 +112,7 @@ message TransferConfig { option (google.api.resource) = { type: "bigquerydatatransfer.googleapis.com/TransferConfig" pattern: "projects/{project}/transferConfigs/{transfer_config}" + pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}" }; // The resource name of the transfer config. @@ -169,12 +182,21 @@ message TransferConfig { // Output only. Region in which BigQuery dataset is located. string dataset_region = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Pub/Sub topic where notifications will be sent after transfer runs + // associated with this transfer config finish. + string notification_pubsub_topic = 15; + + // Email notifications will be sent according to these preferences + // to the email address of the user who owns this transfer config. + EmailPreferences email_preferences = 18; } // Represents a data transfer run. message TransferRun { option (google.api.resource) = { - type: "bigquerydatatransfer.googleapis.com/TransferRun" + type: "bigquerydatatransfer.googleapis.com/Run" + pattern: "projects/{project}/transferConfigs/{transfer_config}/runs/{run}" pattern: "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}" }; @@ -229,6 +251,15 @@ message TransferRun { // NOTE: the system might choose to delay the schedule depending on the // current load, so `schedule_time` doesn't always match this. string schedule = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Pub/Sub topic where a notification will be sent after this + // transfer run finishes + string notification_pubsub_topic = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Email notifications will be sent according to these + // preferences to the email address of the user who owns the transfer config + // this run was derived from. + EmailPreferences email_preferences = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Represents a user facing message for a particular data transfer run. diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts index a5ba59b29ca..cdaa9b9acd8 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts @@ -1052,6 +1052,9 @@ export namespace google { /** CreateTransferConfigRequest versionInfo */ versionInfo?: (string|null); + + /** CreateTransferConfigRequest serviceAccountName */ + serviceAccountName?: (string|null); } /** Represents a CreateTransferConfigRequest. */ @@ -1075,6 +1078,9 @@ export namespace google { /** CreateTransferConfigRequest versionInfo. */ public versionInfo: string; + /** CreateTransferConfigRequest serviceAccountName. */ + public serviceAccountName: string; + /** * Creates a new CreateTransferConfigRequest instance using the specified properties. * @param [properties] Properties to set @@ -1160,6 +1166,9 @@ export namespace google { /** UpdateTransferConfigRequest versionInfo */ versionInfo?: (string|null); + + /** UpdateTransferConfigRequest serviceAccountName */ + serviceAccountName?: (string|null); } /** Represents an UpdateTransferConfigRequest. */ @@ -1183,6 +1192,9 @@ export namespace google { /** UpdateTransferConfigRequest versionInfo. */ public versionInfo: string; + /** UpdateTransferConfigRequest serviceAccountName. */ + public serviceAccountName: string; + /** * Creates a new UpdateTransferConfigRequest instance using the specified properties. * @param [properties] Properties to set @@ -2924,6 +2936,96 @@ export namespace google { CANCELLED = 6 } + /** Properties of an EmailPreferences. */ + interface IEmailPreferences { + + /** EmailPreferences enableFailureEmail */ + enableFailureEmail?: (boolean|null); + } + + /** Represents an EmailPreferences. */ + class EmailPreferences implements IEmailPreferences { + + /** + * Constructs a new EmailPreferences. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.datatransfer.v1.IEmailPreferences); + + /** EmailPreferences enableFailureEmail. */ + public enableFailureEmail: boolean; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @param [properties] Properties to set + * @returns EmailPreferences instance + */ + public static create(properties?: google.cloud.bigquery.datatransfer.v1.IEmailPreferences): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.datatransfer.v1.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @param message EmailPreferences message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.datatransfer.v1.IEmailPreferences, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Verifies an EmailPreferences message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmailPreferences + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.datatransfer.v1.EmailPreferences; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @param message EmailPreferences + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.datatransfer.v1.EmailPreferences, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmailPreferences to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ScheduleOptions. */ interface IScheduleOptions { @@ -3070,6 +3172,12 @@ export namespace google { /** TransferConfig datasetRegion */ datasetRegion?: (string|null); + + /** TransferConfig notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** TransferConfig emailPreferences */ + emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); } /** Represents a TransferConfig. */ @@ -3123,6 +3231,12 @@ export namespace google { /** TransferConfig datasetRegion. */ public datasetRegion: string; + /** TransferConfig notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** TransferConfig emailPreferences. */ + public emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + /** TransferConfig destination. */ public destination?: "destinationDatasetId"; @@ -3238,6 +3352,12 @@ export namespace google { /** TransferRun schedule */ schedule?: (string|null); + + /** TransferRun notificationPubsubTopic */ + notificationPubsubTopic?: (string|null); + + /** TransferRun emailPreferences */ + emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); } /** Represents a TransferRun. */ @@ -3288,6 +3408,12 @@ export namespace google { /** TransferRun schedule. */ public schedule: string; + /** TransferRun notificationPubsubTopic. */ + public notificationPubsubTopic: string; + + /** TransferRun emailPreferences. */ + public emailPreferences?: (google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null); + /** TransferRun destination. */ public destination?: "destinationDatasetId"; diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.js b/packages/google-cloud-bigquery-datatransfer/protos/protos.js index e128a434526..a9a85a23747 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.js +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.js @@ -2553,6 +2553,7 @@ * @property {google.cloud.bigquery.datatransfer.v1.ITransferConfig|null} [transferConfig] CreateTransferConfigRequest transferConfig * @property {string|null} [authorizationCode] CreateTransferConfigRequest authorizationCode * @property {string|null} [versionInfo] CreateTransferConfigRequest versionInfo + * @property {string|null} [serviceAccountName] CreateTransferConfigRequest serviceAccountName */ /** @@ -2602,6 +2603,14 @@ */ CreateTransferConfigRequest.prototype.versionInfo = ""; + /** + * CreateTransferConfigRequest serviceAccountName. + * @member {string} serviceAccountName + * @memberof google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest + * @instance + */ + CreateTransferConfigRequest.prototype.serviceAccountName = ""; + /** * Creates a new CreateTransferConfigRequest instance using the specified properties. * @function create @@ -2634,6 +2643,8 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.authorizationCode); if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.versionInfo); + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccountName); return writer; }; @@ -2680,6 +2691,9 @@ case 5: message.versionInfo = reader.string(); break; + case 6: + message.serviceAccountName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2729,6 +2743,9 @@ if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) if (!$util.isString(message.versionInfo)) return "versionInfo: string expected"; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + if (!$util.isString(message.serviceAccountName)) + return "serviceAccountName: string expected"; return null; }; @@ -2755,6 +2772,8 @@ message.authorizationCode = String(object.authorizationCode); if (object.versionInfo != null) message.versionInfo = String(object.versionInfo); + if (object.serviceAccountName != null) + message.serviceAccountName = String(object.serviceAccountName); return message; }; @@ -2776,6 +2795,7 @@ object.transferConfig = null; object.authorizationCode = ""; object.versionInfo = ""; + object.serviceAccountName = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -2785,6 +2805,8 @@ object.authorizationCode = message.authorizationCode; if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) object.versionInfo = message.versionInfo; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + object.serviceAccountName = message.serviceAccountName; return object; }; @@ -2812,6 +2834,7 @@ * @property {string|null} [authorizationCode] UpdateTransferConfigRequest authorizationCode * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTransferConfigRequest updateMask * @property {string|null} [versionInfo] UpdateTransferConfigRequest versionInfo + * @property {string|null} [serviceAccountName] UpdateTransferConfigRequest serviceAccountName */ /** @@ -2861,6 +2884,14 @@ */ UpdateTransferConfigRequest.prototype.versionInfo = ""; + /** + * UpdateTransferConfigRequest serviceAccountName. + * @member {string} serviceAccountName + * @memberof google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest + * @instance + */ + UpdateTransferConfigRequest.prototype.serviceAccountName = ""; + /** * Creates a new UpdateTransferConfigRequest instance using the specified properties. * @function create @@ -2893,6 +2924,8 @@ $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.versionInfo); + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serviceAccountName); return writer; }; @@ -2939,6 +2972,9 @@ case 5: message.versionInfo = reader.string(); break; + case 6: + message.serviceAccountName = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2990,6 +3026,9 @@ if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) if (!$util.isString(message.versionInfo)) return "versionInfo: string expected"; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + if (!$util.isString(message.serviceAccountName)) + return "serviceAccountName: string expected"; return null; }; @@ -3019,6 +3058,8 @@ } if (object.versionInfo != null) message.versionInfo = String(object.versionInfo); + if (object.serviceAccountName != null) + message.serviceAccountName = String(object.serviceAccountName); return message; }; @@ -3040,6 +3081,7 @@ object.authorizationCode = ""; object.updateMask = null; object.versionInfo = ""; + object.serviceAccountName = ""; } if (message.transferConfig != null && message.hasOwnProperty("transferConfig")) object.transferConfig = $root.google.cloud.bigquery.datatransfer.v1.TransferConfig.toObject(message.transferConfig, options); @@ -3049,6 +3091,8 @@ object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.versionInfo != null && message.hasOwnProperty("versionInfo")) object.versionInfo = message.versionInfo; + if (message.serviceAccountName != null && message.hasOwnProperty("serviceAccountName")) + object.serviceAccountName = message.serviceAccountName; return object; }; @@ -7003,6 +7047,193 @@ return values; })(); + v1.EmailPreferences = (function() { + + /** + * Properties of an EmailPreferences. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @interface IEmailPreferences + * @property {boolean|null} [enableFailureEmail] EmailPreferences enableFailureEmail + */ + + /** + * Constructs a new EmailPreferences. + * @memberof google.cloud.bigquery.datatransfer.v1 + * @classdesc Represents an EmailPreferences. + * @implements IEmailPreferences + * @constructor + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences=} [properties] Properties to set + */ + function EmailPreferences(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmailPreferences enableFailureEmail. + * @member {boolean} enableFailureEmail + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @instance + */ + EmailPreferences.prototype.enableFailureEmail = false; + + /** + * Creates a new EmailPreferences instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences=} [properties] Properties to set + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences instance + */ + EmailPreferences.create = function create(properties) { + return new EmailPreferences(properties); + }; + + /** + * Encodes the specified EmailPreferences message. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableFailureEmail); + return writer; + }; + + /** + * Encodes the specified EmailPreferences message, length delimited. Does not implicitly {@link google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.IEmailPreferences} message EmailPreferences message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmailPreferences.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.enableFailureEmail = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmailPreferences message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmailPreferences.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmailPreferences message. + * @function verify + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmailPreferences.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + if (typeof message.enableFailureEmail !== "boolean") + return "enableFailureEmail: boolean expected"; + return null; + }; + + /** + * Creates an EmailPreferences message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.datatransfer.v1.EmailPreferences} EmailPreferences + */ + EmailPreferences.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences) + return object; + var message = new $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences(); + if (object.enableFailureEmail != null) + message.enableFailureEmail = Boolean(object.enableFailureEmail); + return message; + }; + + /** + * Creates a plain object from an EmailPreferences message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @static + * @param {google.cloud.bigquery.datatransfer.v1.EmailPreferences} message EmailPreferences + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmailPreferences.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableFailureEmail = false; + if (message.enableFailureEmail != null && message.hasOwnProperty("enableFailureEmail")) + object.enableFailureEmail = message.enableFailureEmail; + return object; + }; + + /** + * Converts this EmailPreferences to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.datatransfer.v1.EmailPreferences + * @instance + * @returns {Object.} JSON object + */ + EmailPreferences.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EmailPreferences; + })(); + v1.ScheduleOptions = (function() { /** @@ -7265,6 +7496,8 @@ * @property {google.cloud.bigquery.datatransfer.v1.TransferState|null} [state] TransferConfig state * @property {number|Long|null} [userId] TransferConfig userId * @property {string|null} [datasetRegion] TransferConfig datasetRegion + * @property {string|null} [notificationPubsubTopic] TransferConfig notificationPubsubTopic + * @property {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null} [emailPreferences] TransferConfig emailPreferences */ /** @@ -7394,6 +7627,22 @@ */ TransferConfig.prototype.datasetRegion = ""; + /** + * TransferConfig notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.notificationPubsubTopic = ""; + + /** + * TransferConfig emailPreferences. + * @member {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1.TransferConfig + * @instance + */ + TransferConfig.prototype.emailPreferences = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -7458,6 +7707,10 @@ writer.uint32(/* id 13, wireType 0 =*/104).bool(message.disabled); if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.datasetRegion); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.notificationPubsubTopic); + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.encode(message.emailPreferences, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); if (message.scheduleOptions != null && message.hasOwnProperty("scheduleOptions")) $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.encode(message.scheduleOptions, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); return writer; @@ -7536,6 +7789,12 @@ case 14: message.datasetRegion = reader.string(); break; + case 15: + message.notificationPubsubTopic = reader.string(); + break; + case 18: + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -7633,6 +7892,14 @@ if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) if (!$util.isString(message.datasetRegion)) return "datasetRegion: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + error; + } return null; }; @@ -7719,6 +7986,13 @@ message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber(); if (object.datasetRegion != null) message.datasetRegion = String(object.datasetRegion); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferConfig.emailPreferences: object expected"); + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.fromObject(object.emailPreferences); + } return message; }; @@ -7752,6 +8026,8 @@ object.dataRefreshWindowDays = 0; object.disabled = false; object.datasetRegion = ""; + object.notificationPubsubTopic = ""; + object.emailPreferences = null; object.scheduleOptions = null; } if (message.name != null && message.hasOwnProperty("name")) @@ -7786,6 +8062,10 @@ object.disabled = message.disabled; if (message.datasetRegion != null && message.hasOwnProperty("datasetRegion")) object.datasetRegion = message.datasetRegion; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.toObject(message.emailPreferences, options); if (message.scheduleOptions != null && message.hasOwnProperty("scheduleOptions")) object.scheduleOptions = $root.google.cloud.bigquery.datatransfer.v1.ScheduleOptions.toObject(message.scheduleOptions, options); return object; @@ -7824,6 +8104,8 @@ * @property {google.cloud.bigquery.datatransfer.v1.TransferState|null} [state] TransferRun state * @property {number|Long|null} [userId] TransferRun userId * @property {string|null} [schedule] TransferRun schedule + * @property {string|null} [notificationPubsubTopic] TransferRun notificationPubsubTopic + * @property {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null} [emailPreferences] TransferRun emailPreferences */ /** @@ -7945,6 +8227,22 @@ */ TransferRun.prototype.schedule = ""; + /** + * TransferRun notificationPubsubTopic. + * @member {string} notificationPubsubTopic + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.notificationPubsubTopic = ""; + + /** + * TransferRun emailPreferences. + * @member {google.cloud.bigquery.datatransfer.v1.IEmailPreferences|null|undefined} emailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1.TransferRun + * @instance + */ + TransferRun.prototype.emailPreferences = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -8009,6 +8307,10 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.schedule); if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.notificationPubsubTopic); + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.encode(message.emailPreferences, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); return writer; }; @@ -8082,6 +8384,12 @@ case 12: message.schedule = reader.string(); break; + case 23: + message.notificationPubsubTopic = reader.string(); + break; + case 25: + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -8182,6 +8490,14 @@ if (message.schedule != null && message.hasOwnProperty("schedule")) if (!$util.isString(message.schedule)) return "schedule: string expected"; + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + if (!$util.isString(message.notificationPubsubTopic)) + return "notificationPubsubTopic: string expected"; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) { + var error = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.verify(message.emailPreferences); + if (error) + return "emailPreferences." + error; + } return null; }; @@ -8275,6 +8591,13 @@ message.userId = new $util.LongBits(object.userId.low >>> 0, object.userId.high >>> 0).toNumber(); if (object.schedule != null) message.schedule = String(object.schedule); + if (object.notificationPubsubTopic != null) + message.notificationPubsubTopic = String(object.notificationPubsubTopic); + if (object.emailPreferences != null) { + if (typeof object.emailPreferences !== "object") + throw TypeError(".google.cloud.bigquery.datatransfer.v1.TransferRun.emailPreferences: object expected"); + message.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.fromObject(object.emailPreferences); + } return message; }; @@ -8308,6 +8631,8 @@ object.userId = options.longs === String ? "0" : 0; object.schedule = ""; object.errorStatus = null; + object.notificationPubsubTopic = ""; + object.emailPreferences = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8341,6 +8666,10 @@ object.schedule = message.schedule; if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) object.errorStatus = $root.google.rpc.Status.toObject(message.errorStatus, options); + if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) + object.notificationPubsubTopic = message.notificationPubsubTopic; + if (message.emailPreferences != null && message.hasOwnProperty("emailPreferences")) + object.emailPreferences = $root.google.cloud.bigquery.datatransfer.v1.EmailPreferences.toObject(message.emailPreferences, options); return object; }; diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.json b/packages/google-cloud-bigquery-datatransfer/protos/protos.json index a7a57c42706..91d46783d50 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.json +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.json @@ -16,7 +16,9 @@ "java_outer_classname": "TransferProto", "java_package": "com.google.cloud.bigquery.datatransfer.v1", "php_namespace": "Google\\Cloud\\BigQuery\\DataTransfer\\V1", - "objc_class_prefix": "GCBDT" + "objc_class_prefix": "GCBDT", + "(google.api.resource_definition).type": "bigquerydatatransfer.google.com/Parent", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}" }, "nested": { "DataTransferService": { @@ -249,7 +251,7 @@ "DataSource": { "options": { "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/DataSource", - "(google.api.resource).pattern": "projects/{project}/dataSources/{data_source}" + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataSources/{data_source}" }, "fields": { "name": { @@ -372,7 +374,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/DataSource" } }, "pageToken": { @@ -408,7 +410,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/TransferConfig" } }, "transferConfig": { @@ -425,6 +427,10 @@ "versionInfo": { "type": "string", "id": 5 + }, + "serviceAccountName": { + "type": "string", + "id": 6 } } }, @@ -451,6 +457,10 @@ "versionInfo": { "type": "string", "id": 5 + }, + "serviceAccountName": { + "type": "string", + "id": 6 } } }, @@ -485,7 +495,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferRun" + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" } } } @@ -497,7 +507,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferRun" + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" } } } @@ -509,7 +519,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/TransferConfig" } }, "dataSourceIds": { @@ -553,7 +563,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferConfig" + "(google.api.resource_reference).child_type": "bigquerydatatransfer.googleapis.com/Run" } }, "states": { @@ -609,7 +619,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/TransferRun" + "(google.api.resource_reference).type": "bigquerydatatransfer.googleapis.com/Run" } }, "pageToken": { @@ -771,6 +781,14 @@ "CANCELLED": 6 } }, + "EmailPreferences": { + "fields": { + "enableFailureEmail": { + "type": "bool", + "id": 1 + } + } + }, "ScheduleOptions": { "fields": { "disableAutoScheduling": { @@ -790,7 +808,7 @@ "TransferConfig": { "options": { "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/TransferConfig", - "(google.api.resource).pattern": "projects/{project}/transferConfigs/{transfer_config}" + "(google.api.resource).pattern": "projects/{project}/locations/{location}/transferConfigs/{transfer_config}" }, "oneofs": { "destination": { @@ -867,12 +885,20 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 15 + }, + "emailPreferences": { + "type": "EmailPreferences", + "id": 18 } } }, "TransferRun": { "options": { - "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/TransferRun", + "(google.api.resource).type": "bigquerydatatransfer.googleapis.com/Run", "(google.api.resource).pattern": "projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}" }, "oneofs": { @@ -955,6 +981,20 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "notificationPubsubTopic": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "emailPreferences": { + "type": "EmailPreferences", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js index 2710abed85c..7f29425b7f0 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.js @@ -288,7 +288,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/dataSources/{data_source_id}` + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -344,7 +345,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The BigQuery project id for which data sources should be returned. - * Must be in the form: `projects/{project_id}` + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -457,7 +459,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The BigQuery project id for which data sources should be returned. - * Must be in the form: `projects/{project_id}` + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -503,9 +506,9 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The BigQuery project id where the transfer configuration should be created. - * Must be in the format projects/{project_id}/locations/{location_id} - * If specified location and location of the destination bigquery dataset - * do not match - the request will fail. + * Must be in the format projects/{project_id}/locations/{location_id} or + * projects/{project_id}. If specified location and location of the + * destination bigquery dataset do not match - the request will fail. * @param {Object} request.transferConfig * Required. Data transfer configuration to create. * @@ -534,6 +537,11 @@ class DataTransferServiceClient { * must use the "none+gsession" response type. which be return a * version_info back in the authorization response which be be put in a JWT * claim in the token request. + * @param {string} [request.serviceAccountName] + * Optional service account name. If this field is set, transfer config will + * be created with this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -624,6 +632,12 @@ class DataTransferServiceClient { * must use the "none+gsession" response type. which be return a * version_info back in the authorization response which be be put in a JWT * claim in the token request. + * @param {string} [request.serviceAccountName] + * Optional service account name. If this field is set and + * "service_account_name" is set in update_mask, transfer config will be + * updated to use this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -684,7 +698,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}` + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -731,7 +746,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}` + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -786,7 +802,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The BigQuery project id for which data sources - * should be returned: `projects/{project_id}`. + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` * @param {string[]} [request.dataSourceIds] * When specified, only configurations of requested data sources are returned. * @param {number} [request.pageSize] @@ -901,7 +918,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. The BigQuery project id for which data sources - * should be returned: `projects/{project_id}`. + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` * @param {string[]} [request.dataSourceIds] * When specified, only configurations of requested data sources are returned. * @param {number} [request.pageSize] @@ -953,7 +971,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. Transfer configuration name in the form: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * @param {Object} request.startTime * Required. Start time of the range of transfer runs. For example, * `"2017-05-25T00:00:00+00:00"`. @@ -1025,7 +1044,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -1080,7 +1100,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -1128,7 +1149,8 @@ class DataTransferServiceClient { * @param {string} request.parent * Required. Name of transfer configuration for which transfer runs should be retrieved. * Format of transfer configuration resource name is: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * @param {number[]} [request.states] * When specified, only transfer runs with requested states are returned. * @@ -1250,7 +1272,8 @@ class DataTransferServiceClient { * @param {string} request.parent * Required. Name of transfer configuration for which transfer runs should be retrieved. * Format of transfer configuration resource name is: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * @param {number[]} [request.states] * When specified, only transfer runs with requested states are returned. * @@ -1304,7 +1327,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. Transfer run name in the form: - * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -1422,7 +1446,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.parent * Required. Transfer run name in the form: - * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * @param {number} [request.pageSize] * The maximum number of resources contained in the underlying API * response. If page streaming is performed per-resource, this @@ -1478,7 +1503,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} request.name * Required. The data source in the form: - * `projects/{project_id}/dataSources/{data_source_id}` + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. @@ -1536,7 +1562,8 @@ class DataTransferServiceClient { * The request object that will be sent. * @param {string} [request.parent] * Transfer configuration name in the form: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * @param {Object} [request.requestedTimeRange] * Time range for the transfer runs that should be started. * diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_datatransfer.js b/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_datatransfer.js index 005110de99f..19c82b8d940 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_datatransfer.js +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_datatransfer.js @@ -283,7 +283,8 @@ const DataSource = { * * @property {string} name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/dataSources/{data_source_id}` + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}` * * @typedef GetDataSourceRequest * @memberof google.cloud.bigquery.datatransfer.v1 @@ -298,7 +299,8 @@ const GetDataSourceRequest = { * * @property {string} parent * Required. The BigQuery project id for which data sources should be returned. - * Must be in the form: `projects/{project_id}` + * Must be in the form: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id} * * @property {string} pageToken * Pagination token, which can be used to request a specific page @@ -350,9 +352,9 @@ const ListDataSourcesResponse = { * * @property {string} parent * Required. The BigQuery project id where the transfer configuration should be created. - * Must be in the format projects/{project_id}/locations/{location_id} - * If specified location and location of the destination bigquery dataset - * do not match - the request will fail. + * Must be in the format projects/{project_id}/locations/{location_id} or + * projects/{project_id}. If specified location and location of the + * destination bigquery dataset do not match - the request will fail. * * @property {Object} transferConfig * Required. Data transfer configuration to create. @@ -385,6 +387,12 @@ const ListDataSourcesResponse = { * version_info back in the authorization response which be be put in a JWT * claim in the token request. * + * @property {string} serviceAccountName + * Optional service account name. If this field is set, transfer config will + * be created with this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + * * @typedef CreateTransferConfigRequest * @memberof google.cloud.bigquery.datatransfer.v1 * @see [google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/bigquery/datatransfer/v1/datatransfer.proto} @@ -433,6 +441,13 @@ const CreateTransferConfigRequest = { * version_info back in the authorization response which be be put in a JWT * claim in the token request. * + * @property {string} serviceAccountName + * Optional service account name. If this field is set and + * "service_account_name" is set in update_mask, transfer config will be + * updated to use this service account credentials. It requires that + * requesting user calling this API has permissions to act as this service + * account. + * * @typedef UpdateTransferConfigRequest * @memberof google.cloud.bigquery.datatransfer.v1 * @see [google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/bigquery/datatransfer/v1/datatransfer.proto} @@ -446,7 +461,8 @@ const UpdateTransferConfigRequest = { * * @property {string} name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}` + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` * * @typedef GetTransferConfigRequest * @memberof google.cloud.bigquery.datatransfer.v1 @@ -462,7 +478,8 @@ const GetTransferConfigRequest = { * * @property {string} name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}` + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}` * * @typedef DeleteTransferConfigRequest * @memberof google.cloud.bigquery.datatransfer.v1 @@ -477,7 +494,8 @@ const DeleteTransferConfigRequest = { * * @property {string} name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * * @typedef GetTransferRunRequest * @memberof google.cloud.bigquery.datatransfer.v1 @@ -492,7 +510,8 @@ const GetTransferRunRequest = { * * @property {string} name * Required. The field will contain name of the resource requested, for example: - * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * * @typedef DeleteTransferRunRequest * @memberof google.cloud.bigquery.datatransfer.v1 @@ -507,7 +526,8 @@ const DeleteTransferRunRequest = { * * @property {string} parent * Required. The BigQuery project id for which data sources - * should be returned: `projects/{project_id}`. + * should be returned: `projects/{project_id}` or + * `projects/{project_id}/locations/{location_id}` * * @property {string[]} dataSourceIds * When specified, only configurations of requested data sources are returned. @@ -560,7 +580,8 @@ const ListTransferConfigsResponse = { * @property {string} parent * Required. Name of transfer configuration for which transfer runs should be retrieved. * Format of transfer configuration resource name is: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * * @property {number[]} states * When specified, only transfer runs with requested states are returned. @@ -636,7 +657,8 @@ const ListTransferRunsResponse = { * * @property {string} parent * Required. Transfer run name in the form: - * `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + * `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}` * * @property {string} pageToken * Pagination token, which can be used to request a specific page @@ -694,7 +716,8 @@ const ListTransferLogsResponse = { * * @property {string} name * Required. The data source in the form: - * `projects/{project_id}/dataSources/{data_source_id}` + * `projects/{project_id}/dataSources/{data_source_id}` or + * `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`. * * @typedef CheckValidCredsRequest * @memberof google.cloud.bigquery.datatransfer.v1 @@ -723,7 +746,8 @@ const CheckValidCredsResponse = { * * @property {string} parent * Required. Transfer configuration name in the form: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * * @property {Object} startTime * Required. Start time of the range of transfer runs. For example, @@ -766,7 +790,8 @@ const ScheduleTransferRunsResponse = { * * @property {string} parent * Transfer configuration name in the form: - * `projects/{project_id}/transferConfigs/{config_id}`. + * `projects/{project_id}/transferConfigs/{config_id}` or + * `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`. * * @property {Object} requestedTimeRange * Time range for the transfer runs that should be started. diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_transfer.js b/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_transfer.js index e684dbded80..0fd20e7129c 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_transfer.js +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/doc/google/cloud/bigquery/datatransfer/v1/doc_transfer.js @@ -15,6 +15,21 @@ // Note: this file is purely for documentation. Any contents are not expected // to be loaded as the JS file. +/** + * Represents preferences for sending email notifications for transfer run + * events. + * + * @property {boolean} enableFailureEmail + * If true, email notifications will be sent on transfer run failures. + * + * @typedef EmailPreferences + * @memberof google.cloud.bigquery.datatransfer.v1 + * @see [google.cloud.bigquery.datatransfer.v1.EmailPreferences definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/bigquery/datatransfer/v1/transfer.proto} + */ +const EmailPreferences = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Options customizing the data transfer schedule. * @@ -132,6 +147,16 @@ const ScheduleOptions = { * @property {string} datasetRegion * Output only. Region in which BigQuery dataset is located. * + * @property {string} notificationPubsubTopic + * Pub/Sub topic where notifications will be sent after transfer runs + * associated with this transfer config finish. + * + * @property {Object} emailPreferences + * Email notifications will be sent according to these preferences + * to the email address of the user who owns this transfer config. + * + * This object should have the same structure as [EmailPreferences]{@link google.cloud.bigquery.datatransfer.v1.EmailPreferences} + * * @typedef TransferConfig * @memberof google.cloud.bigquery.datatransfer.v1 * @see [google.cloud.bigquery.datatransfer.v1.TransferConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/bigquery/datatransfer/v1/transfer.proto} @@ -208,6 +233,17 @@ const TransferConfig = { * NOTE: the system might choose to delay the schedule depending on the * current load, so `schedule_time` doesn't always match this. * + * @property {string} notificationPubsubTopic + * Output only. Pub/Sub topic where a notification will be sent after this + * transfer run finishes + * + * @property {Object} emailPreferences + * Output only. Email notifications will be sent according to these + * preferences to the email address of the user who owns the transfer config + * this run was derived from. + * + * This object should have the same structure as [EmailPreferences]{@link google.cloud.bigquery.datatransfer.v1.EmailPreferences} + * * @typedef TransferRun * @memberof google.cloud.bigquery.datatransfer.v1 * @see [google.cloud.bigquery.datatransfer.v1.TransferRun definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/bigquery/datatransfer/v1/transfer.proto} diff --git a/packages/google-cloud-bigquery-datatransfer/synth.metadata b/packages/google-cloud-bigquery-datatransfer/synth.metadata index ebb40b47eae..487603cfd52 100644 --- a/packages/google-cloud-bigquery-datatransfer/synth.metadata +++ b/packages/google-cloud-bigquery-datatransfer/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-19T12:10:41.489808Z", + "updateTime": "2019-12-07T12:11:07.930914Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", - "internalRef": "281088257" + "sha": "a4adac3a12aca6e3a792c9c35ee850435fe7cf7e", + "internalRef": "284277770" } }, { diff --git a/packages/google-cloud-bigquery-datatransfer/test/gapic-v1.js b/packages/google-cloud-bigquery-datatransfer/test/gapic-v1.js index 346ae76b899..60344fc6ac6 100644 --- a/packages/google-cloud-bigquery-datatransfer/test/gapic-v1.js +++ b/packages/google-cloud-bigquery-datatransfer/test/gapic-v1.js @@ -243,6 +243,7 @@ describe('DataTransferServiceClient', () => { const disabled = true; const userId = 147132913; const datasetRegion = 'datasetRegion959248539'; + const notificationPubsubTopic = 'notificationPubsubTopic1794281191'; const expectedResponse = { name: name, destinationDatasetId: destinationDatasetId, @@ -253,6 +254,7 @@ describe('DataTransferServiceClient', () => { disabled: disabled, userId: userId, datasetRegion: datasetRegion, + notificationPubsubTopic: notificationPubsubTopic, }; // Mock Grpc layer @@ -327,6 +329,7 @@ describe('DataTransferServiceClient', () => { const disabled = true; const userId = 147132913; const datasetRegion = 'datasetRegion959248539'; + const notificationPubsubTopic = 'notificationPubsubTopic1794281191'; const expectedResponse = { name: name, destinationDatasetId: destinationDatasetId, @@ -337,6 +340,7 @@ describe('DataTransferServiceClient', () => { disabled: disabled, userId: userId, datasetRegion: datasetRegion, + notificationPubsubTopic: notificationPubsubTopic, }; // Mock Grpc layer @@ -473,6 +477,7 @@ describe('DataTransferServiceClient', () => { const disabled = true; const userId = 147132913; const datasetRegion = 'datasetRegion959248539'; + const notificationPubsubTopic = 'notificationPubsubTopic1794281191'; const expectedResponse = { name: name2, destinationDatasetId: destinationDatasetId, @@ -483,6 +488,7 @@ describe('DataTransferServiceClient', () => { disabled: disabled, userId: userId, datasetRegion: datasetRegion, + notificationPubsubTopic: notificationPubsubTopic, }; // Mock Grpc layer @@ -702,12 +708,14 @@ describe('DataTransferServiceClient', () => { const dataSourceId = 'dataSourceId-1015796374'; const userId = 147132913; const schedule = 'schedule-697920873'; + const notificationPubsubTopic = 'notificationPubsubTopic1794281191'; const expectedResponse = { name: name2, destinationDatasetId: destinationDatasetId, dataSourceId: dataSourceId, userId: userId, schedule: schedule, + notificationPubsubTopic: notificationPubsubTopic, }; // Mock Grpc layer