Skip to content
This repository has been archived by the owner on Oct 14, 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 (#473)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2c9cca4a-366c-4c22-a332-9048b732edf6/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 362856902
Source-Link: googleapis/googleapis@1305ca4
  • Loading branch information
yoshi-automation committed Mar 15, 2021
1 parent 2828e48 commit b54584e
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 37 deletions.
Expand Up @@ -1099,6 +1099,13 @@ public final ListGlossariesPagedResponse listGlossaries(ListGlossariesRequest re
*
* <pre>{@code
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* ListGlossariesRequest request =
* ListGlossariesRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* while (true) {
* ListGlossariesResponse response =
* translationServiceClient.listGlossariesCallable().call(request);
Expand Down
Expand Up @@ -937,6 +937,13 @@ public final ListGlossariesPagedResponse listGlossaries(ListGlossariesRequest re
*
* <pre>{@code
* try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {
* ListGlossariesRequest request =
* ListGlossariesRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* while (true) {
* ListGlossariesResponse response =
* translationServiceClient.listGlossariesCallable().call(request);
Expand Down
Expand Up @@ -62,7 +62,7 @@ public void reset() {
@Override
public void translateText(
TranslateTextRequest request, StreamObserver<TranslateTextResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TranslateTextResponse) {
requests.add(request);
responseObserver.onNext(((TranslateTextResponse) response));
Expand All @@ -74,7 +74,7 @@ public void translateText(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method TranslateText, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TranslateTextResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -83,7 +83,7 @@ public void translateText(
@Override
public void detectLanguage(
DetectLanguageRequest request, StreamObserver<DetectLanguageResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof DetectLanguageResponse) {
requests.add(request);
responseObserver.onNext(((DetectLanguageResponse) response));
Expand All @@ -95,7 +95,7 @@ public void detectLanguage(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DetectLanguage, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
DetectLanguageResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -104,7 +104,7 @@ public void detectLanguage(
@Override
public void getSupportedLanguages(
GetSupportedLanguagesRequest request, StreamObserver<SupportedLanguages> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof SupportedLanguages) {
requests.add(request);
responseObserver.onNext(((SupportedLanguages) response));
Expand All @@ -116,7 +116,7 @@ public void getSupportedLanguages(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetSupportedLanguages, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
SupportedLanguages.class.getName(),
Exception.class.getName())));
}
Expand All @@ -125,7 +125,7 @@ public void getSupportedLanguages(
@Override
public void batchTranslateText(
BatchTranslateTextRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -137,7 +137,7 @@ public void batchTranslateText(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method BatchTranslateText, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand All @@ -146,7 +146,7 @@ public void batchTranslateText(
@Override
public void createGlossary(
CreateGlossaryRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -158,7 +158,7 @@ public void createGlossary(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateGlossary, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand All @@ -167,7 +167,7 @@ public void createGlossary(
@Override
public void listGlossaries(
ListGlossariesRequest request, StreamObserver<ListGlossariesResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListGlossariesResponse) {
requests.add(request);
responseObserver.onNext(((ListGlossariesResponse) response));
Expand All @@ -179,15 +179,15 @@ public void listGlossaries(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListGlossaries, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListGlossariesResponse.class.getName(),
Exception.class.getName())));
}
}

@Override
public void getGlossary(GetGlossaryRequest request, StreamObserver<Glossary> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Glossary) {
requests.add(request);
responseObserver.onNext(((Glossary) response));
Expand All @@ -199,7 +199,7 @@ public void getGlossary(GetGlossaryRequest request, StreamObserver<Glossary> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetGlossary, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Glossary.class.getName(),
Exception.class.getName())));
}
Expand All @@ -208,7 +208,7 @@ public void getGlossary(GetGlossaryRequest request, StreamObserver<Glossary> res
@Override
public void deleteGlossary(
DeleteGlossaryRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -220,7 +220,7 @@ public void deleteGlossary(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteGlossary, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand Down
Expand Up @@ -62,7 +62,7 @@ public void reset() {
@Override
public void translateText(
TranslateTextRequest request, StreamObserver<TranslateTextResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof TranslateTextResponse) {
requests.add(request);
responseObserver.onNext(((TranslateTextResponse) response));
Expand All @@ -74,7 +74,7 @@ public void translateText(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method TranslateText, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
TranslateTextResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -83,7 +83,7 @@ public void translateText(
@Override
public void detectLanguage(
DetectLanguageRequest request, StreamObserver<DetectLanguageResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof DetectLanguageResponse) {
requests.add(request);
responseObserver.onNext(((DetectLanguageResponse) response));
Expand All @@ -95,7 +95,7 @@ public void detectLanguage(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DetectLanguage, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
DetectLanguageResponse.class.getName(),
Exception.class.getName())));
}
Expand All @@ -104,7 +104,7 @@ public void detectLanguage(
@Override
public void getSupportedLanguages(
GetSupportedLanguagesRequest request, StreamObserver<SupportedLanguages> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof SupportedLanguages) {
requests.add(request);
responseObserver.onNext(((SupportedLanguages) response));
Expand All @@ -116,7 +116,7 @@ public void getSupportedLanguages(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetSupportedLanguages, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
SupportedLanguages.class.getName(),
Exception.class.getName())));
}
Expand All @@ -125,7 +125,7 @@ public void getSupportedLanguages(
@Override
public void batchTranslateText(
BatchTranslateTextRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -137,7 +137,7 @@ public void batchTranslateText(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method BatchTranslateText, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand All @@ -146,7 +146,7 @@ public void batchTranslateText(
@Override
public void createGlossary(
CreateGlossaryRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -158,7 +158,7 @@ public void createGlossary(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method CreateGlossary, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand All @@ -167,7 +167,7 @@ public void createGlossary(
@Override
public void listGlossaries(
ListGlossariesRequest request, StreamObserver<ListGlossariesResponse> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof ListGlossariesResponse) {
requests.add(request);
responseObserver.onNext(((ListGlossariesResponse) response));
Expand All @@ -179,15 +179,15 @@ public void listGlossaries(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ListGlossaries, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
ListGlossariesResponse.class.getName(),
Exception.class.getName())));
}
}

@Override
public void getGlossary(GetGlossaryRequest request, StreamObserver<Glossary> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Glossary) {
requests.add(request);
responseObserver.onNext(((Glossary) response));
Expand All @@ -199,7 +199,7 @@ public void getGlossary(GetGlossaryRequest request, StreamObserver<Glossary> res
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method GetGlossary, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Glossary.class.getName(),
Exception.class.getName())));
}
Expand All @@ -208,7 +208,7 @@ public void getGlossary(GetGlossaryRequest request, StreamObserver<Glossary> res
@Override
public void deleteGlossary(
DeleteGlossaryRequest request, StreamObserver<Operation> responseObserver) {
Object response = responses.remove();
Object response = responses.poll();
if (response instanceof Operation) {
requests.add(request);
responseObserver.onNext(((Operation) response));
Expand All @@ -220,7 +220,7 @@ public void deleteGlossary(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method DeleteGlossary, expected %s or %s",
response.getClass().getName(),
response == null ? "null" : response.getClass().getName(),
Operation.class.getName(),
Exception.class.getName())));
}
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
Expand Up @@ -4,23 +4,23 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-translate.git",
"sha": "668efba8df1064249bfc555b510759075f0f54ec"
"sha": "2828e4829b5a1e6a403026e57427527a07dc329b"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89",
"internalRef": "361377784"
"sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
"internalRef": "362856902"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89",
"internalRef": "361377784"
"sha": "1305ca41d554eb0725237561e34129373bb8cbc1",
"internalRef": "362856902"
}
},
{
Expand Down

0 comments on commit b54584e

Please sign in to comment.