Skip to content
Permalink
Browse files
feat: re-implement resource name helper classes (#59)
* [CHANGE ME] Re-generated  to pick up changes in the API or client library generator.

* remove ParentName, ParentNames and UntypedParentName

* blank line at eof

* blank line at eof

* fix missing diff

* regenerate

Co-authored-by: Yoshi Automation Bot <yoshi-automation@google.com>
  • Loading branch information
stephaniewang526 and yoshi-automation committed Mar 5, 2020
1 parent 7328d35 commit d1cc550975d3bcef558e559f3cb0cbffa6d883c2
Showing with 1,388 additions and 474 deletions.
  1. +11 −0 google-cloud-bigquerydatatransfer/clirr-ignored-differences.xml
  2. +186 −101 ...tatransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClient.java
  3. +13 −13 ...transfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceSettings.java
  4. +1 −1 ...ud-bigquerydatatransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/package-info.java
  5. +5 −5 ...ransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/stub/DataTransferServiceStub.java
  6. +33 −33 ...src/main/java/com/google/cloud/bigquery/datatransfer/v1/stub/DataTransferServiceStubSettings.java
  7. +40 −40 ...fer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/stub/GrpcDataTransferServiceStub.java
  8. +98 −80 ...ansfer/src/test/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClientTest.java
  9. +1 −1 ...ransfer/src/test/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceSmokeTest.java
  10. +21 −4 proto-google-cloud-bigquerydatatransfer-v1/clirr-ignored-differences.xml
  11. +292 −1 ...gquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataSourceName.java
  12. +1 −1 ...tatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/LocationDataSourceName.java
  13. +3 −7 ...bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/LocationName.java
  14. +1 −1 ...querydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/LocationRunName.java
  15. +1 −1 ...ansfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/LocationTransferConfigName.java
  16. +0 −25 ...d-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/ParentName.java
  17. +0 −38 ...-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/ParentNames.java
  18. +1 −1 ...atatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/ProjectDataSourceName.java
  19. +3 −7 ...-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/ProjectName.java
  20. +1 −1 ...gquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/ProjectRunName.java
  21. +1 −1 ...ransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/ProjectTransferConfigName.java
  22. +358 −1 ...loud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/RunName.java
  23. +299 −1 ...rydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/TransferConfigName.java
  24. +0 −106 ...erydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/UntypedParentName.java
  25. +18 −4 synth.metadata
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<!--TODO: To be removed-->
<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClient</className>
<method>* *(com.google.cloud.bigquery.datatransfer.v1.ParentName*)</method>
<to>* *(com.google.cloud.bigquery.datatransfer.v1.ProjectName*)</to>
</difference>
</differences>

Large diffs are not rendered by default.

@@ -119,6 +119,12 @@ public UnaryCallSettings<GetTransferConfigRequest, TransferConfig> getTransferCo
return ((DataTransferServiceStubSettings) getStubSettings()).scheduleTransferRunsSettings();
}

/** Returns the object with the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return ((DataTransferServiceStubSettings) getStubSettings()).startManualTransferRunsSettings();
}

/** Returns the object with the settings used for calls to getTransferRun. */
public UnaryCallSettings<GetTransferRunRequest, TransferRun> getTransferRunSettings() {
return ((DataTransferServiceStubSettings) getStubSettings()).getTransferRunSettings();
@@ -149,12 +155,6 @@ public UnaryCallSettings<DeleteTransferRunRequest, Empty> deleteTransferRunSetti
return ((DataTransferServiceStubSettings) getStubSettings()).checkValidCredsSettings();
}

/** Returns the object with the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return ((DataTransferServiceStubSettings) getStubSettings()).startManualTransferRunsSettings();
}

public static final DataTransferServiceSettings create(DataTransferServiceStubSettings stub)
throws IOException {
return new DataTransferServiceSettings.Builder(stub.toBuilder()).build();
@@ -303,6 +303,13 @@ public UnaryCallSettings.Builder<GetDataSourceRequest, DataSource> getDataSource
return getStubSettingsBuilder().scheduleTransferRunsSettings();
}

/** Returns the builder for the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings.Builder<
StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return getStubSettingsBuilder().startManualTransferRunsSettings();
}

/** Returns the builder for the settings used for calls to getTransferRun. */
public UnaryCallSettings.Builder<GetTransferRunRequest, TransferRun> getTransferRunSettings() {
return getStubSettingsBuilder().getTransferRunSettings();
@@ -333,13 +340,6 @@ public UnaryCallSettings.Builder<DeleteTransferRunRequest, Empty> deleteTransfer
return getStubSettingsBuilder().checkValidCredsSettings();
}

