-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Implement DIREGAPIC LRO annotations #832
Merged
GabrielGonzalezDiaz
merged 26 commits into
googleapis:diregapic-lro
from
GabrielGonzalezDiaz:diregapic-lro
Sep 3, 2021
Merged
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
570bb33
fix ServiceStub Goldens
GabrielGonzalezDiaz cdb67da
fix Stub golden
GabrielGonzalezDiaz 2430989
fix Stub golden
GabrielGonzalezDiaz 6b15e3b
fix CallableFactory golden
GabrielGonzalezDiaz 9ed928a
fix java format
GabrielGonzalezDiaz edbe1a4
add annotation placement comments
GabrielGonzalezDiaz e1d5e83
only add machinery to methods that return operation
GabrielGonzalezDiaz 703c123
add grpc file that contained method that was edited on abstract class
GabrielGonzalezDiaz 67b42bd
update HttpJsonComplianceStub.golden
GabrielGonzalezDiaz 703fc37
java format
GabrielGonzalezDiaz 8dbd36b
add initial methods from annotations
GabrielGonzalezDiaz f9f9c66
add initial methods from annotations
GabrielGonzalezDiaz 772ca7e
fix merge errors
GabrielGonzalezDiaz 0657d8c
Implement annotations
GabrielGonzalezDiaz 5c4c626
java format
GabrielGonzalezDiaz b02303c
fix package for Status
GabrielGonzalezDiaz f827fc6
fix CallableFactory generics
GabrielGonzalezDiaz 50815a9
java format
GabrielGonzalezDiaz 8867470
initialize new fields in message for parser test
GabrielGonzalezDiaz ae11f55
set default value for operation_polling_method
GabrielGonzalezDiaz 045c6da
add brackets to if statement
GabrielGonzalezDiaz 25bcb10
remove comments and invoke methods
GabrielGonzalezDiaz 85ac40b
add brackets to if statements and remove invoke methods
GabrielGonzalezDiaz 3fbb746
java formet
GabrielGonzalezDiaz 85368d9
add longRunningClient
GabrielGonzalezDiaz 2bb8199
callablefactory fixes
GabrielGonzalezDiaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ | |
package com.google.api.generator.gapic.composer.rest; | ||
|
||
import com.google.api.gax.core.BackgroundResource; | ||
import com.google.api.gax.httpjson.ApiMessage; | ||
import com.google.api.gax.httpjson.HttpJsonCallableFactory; | ||
import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; | ||
import com.google.api.gax.rpc.OperationCallable; | ||
|
@@ -47,7 +46,7 @@ public class HttpJsonServiceCallableFactoryClassComposer | |
new HttpJsonServiceCallableFactoryClassComposer(); | ||
|
||
private static final TypeNode MESSAGE_TYPE = | ||
TypeNode.withReference(ConcreteReference.withClazz(ApiMessage.class)); | ||
TypeNode.withReference(ConcreteReference.withClazz(Operation.class)); | ||
private static final TypeNode BACKGROUND_RESOURCE_TYPE = | ||
TypeNode.withReference(ConcreteReference.withClazz(BackgroundResource.class)); | ||
|
||
|
@@ -121,11 +120,21 @@ protected MethodDefinition createOperationCallableMethod(TypeStore typeStore) { | |
|
||
List<Statement> createOperationCallableBody = new ArrayList<Statement>(2); | ||
|
||
List<VariableExpr> arguments = method.arguments(); | ||
List<VariableExpr> arguments = new ArrayList<>(method.arguments()); | ||
// arguments.set( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove all comments like this (debugging artifacts) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still here... |
||
// 0, | ||
// arguments | ||
// .get(0) | ||
// .toBuilder() | ||
// .setTemplateObjects(Arrays.asList(requestTemplateName, methodVariantName)) | ||
// .build()); // httpJsonCallSettings); | ||
// method = method.toBuilder().setArguments(arguments).build(); | ||
|
||
// arguments = method.arguments(); | ||
Variable httpJsonCallSettingsVar = arguments.get(0).variable(); | ||
Variable callSettingsVar = arguments.get(1).variable(); | ||
Variable operationCallSettingsVar = arguments.get(1).variable(); | ||
Variable clientContextVar = arguments.get(2).variable(); | ||
Variable operationsStub = arguments.get(3).variable(); | ||
Variable operationsStubVar = arguments.get(3).variable(); | ||
// Generate innerCallable | ||
VariableExpr innerCallableVarExpr = | ||
VariableExpr.builder() | ||
|
@@ -139,7 +148,7 @@ protected MethodDefinition createOperationCallableMethod(TypeStore typeStore) { | |
.build(); | ||
MethodInvocationExpr getInitialCallSettingsExpr = | ||
MethodInvocationExpr.builder() | ||
.setExprReferenceExpr(VariableExpr.withVariable(callSettingsVar)) | ||
.setExprReferenceExpr(VariableExpr.withVariable(operationCallSettingsVar)) | ||
.setMethodName("getInitialCallSettings") | ||
.build(); | ||
MethodInvocationExpr createBaseUnaryCallableExpr = | ||
|
@@ -209,7 +218,7 @@ protected MethodDefinition createOperationCallableMethod(TypeStore typeStore) { | |
// Generate return statement | ||
MethodInvocationExpr longRunningClient = | ||
MethodInvocationExpr.builder() | ||
.setExprReferenceExpr(VariableExpr.withVariable(operationsStub)) | ||
.setExprReferenceExpr(VariableExpr.withVariable(operationsStubVar)) | ||
.setMethodName("longRunningClient") | ||
.build(); | ||
MethodInvocationExpr createOperationCallable = | ||
|
@@ -218,7 +227,7 @@ protected MethodDefinition createOperationCallableMethod(TypeStore typeStore) { | |
TypeNode.withReference(ConcreteReference.withClazz(HttpJsonCallableFactory.class))) | ||
.setMethodName("createOperationCallable") | ||
.setArguments( | ||
VariableExpr.withVariable(callSettingsVar), | ||
VariableExpr.withVariable(operationCallSettingsVar), | ||
VariableExpr.withVariable(clientContextVar), | ||
longRunningClient, | ||
initialCallableVarExpr) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove