|
25 | 25 | import com.google.api.gax.rpc.ClientSettings; |
26 | 26 | import com.google.api.gax.rpc.OperationCallSettings; |
27 | 27 | import com.google.api.gax.rpc.PagedCallSettings; |
| 28 | +import com.google.api.gax.rpc.ResumableUploadCallSettings; |
28 | 29 | import com.google.api.gax.rpc.ServerStreamingCallSettings; |
29 | 30 | import com.google.api.gax.rpc.StreamingCallSettings; |
30 | 31 | import com.google.api.gax.rpc.StubSettings; |
@@ -311,12 +312,18 @@ private static List<MethodDefinition> createSettingsGetterMethods( |
311 | 312 | // Add method header comment statements and annotations. |
312 | 313 | private static MethodDefinition methodBuilderHelper( |
313 | 314 | Method protoMethod, MethodDefinition.Builder methodBuilder, String javaMethodName) { |
314 | | - return methodBuilder |
315 | | - .setHeaderCommentStatements( |
316 | | - SettingsCommentComposer.createCallSettingsGetterComment( |
| 315 | + CommentStatement commentStatement = |
| 316 | + protoMethod.isResumableUpload() |
| 317 | + ? SettingsCommentComposer.createResumableUploadCallSettingsGetterComment( |
| 318 | + getMethodNameFromSettingsVarName(javaMethodName), |
| 319 | + protoMethod.isDeprecated(), |
| 320 | + protoMethod.isInternalApi()) |
| 321 | + : SettingsCommentComposer.createCallSettingsGetterComment( |
317 | 322 | getMethodNameFromSettingsVarName(javaMethodName), |
318 | 323 | protoMethod.isDeprecated(), |
319 | | - protoMethod.isInternalApi())) |
| 324 | + protoMethod.isInternalApi()); |
| 325 | + return methodBuilder |
| 326 | + .setHeaderCommentStatements(commentStatement) |
320 | 327 | .setAnnotations(createMethodAnnotations(protoMethod)) |
321 | 328 | .build(); |
322 | 329 | } |
@@ -794,13 +801,19 @@ private static List<MethodDefinition> createNestedBuilderSettingsGetterMethods( |
794 | 801 | String javaMethodName = String.format("%sSettings", javaStyleName); |
795 | 802 | MethodDefinition.Builder methodBuilder = |
796 | 803 | methodMakerFn.apply(getCallSettingsBuilderType(protoMethod, typeStore), javaMethodName); |
| 804 | + CommentStatement commentStatement = |
| 805 | + protoMethod.isResumableUpload() |
| 806 | + ? SettingsCommentComposer.createResumableUploadCallSettingsBuilderGetterComment( |
| 807 | + getMethodNameFromSettingsVarName(javaMethodName), |
| 808 | + protoMethod.isDeprecated(), |
| 809 | + protoMethod.isInternalApi()) |
| 810 | + : SettingsCommentComposer.createCallSettingsBuilderGetterComment( |
| 811 | + getMethodNameFromSettingsVarName(javaMethodName), |
| 812 | + protoMethod.isDeprecated(), |
| 813 | + protoMethod.isInternalApi()); |
797 | 814 | javaMethods.add( |
798 | 815 | methodBuilder |
799 | | - .setHeaderCommentStatements( |
800 | | - SettingsCommentComposer.createCallSettingsBuilderGetterComment( |
801 | | - getMethodNameFromSettingsVarName(javaMethodName), |
802 | | - protoMethod.isDeprecated(), |
803 | | - protoMethod.isInternalApi())) |
| 816 | + .setHeaderCommentStatements(commentStatement) |
804 | 817 | .setAnnotations(createMethodAnnotations(protoMethod)) |
805 | 818 | .build()); |
806 | 819 |
|
@@ -856,6 +869,7 @@ private static TypeStore createStaticTypes() { |
856 | 869 | Operation.class, |
857 | 870 | OperationCallSettings.class, |
858 | 871 | PagedCallSettings.class, |
| 872 | + ResumableUploadCallSettings.class, |
859 | 873 | ServerStreamingCallSettings.class, |
860 | 874 | StreamingCallSettings.class, |
861 | 875 | StubSettings.class, |
@@ -933,7 +947,13 @@ private static TypeNode getCallSettingsTypeHelper( |
933 | 947 | Method protoMethod, TypeStore typeStore, boolean isBuilder) { |
934 | 948 | Class<?> callSettingsClazz = |
935 | 949 | isBuilder ? UnaryCallSettings.Builder.class : UnaryCallSettings.class; |
936 | | - if (protoMethod.isPaged()) { |
| 950 | + if (protoMethod.isResumableUpload()) { |
| 951 | + return TypeNode.withReference( |
| 952 | + ConcreteReference.withClazz( |
| 953 | + isBuilder |
| 954 | + ? ResumableUploadCallSettings.Builder.class |
| 955 | + : ResumableUploadCallSettings.class)); |
| 956 | + } else if (protoMethod.isPaged()) { |
937 | 957 | callSettingsClazz = isBuilder ? PagedCallSettings.Builder.class : PagedCallSettings.class; |
938 | 958 | } else if (protoMethod.isBatching()) { |
939 | 959 | callSettingsClazz = |
|
0 commit comments