/** Returns the builder for the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings.Builder<
StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return getStubSettingsBuilder().startManualTransferRunsSettings();
}

@Override
public DataTransferServiceSettings build() throws IOException {
return new DataTransferServiceSettings(this);
@@ -30,7 +30,7 @@
* <pre>
* <code>
* try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
* DataSourceName name = ProjectDataSourceName.of("[PROJECT]", "[DATA_SOURCE]");
* DataSourceName name = DataSourceName.ofProjectDataSourceName("[PROJECT]", "[DATA_SOURCE]");
* DataSource response = dataTransferServiceClient.getDataSource(name);
* }
* </code>
@@ -104,6 +104,11 @@ public UnaryCallable<GetTransferConfigRequest, TransferConfig> getTransferConfig
throw new UnsupportedOperationException("Not implemented: scheduleTransferRunsCallable()");
}

public UnaryCallable<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsCallable() {
throw new UnsupportedOperationException("Not implemented: startManualTransferRunsCallable()");
}

public UnaryCallable<GetTransferRunRequest, TransferRun> getTransferRunCallable() {
throw new UnsupportedOperationException("Not implemented: getTransferRunCallable()");
}
@@ -136,11 +141,6 @@ public UnaryCallable<CheckValidCredsRequest, CheckValidCredsResponse> checkValid
throw new UnsupportedOperationException("Not implemented: checkValidCredsCallable()");
}

public UnaryCallable<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsCallable() {
throw new UnsupportedOperationException("Not implemented: startManualTransferRunsCallable()");
}

@Override
public abstract void close();
}
@@ -132,6 +132,8 @@ public class DataTransferServiceStubSettings extends StubSettings<DataTransferSe
listTransferConfigsSettings;
private final UnaryCallSettings<ScheduleTransferRunsRequest, ScheduleTransferRunsResponse>
scheduleTransferRunsSettings;
private final UnaryCallSettings<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings;
private final UnaryCallSettings<GetTransferRunRequest, TransferRun> getTransferRunSettings;
private final UnaryCallSettings<DeleteTransferRunRequest, Empty> deleteTransferRunSettings;
private final PagedCallSettings<
@@ -142,8 +144,6 @@ public class DataTransferServiceStubSettings extends StubSettings<DataTransferSe
listTransferLogsSettings;
private final UnaryCallSettings<CheckValidCredsRequest, CheckValidCredsResponse>
checkValidCredsSettings;
private final UnaryCallSettings<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings;

/** Returns the object with the settings used for calls to getDataSource. */
public UnaryCallSettings<GetDataSourceRequest, DataSource> getDataSourceSettings() {
@@ -192,6 +192,12 @@ public UnaryCallSettings<GetTransferConfigRequest, TransferConfig> getTransferCo
return scheduleTransferRunsSettings;
}

/** Returns the object with the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return startManualTransferRunsSettings;
}

/** Returns the object with the settings used for calls to getTransferRun. */
public UnaryCallSettings<GetTransferRunRequest, TransferRun> getTransferRunSettings() {
return getTransferRunSettings;
@@ -222,12 +228,6 @@ public UnaryCallSettings<DeleteTransferRunRequest, Empty> deleteTransferRunSetti
return checkValidCredsSettings;
}

