@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
UpdateSinkRequest.newBuilder() .setSinkName(sinkName == null ? null : sinkName.toString()) .setSink(sink)
UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build(); return updateSink(request);
UpdateSinkRequest.newBuilder() .setSinkName(sinkName == null ? null : sinkName.toString()) .setSink(sink)
UpdateSinkRequest.newBuilder() .setSinkName(sinkName) .setSink(sink)
@Test public void testUpdateSink() { LogSink sinkPb = SINK_INFO.toPb(PROJECT); ApiFuture<LogSink> response = ApiFutures.immediateFuture(sinkPb); UpdateSinkRequest request = UpdateSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).setSink(sinkPb).build(); EasyMock.expect(loggingRpcMock.update(request)).andReturn(response); EasyMock.replay(rpcFactoryMock, loggingRpcMock); logging = options.getService(); Sink sink = logging.update(SINK_INFO); assertEquals(new Sink(logging, new SinkInfo.BuilderImpl(SINK_INFO)), sink); }
@Test public void testUpdateSinkAsync() throws ExecutionException, InterruptedException { LogSink sinkPb = SINK_INFO.toPb(PROJECT); ApiFuture<LogSink> response = ApiFutures.immediateFuture(sinkPb); UpdateSinkRequest request = UpdateSinkRequest.newBuilder().setSinkName(SINK_NAME_PB).setSink(sinkPb).build(); EasyMock.expect(loggingRpcMock.update(request)).andReturn(response); EasyMock.replay(rpcFactoryMock, loggingRpcMock); logging = options.getService(); Sink sink = logging.updateAsync(SINK_INFO).get(); assertEquals(new Sink(logging, new SinkInfo.BuilderImpl(SINK_INFO)), sink); }
@Override public ApiFuture<Sink> updateAsync(SinkInfo sink) { UpdateSinkRequest request = UpdateSinkRequest.newBuilder() .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink.getName()).toString()) .setSink(sink.toPb(getOptions().getProjectId())) .build(); return transform(rpc.update(request), Sink.fromPbFunction(this)); }
UpdateSinkRequest.newBuilder() .setSinkName(sinkName == null ? null : sinkName.toString()) .setSink(sink)
UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build(); return updateSink(request);
UpdateSinkRequest.newBuilder() .setSinkName(sinkName == null ? null : sinkName.toString()) .setSink(sink)
UpdateSinkRequest.newBuilder() .setSinkName(sinkName) .setSink(sink)
@Override public ApiFuture<Sink> updateAsync(SinkInfo sink) { UpdateSinkRequest request = UpdateSinkRequest.newBuilder() .setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink.getName()).toString()) .setSink(sink.toPb(getOptions().getProjectId())) .build(); return transform(rpc.update(request), Sink.fromPbFunction(this)); }