Skip to content

Commit de65165

Browse files
Regenerating SPI: method descriptors, removing usage of deprecated (#1946)
1 parent f5d5991 commit de65165

36 files changed

Lines changed: 703 additions & 231 deletions

File tree

google-cloud-datastore/src/main/java/com/google/cloud/datastore/ValueType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public enum ValueType {
6666
BOOLEAN(BooleanValue.MARSHALLER),
6767

6868
/**
69-
* Represents a {@link Timestamp} value.
69+
* Represents a {@link com.google.cloud.Timestamp} value.
7070
*/
7171
TIMESTAMP(TimestampValue.MARSHALLER),
7272

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import com.google.common.collect.Lists;
3232
import com.google.common.collect.Sets;
3333
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup;
34-
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupServiceGrpc;
3534
import com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest;
3635
import com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest;
3736
import com.google.protobuf.ExperimentalApi;
@@ -83,6 +82,20 @@ public class ErrorGroupServiceSettings extends ClientSettings {
8382

8483
private static String gapicVersion;
8584

85+
private static final io.grpc.MethodDescriptor<GetGroupRequest, ErrorGroup> METHOD_GET_GROUP =
86+
io.grpc.MethodDescriptor.create(
87+
io.grpc.MethodDescriptor.MethodType.UNARY,
88+
"google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup",
89+
io.grpc.protobuf.ProtoUtils.marshaller(GetGroupRequest.getDefaultInstance()),
90+
io.grpc.protobuf.ProtoUtils.marshaller(ErrorGroup.getDefaultInstance()));
91+
private static final io.grpc.MethodDescriptor<UpdateGroupRequest, ErrorGroup>
92+
METHOD_UPDATE_GROUP =
93+
io.grpc.MethodDescriptor.create(
94+
io.grpc.MethodDescriptor.MethodType.UNARY,
95+
"google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup",
96+
io.grpc.protobuf.ProtoUtils.marshaller(UpdateGroupRequest.getDefaultInstance()),
97+
io.grpc.protobuf.ProtoUtils.marshaller(ErrorGroup.getDefaultInstance()));
98+
8699
private final SimpleCallSettings<GetGroupRequest, ErrorGroup> getGroupSettings;
87100
private final SimpleCallSettings<UpdateGroupRequest, ErrorGroup> updateGroupSettings;
88101

@@ -199,10 +212,9 @@ public static class Builder extends ClientSettings.Builder {
199212
private Builder() {
200213
super(defaultChannelProviderBuilder().build());
201214

202-
getGroupSettings = SimpleCallSettings.newBuilder(ErrorGroupServiceGrpc.METHOD_GET_GROUP);
215+
getGroupSettings = SimpleCallSettings.newBuilder(METHOD_GET_GROUP);
203216

204-
updateGroupSettings =
205-
SimpleCallSettings.newBuilder(ErrorGroupServiceGrpc.METHOD_UPDATE_GROUP);
217+
updateGroupSettings = SimpleCallSettings.newBuilder(METHOD_UPDATE_GROUP);
206218

207219
unaryMethodSettingsBuilders =
208220
ImmutableList.<UnaryCallSettings.Builder>of(getGroupSettings, updateGroupSettings);

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsResponse;
4545
import com.google.devtools.clouderrorreporting.v1beta1.ErrorEvent;
4646
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupStats;
47-
import com.google.devtools.clouderrorreporting.v1beta1.ErrorStatsServiceGrpc;
4847
import com.google.devtools.clouderrorreporting.v1beta1.ListEventsRequest;
4948
import com.google.devtools.clouderrorreporting.v1beta1.ListEventsResponse;
5049
import com.google.devtools.clouderrorreporting.v1beta1.ListGroupStatsRequest;
@@ -98,6 +97,28 @@ public class ErrorStatsServiceSettings extends ClientSettings {
9897

9998
private static String gapicVersion;
10099

100+
private static final io.grpc.MethodDescriptor<ListGroupStatsRequest, ListGroupStatsResponse>
101+
METHOD_LIST_GROUP_STATS =
102+
io.grpc.MethodDescriptor.create(
103+
io.grpc.MethodDescriptor.MethodType.UNARY,
104+
"google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListGroupStats",
105+
io.grpc.protobuf.ProtoUtils.marshaller(ListGroupStatsRequest.getDefaultInstance()),
106+
io.grpc.protobuf.ProtoUtils.marshaller(ListGroupStatsResponse.getDefaultInstance()));
107+
private static final io.grpc.MethodDescriptor<ListEventsRequest, ListEventsResponse>
108+
METHOD_LIST_EVENTS =
109+
io.grpc.MethodDescriptor.create(
110+
io.grpc.MethodDescriptor.MethodType.UNARY,
111+
"google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/ListEvents",
112+
io.grpc.protobuf.ProtoUtils.marshaller(ListEventsRequest.getDefaultInstance()),
113+
io.grpc.protobuf.ProtoUtils.marshaller(ListEventsResponse.getDefaultInstance()));
114+
private static final io.grpc.MethodDescriptor<DeleteEventsRequest, DeleteEventsResponse>
115+
METHOD_DELETE_EVENTS =
116+
io.grpc.MethodDescriptor.create(
117+
io.grpc.MethodDescriptor.MethodType.UNARY,
118+
"google.devtools.clouderrorreporting.v1beta1.ErrorStatsService/DeleteEvents",
119+
io.grpc.protobuf.ProtoUtils.marshaller(DeleteEventsRequest.getDefaultInstance()),
120+
io.grpc.protobuf.ProtoUtils.marshaller(DeleteEventsResponse.getDefaultInstance()));
121+
101122
private final PagedCallSettings<
102123
ListGroupStatsRequest, ListGroupStatsResponse, ListGroupStatsPagedResponse>
103124
listGroupStatsSettings;
@@ -341,15 +362,12 @@ private Builder() {
341362
super(defaultChannelProviderBuilder().build());
342363

343364
listGroupStatsSettings =
344-
PagedCallSettings.newBuilder(
345-
ErrorStatsServiceGrpc.METHOD_LIST_GROUP_STATS, LIST_GROUP_STATS_PAGE_STR_FACT);
365+
PagedCallSettings.newBuilder(METHOD_LIST_GROUP_STATS, LIST_GROUP_STATS_PAGE_STR_FACT);
346366

347367
listEventsSettings =
348-
PagedCallSettings.newBuilder(
349-
ErrorStatsServiceGrpc.METHOD_LIST_EVENTS, LIST_EVENTS_PAGE_STR_FACT);
368+
PagedCallSettings.newBuilder(METHOD_LIST_EVENTS, LIST_EVENTS_PAGE_STR_FACT);
350369

351-
deleteEventsSettings =
352-
SimpleCallSettings.newBuilder(ErrorStatsServiceGrpc.METHOD_DELETE_EVENTS);
370+
deleteEventsSettings = SimpleCallSettings.newBuilder(METHOD_DELETE_EVENTS);
353371

354372
unaryMethodSettingsBuilders =
355373
ImmutableList.<UnaryCallSettings.Builder>of(

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import com.google.common.collect.Sets;
3333
import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest;
3434
import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse;
35-
import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorsServiceGrpc;
3635
import com.google.protobuf.ExperimentalApi;
3736
import io.grpc.Status;
3837
import java.io.IOException;
@@ -82,6 +81,15 @@ public class ReportErrorsServiceSettings extends ClientSettings {
8281

8382
private static String gapicVersion;
8483

84+
private static final io.grpc.MethodDescriptor<ReportErrorEventRequest, ReportErrorEventResponse>
85+
METHOD_REPORT_ERROR_EVENT =
86+
io.grpc.MethodDescriptor.create(
87+
io.grpc.MethodDescriptor.MethodType.UNARY,
88+
"google.devtools.clouderrorreporting.v1beta1.ReportErrorsService/ReportErrorEvent",
89+
io.grpc.protobuf.ProtoUtils.marshaller(ReportErrorEventRequest.getDefaultInstance()),
90+
io.grpc.protobuf.ProtoUtils.marshaller(
91+
ReportErrorEventResponse.getDefaultInstance()));
92+
8593
private final SimpleCallSettings<ReportErrorEventRequest, ReportErrorEventResponse>
8694
reportErrorEventSettings;
8795

@@ -193,8 +201,7 @@ public static class Builder extends ClientSettings.Builder {
193201
private Builder() {
194202
super(defaultChannelProviderBuilder().build());
195203

196-
reportErrorEventSettings =
197-
SimpleCallSettings.newBuilder(ReportErrorsServiceGrpc.METHOD_REPORT_ERROR_EVENT);
204+
reportErrorEventSettings = SimpleCallSettings.newBuilder(METHOD_REPORT_ERROR_EVENT);
198205

199206
unaryMethodSettingsBuilders =
200207
ImmutableList.<UnaryCallSettings.Builder>of(reportErrorEventSettings);

google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorGroupService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
public void setResponses(List<GeneratedMessageV3> responses) {
47-
serviceImpl.setResponses(responses);
48-
}
49-
5046
@Override
5147
public ServerServiceDefinition getServiceDefinition() {
5248
return serviceImpl.bindService();

google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockErrorStatsService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
public void setResponses(List<GeneratedMessageV3> responses) {
47-
serviceImpl.setResponses(responses);
48-
}
49-
5046
@Override
5147
public ServerServiceDefinition getServiceDefinition() {
5248
return serviceImpl.bindService();

google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/MockReportErrorsService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
public void setResponses(List<GeneratedMessageV3> responses) {
47-
serviceImpl.setResponses(responses);
48-
}
49-
5046
@Override
5147
public ServerServiceDefinition getServiceDefinition() {
5248
return serviceImpl.bindService();

google-cloud-language/src/main/java/com/google/cloud/language/spi/v1/LanguageServiceSettings.java

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.google.cloud.language.v1.AnalyzeSyntaxResponse;
3434
import com.google.cloud.language.v1.AnnotateTextRequest;
3535
import com.google.cloud.language.v1.AnnotateTextResponse;
36-
import com.google.cloud.language.v1.LanguageServiceGrpc;
3736
import com.google.common.collect.ImmutableList;
3837
import com.google.common.collect.ImmutableMap;
3938
import com.google.common.collect.ImmutableSet;
@@ -86,6 +85,36 @@ public class LanguageServiceSettings extends ClientSettings {
8685

8786
private static String gapicVersion;
8887

88+
private static final io.grpc.MethodDescriptor<AnalyzeSentimentRequest, AnalyzeSentimentResponse>
89+
METHOD_ANALYZE_SENTIMENT =
90+
io.grpc.MethodDescriptor.create(
91+
io.grpc.MethodDescriptor.MethodType.UNARY,
92+
"google.cloud.language.v1.LanguageService/AnalyzeSentiment",
93+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeSentimentRequest.getDefaultInstance()),
94+
io.grpc.protobuf.ProtoUtils.marshaller(
95+
AnalyzeSentimentResponse.getDefaultInstance()));
96+
private static final io.grpc.MethodDescriptor<AnalyzeEntitiesRequest, AnalyzeEntitiesResponse>
97+
METHOD_ANALYZE_ENTITIES =
98+
io.grpc.MethodDescriptor.create(
99+
io.grpc.MethodDescriptor.MethodType.UNARY,
100+
"google.cloud.language.v1.LanguageService/AnalyzeEntities",
101+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeEntitiesRequest.getDefaultInstance()),
102+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeEntitiesResponse.getDefaultInstance()));
103+
private static final io.grpc.MethodDescriptor<AnalyzeSyntaxRequest, AnalyzeSyntaxResponse>
104+
METHOD_ANALYZE_SYNTAX =
105+
io.grpc.MethodDescriptor.create(
106+
io.grpc.MethodDescriptor.MethodType.UNARY,
107+
"google.cloud.language.v1.LanguageService/AnalyzeSyntax",
108+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeSyntaxRequest.getDefaultInstance()),
109+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeSyntaxResponse.getDefaultInstance()));
110+
private static final io.grpc.MethodDescriptor<AnnotateTextRequest, AnnotateTextResponse>
111+
METHOD_ANNOTATE_TEXT =
112+
io.grpc.MethodDescriptor.create(
113+
io.grpc.MethodDescriptor.MethodType.UNARY,
114+
"google.cloud.language.v1.LanguageService/AnnotateText",
115+
io.grpc.protobuf.ProtoUtils.marshaller(AnnotateTextRequest.getDefaultInstance()),
116+
io.grpc.protobuf.ProtoUtils.marshaller(AnnotateTextResponse.getDefaultInstance()));
117+
89118
private final SimpleCallSettings<AnalyzeSentimentRequest, AnalyzeSentimentResponse>
90119
analyzeSentimentSettings;
91120
private final SimpleCallSettings<AnalyzeEntitiesRequest, AnalyzeEntitiesResponse>
@@ -227,17 +256,13 @@ public static class Builder extends ClientSettings.Builder {
227256
private Builder() {
228257
super(defaultChannelProviderBuilder().build());
229258

230-
analyzeSentimentSettings =
231-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_SENTIMENT);
259+
analyzeSentimentSettings = SimpleCallSettings.newBuilder(METHOD_ANALYZE_SENTIMENT);
232260

233-
analyzeEntitiesSettings =
234-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_ENTITIES);
261+
analyzeEntitiesSettings = SimpleCallSettings.newBuilder(METHOD_ANALYZE_ENTITIES);
235262

236-
analyzeSyntaxSettings =
237-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_SYNTAX);
263+
analyzeSyntaxSettings = SimpleCallSettings.newBuilder(METHOD_ANALYZE_SYNTAX);
238264

239-
annotateTextSettings =
240-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANNOTATE_TEXT);
265+
annotateTextSettings = SimpleCallSettings.newBuilder(METHOD_ANNOTATE_TEXT);
241266

242267
unaryMethodSettingsBuilders =
243268
ImmutableList.<UnaryCallSettings.Builder>of(

google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta2/LanguageServiceSettings.java

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import com.google.cloud.language.v1beta2.AnalyzeSyntaxResponse;
3636
import com.google.cloud.language.v1beta2.AnnotateTextRequest;
3737
import com.google.cloud.language.v1beta2.AnnotateTextResponse;
38-
import com.google.cloud.language.v1beta2.LanguageServiceGrpc;
3938
import com.google.common.collect.ImmutableList;
4039
import com.google.common.collect.ImmutableMap;
4140
import com.google.common.collect.ImmutableSet;
@@ -88,6 +87,46 @@ public class LanguageServiceSettings extends ClientSettings {
8887

8988
private static String gapicVersion;
9089

90+
private static final io.grpc.MethodDescriptor<AnalyzeSentimentRequest, AnalyzeSentimentResponse>
91+
METHOD_ANALYZE_SENTIMENT =
92+
io.grpc.MethodDescriptor.create(
93+
io.grpc.MethodDescriptor.MethodType.UNARY,
94+
"google.cloud.language.v1beta2.LanguageService/AnalyzeSentiment",
95+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeSentimentRequest.getDefaultInstance()),
96+
io.grpc.protobuf.ProtoUtils.marshaller(
97+
AnalyzeSentimentResponse.getDefaultInstance()));
98+
private static final io.grpc.MethodDescriptor<AnalyzeEntitiesRequest, AnalyzeEntitiesResponse>
99+
METHOD_ANALYZE_ENTITIES =
100+
io.grpc.MethodDescriptor.create(
101+
io.grpc.MethodDescriptor.MethodType.UNARY,
102+
"google.cloud.language.v1beta2.LanguageService/AnalyzeEntities",
103+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeEntitiesRequest.getDefaultInstance()),
104+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeEntitiesResponse.getDefaultInstance()));
105+
private static final io.grpc.MethodDescriptor<
106+
AnalyzeEntitySentimentRequest, AnalyzeEntitySentimentResponse>
107+
METHOD_ANALYZE_ENTITY_SENTIMENT =
108+
io.grpc.MethodDescriptor.create(
109+
io.grpc.MethodDescriptor.MethodType.UNARY,
110+
"google.cloud.language.v1beta2.LanguageService/AnalyzeEntitySentiment",
111+
io.grpc.protobuf.ProtoUtils.marshaller(
112+
AnalyzeEntitySentimentRequest.getDefaultInstance()),
113+
io.grpc.protobuf.ProtoUtils.marshaller(
114+
AnalyzeEntitySentimentResponse.getDefaultInstance()));
115+
private static final io.grpc.MethodDescriptor<AnalyzeSyntaxRequest, AnalyzeSyntaxResponse>
116+
METHOD_ANALYZE_SYNTAX =
117+
io.grpc.MethodDescriptor.create(
118+
io.grpc.MethodDescriptor.MethodType.UNARY,
119+
"google.cloud.language.v1beta2.LanguageService/AnalyzeSyntax",
120+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeSyntaxRequest.getDefaultInstance()),
121+
io.grpc.protobuf.ProtoUtils.marshaller(AnalyzeSyntaxResponse.getDefaultInstance()));
122+
private static final io.grpc.MethodDescriptor<AnnotateTextRequest, AnnotateTextResponse>
123+
METHOD_ANNOTATE_TEXT =
124+
io.grpc.MethodDescriptor.create(
125+
io.grpc.MethodDescriptor.MethodType.UNARY,
126+
"google.cloud.language.v1beta2.LanguageService/AnnotateText",
127+
io.grpc.protobuf.ProtoUtils.marshaller(AnnotateTextRequest.getDefaultInstance()),
128+
io.grpc.protobuf.ProtoUtils.marshaller(AnnotateTextResponse.getDefaultInstance()));
129+
91130
private final SimpleCallSettings<AnalyzeSentimentRequest, AnalyzeSentimentResponse>
92131
analyzeSentimentSettings;
93132
private final SimpleCallSettings<AnalyzeEntitiesRequest, AnalyzeEntitiesResponse>
@@ -241,20 +280,16 @@ public static class Builder extends ClientSettings.Builder {
241280
private Builder() {
242281
super(defaultChannelProviderBuilder().build());
243282

244-
analyzeSentimentSettings =
245-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_SENTIMENT);
283+
analyzeSentimentSettings = SimpleCallSettings.newBuilder(METHOD_ANALYZE_SENTIMENT);
246284

247-
analyzeEntitiesSettings =
248-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_ENTITIES);
285+
analyzeEntitiesSettings = SimpleCallSettings.newBuilder(METHOD_ANALYZE_ENTITIES);
249286

250287
analyzeEntitySentimentSettings =
251-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_ENTITY_SENTIMENT);
288+
SimpleCallSettings.newBuilder(METHOD_ANALYZE_ENTITY_SENTIMENT);
252289

253-
analyzeSyntaxSettings =
254-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANALYZE_SYNTAX);
290+
analyzeSyntaxSettings = SimpleCallSettings.newBuilder(METHOD_ANALYZE_SYNTAX);
255291

256-
annotateTextSettings =
257-
SimpleCallSettings.newBuilder(LanguageServiceGrpc.METHOD_ANNOTATE_TEXT);
292+
annotateTextSettings = SimpleCallSettings.newBuilder(METHOD_ANNOTATE_TEXT);
258293

259294
unaryMethodSettingsBuilders =
260295
ImmutableList.<UnaryCallSettings.Builder>of(

google-cloud-language/src/test/java/com/google/cloud/language/spi/v1/MockLanguageService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ public void addException(Exception exception) {
4343
serviceImpl.addException(exception);
4444
}
4545

46-
public void setResponses(List<GeneratedMessageV3> responses) {
47-
serviceImpl.setResponses(responses);
48-
}
49-
5046
@Override
5147
public ServerServiceDefinition getServiceDefinition() {
5248
return serviceImpl.bindService();

0 commit comments

Comments
 (0)