/** Returns the object with the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings<StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return startManualTransferRunsSettings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public DataTransferServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
@@ -305,12 +305,12 @@ protected DataTransferServiceStubSettings(Builder settingsBuilder) throws IOExce
getTransferConfigSettings = settingsBuilder.getTransferConfigSettings().build();
listTransferConfigsSettings = settingsBuilder.listTransferConfigsSettings().build();
scheduleTransferRunsSettings = settingsBuilder.scheduleTransferRunsSettings().build();
startManualTransferRunsSettings = settingsBuilder.startManualTransferRunsSettings().build();
getTransferRunSettings = settingsBuilder.getTransferRunSettings().build();
deleteTransferRunSettings = settingsBuilder.deleteTransferRunSettings().build();
listTransferRunsSettings = settingsBuilder.listTransferRunsSettings().build();
listTransferLogsSettings = settingsBuilder.listTransferLogsSettings().build();
checkValidCredsSettings = settingsBuilder.checkValidCredsSettings().build();
startManualTransferRunsSettings = settingsBuilder.startManualTransferRunsSettings().build();
}

private static final PagedListDescriptor<
@@ -573,6 +573,9 @@ public ApiFuture<ListTransferLogsPagedResponse> getFuturePagedResponse(
private final UnaryCallSettings.Builder<
ScheduleTransferRunsRequest, ScheduleTransferRunsResponse>
scheduleTransferRunsSettings;
private final UnaryCallSettings.Builder<
StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings;
private final UnaryCallSettings.Builder<GetTransferRunRequest, TransferRun>
getTransferRunSettings;
private final UnaryCallSettings.Builder<DeleteTransferRunRequest, Empty>
@@ -585,9 +588,6 @@ public ApiFuture<ListTransferLogsPagedResponse> getFuturePagedResponse(
listTransferLogsSettings;
private final UnaryCallSettings.Builder<CheckValidCredsRequest, CheckValidCredsResponse>
checkValidCredsSettings;
private final UnaryCallSettings.Builder<
StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings;

private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
RETRYABLE_CODE_DEFINITIONS;
@@ -647,6 +647,8 @@ protected Builder(ClientContext clientContext) {

scheduleTransferRunsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

startManualTransferRunsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

getTransferRunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

deleteTransferRunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -657,8 +659,6 @@ protected Builder(ClientContext clientContext) {

checkValidCredsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

startManualTransferRunsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
getDataSourceSettings,
@@ -669,12 +669,12 @@ protected Builder(ClientContext clientContext) {
getTransferConfigSettings,
listTransferConfigsSettings,
scheduleTransferRunsSettings,
startManualTransferRunsSettings,
getTransferRunSettings,
deleteTransferRunSettings,
listTransferRunsSettings,
listTransferLogsSettings,
checkValidCredsSettings,
startManualTransferRunsSettings);
checkValidCredsSettings);

initDefaults(this);
}
@@ -712,7 +712,7 @@ private static Builder initDefaults(Builder builder) {

builder
.deleteTransferConfigSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

builder
@@ -730,14 +730,19 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

builder
.startManualTransferRunsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

builder
.getTransferRunSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

builder
.deleteTransferRunSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

builder
@@ -752,11 +757,6 @@ private static Builder initDefaults(Builder builder) {

builder
.checkValidCredsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

builder
.startManualTransferRunsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));

@@ -774,12 +774,12 @@ protected Builder(DataTransferServiceStubSettings settings) {
getTransferConfigSettings = settings.getTransferConfigSettings.toBuilder();
listTransferConfigsSettings = settings.listTransferConfigsSettings.toBuilder();
scheduleTransferRunsSettings = settings.scheduleTransferRunsSettings.toBuilder();
startManualTransferRunsSettings = settings.startManualTransferRunsSettings.toBuilder();
getTransferRunSettings = settings.getTransferRunSettings.toBuilder();
deleteTransferRunSettings = settings.deleteTransferRunSettings.toBuilder();
listTransferRunsSettings = settings.listTransferRunsSettings.toBuilder();
listTransferLogsSettings = settings.listTransferLogsSettings.toBuilder();
checkValidCredsSettings = settings.checkValidCredsSettings.toBuilder();
startManualTransferRunsSettings = settings.startManualTransferRunsSettings.toBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
@@ -791,12 +791,12 @@ protected Builder(DataTransferServiceStubSettings settings) {
getTransferConfigSettings,
listTransferConfigsSettings,
scheduleTransferRunsSettings,
startManualTransferRunsSettings,
getTransferRunSettings,
deleteTransferRunSettings,
listTransferRunsSettings,
listTransferLogsSettings,
checkValidCredsSettings,
startManualTransferRunsSettings);
checkValidCredsSettings);
}

// NEXT_MAJOR_VER: remove 'throws Exception'
@@ -866,6 +866,13 @@ public UnaryCallSettings.Builder<GetDataSourceRequest, DataSource> getDataSource
return scheduleTransferRunsSettings;
}

/** Returns the builder for the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings.Builder<
StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return startManualTransferRunsSettings;
}

/** Returns the builder for the settings used for calls to getTransferRun. */
public UnaryCallSettings.Builder<GetTransferRunRequest, TransferRun> getTransferRunSettings() {
return getTransferRunSettings;
@@ -896,13 +903,6 @@ public UnaryCallSettings.Builder<DeleteTransferRunRequest, Empty> deleteTransfer
return checkValidCredsSettings;
}

/** Returns the builder for the settings used for calls to startManualTransferRuns. */
public UnaryCallSettings.Builder<
StartManualTransferRunsRequest, StartManualTransferRunsResponse>
startManualTransferRunsSettings() {
return startManualTransferRunsSettings;
}

@Override
public DataTransferServiceStubSettings build() throws IOException {
return new DataTransferServiceStubSettings(this);

0 comments on commit d1cc550

Please sign in to comment.