Skip to content

Commit

Permalink
fix: change resource type TransferRun to Run to be consistent with ga…
Browse files Browse the repository at this point in the history
…pic configs
  • Loading branch information
yoshi-automation authored and bcoe committed Dec 9, 2019
1 parent 71a36e2 commit f253bf0
Show file tree
Hide file tree
Showing 10 changed files with 719 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) = {
Expand All @@ -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"
}
];

Expand Down Expand Up @@ -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"
}
];

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) = {
Expand All @@ -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) = {
Expand All @@ -572,35 +590,38 @@ 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"
}
];
}

// 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"
}
];
}

// 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"
}
];

Expand Down Expand Up @@ -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"
}
];

Expand Down Expand Up @@ -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"
}
];

Expand Down Expand Up @@ -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) = {
Expand All @@ -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) = {
Expand Down Expand Up @@ -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"
}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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}"
};

Expand Down Expand Up @@ -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.
Expand Down
Loading

0 comments on commit f253bf0

Please sign in to comment.