|
24 | 24 | import com.google.api.gax.grpc.GrpcCallSettings; |
25 | 25 | import com.google.api.gax.grpc.GrpcStubCallableFactory; |
26 | 26 | import com.google.api.gax.rpc.ClientContext; |
| 27 | +import com.google.api.gax.rpc.RequestParamsExtractor; |
27 | 28 | import com.google.api.gax.rpc.UnaryCallable; |
| 29 | +import com.google.common.collect.ImmutableMap; |
28 | 30 | import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsRequest; |
29 | 31 | import com.google.devtools.clouderrorreporting.v1beta1.DeleteEventsResponse; |
30 | 32 | import com.google.devtools.clouderrorreporting.v1beta1.ListEventsRequest; |
|
34 | 36 | import io.grpc.MethodDescriptor; |
35 | 37 | import io.grpc.protobuf.ProtoUtils; |
36 | 38 | import java.io.IOException; |
| 39 | +import java.util.Map; |
37 | 40 | import java.util.concurrent.TimeUnit; |
38 | 41 | import javax.annotation.Generated; |
39 | 42 |
|
@@ -132,14 +135,41 @@ protected GrpcErrorStatsServiceStub( |
132 | 135 | listGroupStatsTransportSettings = |
133 | 136 | GrpcCallSettings.<ListGroupStatsRequest, ListGroupStatsResponse>newBuilder() |
134 | 137 | .setMethodDescriptor(listGroupStatsMethodDescriptor) |
| 138 | + .setParamsExtractor( |
| 139 | + new RequestParamsExtractor<ListGroupStatsRequest>() { |
| 140 | + @Override |
| 141 | + public Map<String, String> extract(ListGroupStatsRequest request) { |
| 142 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 143 | + params.put("project_name", String.valueOf(request.getProjectName())); |
| 144 | + return params.build(); |
| 145 | + } |
| 146 | + }) |
135 | 147 | .build(); |
136 | 148 | GrpcCallSettings<ListEventsRequest, ListEventsResponse> listEventsTransportSettings = |
137 | 149 | GrpcCallSettings.<ListEventsRequest, ListEventsResponse>newBuilder() |
138 | 150 | .setMethodDescriptor(listEventsMethodDescriptor) |
| 151 | + .setParamsExtractor( |
| 152 | + new RequestParamsExtractor<ListEventsRequest>() { |
| 153 | + @Override |
| 154 | + public Map<String, String> extract(ListEventsRequest request) { |
| 155 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 156 | + params.put("project_name", String.valueOf(request.getProjectName())); |
| 157 | + return params.build(); |
| 158 | + } |
| 159 | + }) |
139 | 160 | .build(); |
140 | 161 | GrpcCallSettings<DeleteEventsRequest, DeleteEventsResponse> deleteEventsTransportSettings = |
141 | 162 | GrpcCallSettings.<DeleteEventsRequest, DeleteEventsResponse>newBuilder() |
142 | 163 | .setMethodDescriptor(deleteEventsMethodDescriptor) |
| 164 | + .setParamsExtractor( |
| 165 | + new RequestParamsExtractor<DeleteEventsRequest>() { |
| 166 | + @Override |
| 167 | + public Map<String, String> extract(DeleteEventsRequest request) { |
| 168 | + ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); |
| 169 | + params.put("project_name", String.valueOf(request.getProjectName())); |
| 170 | + return params.build(); |
| 171 | + } |
| 172 | + }) |
143 | 173 | .build(); |
144 | 174 |
|
145 | 175 | this.listGroupStatsCallable = |
|
0 commit comments