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

Commit

Permalink
chore: update java microgenerator to 1.0.2 Adds request initializatio…
Browse files Browse the repository at this point in the history
…n to sample code (#691)

Committer: @miraleung
PiperOrigin-RevId: 362856902

Source-Author: Google APIs <noreply@google.com>
Source-Date: Sun Mar 14 20:47:20 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 1305ca41d554eb0725237561e34129373bb8cbc1
Source-Link: googleapis/googleapis@1305ca4
  • Loading branch information
yoshi-automation committed Mar 15, 2021
1 parent 4e9673c commit 066bab7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 31 deletions.
Expand Up @@ -394,6 +394,13 @@ public final ListDataSourcesPagedResponse listDataSources(ListDataSourcesRequest
*
* <pre>{@code
* try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
* ListDataSourcesRequest request =
* ListDataSourcesRequest.newBuilder()
* .setParent(
* DataSourceName.ofProjectDataSourceName("[PROJECT]", "[DATA_SOURCE]").toString())
* .setPageToken("pageToken873572522")
* .setPageSize(883849137)
* .build();
* while (true) {
* ListDataSourcesResponse response =
* dataTransferServiceClient.listDataSourcesCallable().call(request);
Expand Down Expand Up @@ -1015,6 +1022,15 @@ public final ListTransferConfigsPagedResponse listTransferConfigs(
*
* <pre>{@code
* try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
* ListTransferConfigsRequest request =
* ListTransferConfigsRequest.newBuilder()
* .setParent(
* TransferConfigName.ofProjectTransferConfigName("[PROJECT]", "[TRANSFER_CONFIG]")
* .toString())
* .addAllDataSourceIds(new ArrayList<String>())
* .setPageToken("pageToken873572522")
* .setPageSize(883849137)
* .build();
* while (true) {
* ListTransferConfigsResponse response =
* dataTransferServiceClient.listTransferConfigsCallable().call(request);
Expand Down Expand Up @@ -1567,6 +1583,15 @@ public final ListTransferRunsPagedResponse listTransferRuns(ListTransferRunsRequ
*
* <pre>{@code
* try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
* ListTransferRunsRequest request =
* ListTransferRunsRequest.newBuilder()
* .setParent(
* RunName.ofProjectTransferConfigRunName("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
* .toString())
* .addAllStates(new ArrayList<TransferState>())
* .setPageToken("pageToken873572522")
* .setPageSize(883849137)
* .build();
* while (true) {
* ListTransferRunsResponse response =
* dataTransferServiceClient.listTransferRunsCallable().call(request);
Expand Down Expand Up @@ -1717,6 +1742,15 @@ public final ListTransferLogsPagedResponse listTransferLogs(ListTransferLogsRequ
*
* <pre>{@code
* try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
* ListTransferLogsRequest request =
* ListTransferLogsRequest.newBuilder()
* .setParent(
* RunName.ofProjectTransferConfigRunName("[PROJECT]", "[TRANSFER_CONFIG]", "[RUN]")
* .toString())
* .setPageToken("pageToken873572522")
* .setPageSize(883849137)
* .addAllMessageTypes(new ArrayList<TransferMessage.MessageSeverity>())
* .build();
* while (true) {
* ListTransferLogsResponse response =
* dataTransferServiceClient.listTransferLogsCallable().call(request);
Expand Down
Expand Up @@ -62,7 +62,7 @@ public void reset() {
@Override
public void getDataSource(
GetDataSourceRequest request, StreamObserver<DataSource> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof DataSource) {
requests.add(request);
responseObserver.onNext(((DataSource) response));
Expand All @@ -74,7 +74,7 @@ public void getDataSource(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetDataSource, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
DataSource.class.getName(),
Exception.class.getName())));
}
Expand All @@ -83,7 +83,7 @@ public void getDataSource(
@Override
public void listDataSources(
ListDataSourcesRequest request, StreamObserver<ListDataSourcesResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListDataSourcesResponse) {
requests.add(request);
responseObserver.onNext(((ListDataSourcesResponse) response));
Expand All @@ -95,7 +95,7 @@ public void listDataSources(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListDataSources, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListDataSourcesResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -104,7 +104,7 @@ public void listDataSources(
@Override
public void createTransferConfig(
CreateTransferConfigRequest request, StreamObserver<TransferConfig> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TransferConfig) {
requests.add(request);
responseObserver.onNext(((TransferConfig) response));
Expand All @@ -116,7 +116,7 @@ public void createTransferConfig(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateTransferConfig, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TransferConfig.class.getName(),
Exception.class.getName())));
}
Expand All @@ -125,7 +125,7 @@ public void createTransferConfig(
@Override
public void updateTransferConfig(
UpdateTransferConfigRequest request, StreamObserver<TransferConfig> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TransferConfig) {
requests.add(request);
responseObserver.onNext(((TransferConfig) response));
Expand All @@ -137,7 +137,7 @@ public void updateTransferConfig(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method UpdateTransferConfig, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TransferConfig.class.getName(),
Exception.class.getName())));
}
Expand All @@ -146,7 +146,7 @@ public void updateTransferConfig(
@Override
public void deleteTransferConfig(
DeleteTransferConfigRequest request, StreamObserver<Empty> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Empty) {
requests.add(request);
responseObserver.onNext(((Empty) response));
Expand All @@ -158,7 +158,7 @@ public void deleteTransferConfig(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteTransferConfig, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
}
Expand All @@ -167,7 +167,7 @@ public void deleteTransferConfig(
@Override
public void getTransferConfig(
GetTransferConfigRequest request, StreamObserver<TransferConfig> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TransferConfig) {
requests.add(request);
responseObserver.onNext(((TransferConfig) response));
Expand All @@ -179,7 +179,7 @@ public void getTransferConfig(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetTransferConfig, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TransferConfig.class.getName(),
Exception.class.getName())));
}
Expand All @@ -189,7 +189,7 @@ public void getTransferConfig(
public void listTransferConfigs(
ListTransferConfigsRequest request,
StreamObserver<ListTransferConfigsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListTransferConfigsResponse) {
requests.add(request);
responseObserver.onNext(((ListTransferConfigsResponse) response));
Expand All @@ -201,7 +201,7 @@ public void listTransferConfigs(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListTransferConfigs, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListTransferConfigsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -211,7 +211,7 @@ public void listTransferConfigs(
public void scheduleTransferRuns(
ScheduleTransferRunsRequest request,
StreamObserver<ScheduleTransferRunsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ScheduleTransferRunsResponse) {
requests.add(request);
responseObserver.onNext(((ScheduleTransferRunsResponse) response));
Expand All @@ -223,7 +223,7 @@ public void scheduleTransferRuns(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ScheduleTransferRuns, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ScheduleTransferRunsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -233,7 +233,7 @@ public void scheduleTransferRuns(
public void startManualTransferRuns(
StartManualTransferRunsRequest request,
StreamObserver<StartManualTransferRunsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof StartManualTransferRunsResponse) {
requests.add(request);
responseObserver.onNext(((StartManualTransferRunsResponse) response));
Expand All @@ -245,7 +245,7 @@ public void startManualTransferRuns(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method StartManualTransferRuns, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
StartManualTransferRunsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -254,7 +254,7 @@ public void startManualTransferRuns(
@Override
public void getTransferRun(
GetTransferRunRequest request, StreamObserver<TransferRun> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TransferRun) {
requests.add(request);
responseObserver.onNext(((TransferRun) response));
Expand All @@ -266,7 +266,7 @@ public void getTransferRun(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetTransferRun, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TransferRun.class.getName(),
Exception.class.getName())));
}
Expand All @@ -275,7 +275,7 @@ public void getTransferRun(
@Override
public void deleteTransferRun(
DeleteTransferRunRequest request, StreamObserver<Empty> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Empty) {
requests.add(request);
responseObserver.onNext(((Empty) response));
Expand All @@ -287,7 +287,7 @@ public void deleteTransferRun(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteTransferRun, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Empty.class.getName(),
Exception.class.getName())));
}
Expand All @@ -296,7 +296,7 @@ public void deleteTransferRun(
@Override
public void listTransferRuns(
ListTransferRunsRequest request, StreamObserver<ListTransferRunsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListTransferRunsResponse) {
requests.add(request);
responseObserver.onNext(((ListTransferRunsResponse) response));
Expand All @@ -308,7 +308,7 @@ public void listTransferRuns(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListTransferRuns, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListTransferRunsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -317,7 +317,7 @@ public void listTransferRuns(
@Override
public void listTransferLogs(
ListTransferLogsRequest request, StreamObserver<ListTransferLogsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListTransferLogsResponse) {
requests.add(request);
responseObserver.onNext(((ListTransferLogsResponse) response));
Expand All @@ -329,7 +329,7 @@ public void listTransferLogs(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListTransferLogs, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListTransferLogsResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -338,7 +338,7 @@ public void listTransferLogs(
@Override
public void checkValidCreds(
CheckValidCredsRequest request, StreamObserver<CheckValidCredsResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof CheckValidCredsResponse) {
requests.add(request);
responseObserver.onNext(((CheckValidCredsResponse) response));
Expand All @@ -350,7 +350,7 @@ public void checkValidCreds(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CheckValidCreds, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
CheckValidCredsResponse.class.getName(),
Exception.class.getName())));
}
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -11,15 +11,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-bigquerydatatransfer.git",
"sha": "9ae502fc1b92b51953b2cd9361d42fed10f8fa25"
"sha": "a6c4e691788d217c2c744170d58e89b130da7afe"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89",
"internalRef": "361377784"
"sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
"internalRef": "362856902"
}
},
{
Expand Down

0 comments on commit 066bab7

Please sign in to comment.