Skip to content

Commit

Permalink
fix: update to the latest version of the service (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and sofisl committed Oct 13, 2022
1 parent a0725fe commit 1a6672c
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 452 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
// up the frontend.
service DataTransferService {
option (google.api.default_host) = "bigquerydatatransfer.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";

// Retrieves a supported data source and returns its settings,
// which can be used for UI rendering.
Expand Down Expand Up @@ -206,29 +207,6 @@ service DataTransferService {
}
};
}

// Enables data transfer service for a given project. This
// method requires the additional scope of
// 'https://www.googleapis.com/auth/cloudplatformprojects'
// to manage the cloud project permissions.
rpc EnableDataTransferService(EnableDataTransferServiceRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*}:enableDataTransferService"
body: "*"
};
}

// Returns true if data transfer is enabled for a project.
rpc IsDataTransferServiceEnabled(IsDataTransferServiceEnabledRequest) returns (IsDataTransferServiceEnabledResponse) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*}:isDataTransferServiceEnabled"
body: "*"
additional_bindings {
post: "/v1/{name=projects/*}:isEnabled"
body: "*"
}
};
}
}

// Represents a data source parameter with validation rules, so that
Expand Down Expand Up @@ -308,6 +286,10 @@ message DataSourceParameter {

// Deprecated. This field has no effect.
bool recurse = 15;

// If true, it should not be used in new transfers, and it should not be
// visible to users.
bool deprecated = 20;
}

// Represents data source metadata. Metadata is sufficient to
Expand Down Expand Up @@ -410,12 +392,6 @@ message DataSource {

// The minimum interval for scheduler to schedule runs.
google.protobuf.Duration minimum_schedule_interval = 18;

// Partner's legal name of this data source
string partner_legal_name = 22;

// Redirect URL to complete transfer config setup for 3rd party data sources.
string redirect_url = 23;
}

// A request to get data source info.
Expand Down Expand Up @@ -698,9 +674,6 @@ message ScheduleTransferRunsRequest {
// `projects/{project_id}/transferConfigs/{config_id}`.
string parent = 1;

// User labels to add to the scheduled runs.
map<string, string> labels = 6;

// Start time of the range of transfer runs. For example,
// `"2017-05-25T00:00:00+00:00"`.
google.protobuf.Timestamp start_time = 2;
Expand Down Expand Up @@ -738,9 +711,6 @@ message StartManualTransferRunsRequest {
// `projects/{project_id}/transferConfigs/{config_id}`.
string parent = 1;

// User labels to add to the backfilled runs.
map<string, string> labels = 2;

// The requested time specification - this can be a time range or a specific
// run_time.
oneof time {
Expand All @@ -758,28 +728,3 @@ message StartManualTransferRunsResponse {
// The transfer runs that were created.
repeated TransferRun runs = 1;
}

// A request to enable data transfer service for a project.
message EnableDataTransferServiceRequest {
// The name of the project resource in the form:
// `projects/{project_id}`
string name = 1;
}

// A request to determine whether data transfer is enabled for the project.
message IsDataTransferServiceEnabledRequest {
// The name of the project resource in the form:
// `projects/{project_id}`
string name = 1;
}

// A response to indicate whether data transfer service is enabled
// for the project.
message IsDataTransferServiceEnabledResponse {
// Indicates whether the data transfer service is enabled for the project.
bool enabled = 1;

// A string that contains additional information about why the service is
// deemed not enabled. This is only available when `enable` is false.
string reason = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,6 @@ message TransferConfig {

// Output only. Region in which BigQuery dataset is located.
string dataset_region = 14;

// A unique identifier used for identifying a transfer setup stored on
// external partner side. The token is opaque to DTS and can only be
// interpreted by partner. Partner data source should create a mapping between
// the config id and the token to validate that a transfer config/run is
// legitimate.
string partner_token = 22;

// Transfer settings managed by partner data sources. It is stored as
// key-value pairs and used for DTS UI display purpose only. Two reasons we
// don't want to store them together with 'params' are:
// - The connection info is provided by partner and not editable in DTS UI
// which is different from the immutable parameter. It will be confusing to
// add another boolean to DataSourceParameter to differentiate them.
// - The connection info can be any arbitrary key-value pairs. Adding them to
// params fields requires partner to provide definition for them in data
// source definition. It will be friendlier to avoid that for partners.
google.protobuf.Struct partner_connection_info = 23;
}

// Represents a data transfer run.
Expand All @@ -188,14 +170,11 @@ message TransferRun {
// The name is ignored when creating a transfer run.
string name = 1;

// User labels.
map<string, string> labels = 22;

// Minimum time after which a transfer run can be started.
google.protobuf.Timestamp schedule_time = 3;

// For batch transfer runs, specifies the date and time that
// data should be ingested.
// For batch transfer runs, specifies the date and time of the data should be
// ingested.
google.protobuf.Timestamp run_time = 10;

// Status of the transfer run.
Expand Down Expand Up @@ -233,14 +212,6 @@ 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;

// Output only. This is the same token initialized from TransferConfig.
// Partner token is a unique identifier used for identifying a transfer setup
// stored on external partner side. The token is opaque to DTS and can only be
// interpreted by partner. Partner data source should create a mapping between
// the config id and the token to validate that a transfer config/run is
// legitimate.
string partner_token = 28;
}

// Represents a user facing message for a particular data transfer run.
Expand All @@ -258,9 +229,6 @@ message TransferMessage {

// Error message.
ERROR = 3;

// Debug message.
DEBUG = 4;
}

// Time when message was logged.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('DataTransferServiceSmokeTest', () => {
});

// Iterate over all elements.
const formattedParent = client.projectPath(projectId);
const formattedParent = client.locationPath(projectId, 'us-central1');

client
.listDataSources({parent: formattedParent})
Expand All @@ -50,7 +50,7 @@ describe('DataTransferServiceSmokeTest', () => {
});

// Or obtain the paged response.
const formattedParent = client.projectPath(projectId);
const formattedParent = client.locationPath(projectId, 'us-central1');

const options = {autoPaginate: false};
const callback = responses => {
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('DataTransferServiceSmokeTest', () => {
// optional auth parameters.
});

const formattedParent = client.projectPath(projectId);
const formattedParent = client.locationPath(projectId, 'us-central1');
client
.listDataSourcesStream({parent: formattedParent})
.on('data', element => {
Expand Down
Loading

0 comments on commit 1a6672c

Please sign in to comment.