Skip to content

Commit cdbdcb5

Browse files
SPI layer: renaming Api to Client
1 parent 029224c commit cdbdcb5

80 files changed

Lines changed: 1673 additions & 1372 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google-cloud-core/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<dependency>
112112
<groupId>com.google.api</groupId>
113113
<artifactId>gax</artifactId>
114-
<version>0.0.23</version>
114+
<version>0.0.24</version>
115115
<exclusions>
116116
<exclusion>
117117
<groupId>io.grpc</groupId>
@@ -122,7 +122,7 @@
122122
<dependency>
123123
<groupId>com.google.api.grpc</groupId>
124124
<artifactId>grpc-google-common-protos</artifactId>
125-
<version>0.1.0</version>
125+
<version>0.1.3</version>
126126
<exclusions>
127127
<exclusion>
128128
<groupId>io.grpc</groupId>
@@ -133,7 +133,7 @@
133133
<dependency>
134134
<groupId>com.google.api.grpc</groupId>
135135
<artifactId>grpc-google-iam-v1</artifactId>
136-
<version>0.1.0</version>
136+
<version>0.1.3</version>
137137
<exclusions>
138138
<exclusion>
139139
<groupId>io.grpc</groupId>

google-cloud-errorreporting/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
</dependency>
3030
<dependency>
3131
<groupId>com.google.api.grpc</groupId>
32-
<artifactId>grpc-google-devtools-clouderrorreporting-v1beta1</artifactId>
33-
<version>0.1.0</version>
32+
<artifactId>grpc-google-cloud-error-reporting-v1beta1</artifactId>
33+
<version>0.1.3</version>
3434
<exclusions>
3535
<exclusion>
3636
<groupId>io.grpc</groupId>

google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java renamed to google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceClient.java

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup;
2222
import com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest;
2323
import com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest;
24+
import com.google.protobuf.ExperimentalApi;
2425
import io.grpc.ManagedChannel;
2526
import java.io.Closeable;
2627
import java.io.IOException;
2728
import java.util.ArrayList;
2829
import java.util.List;
2930
import java.util.concurrent.ScheduledExecutorService;
31+
import javax.annotation.Generated;
3032

3133
// AUTO-GENERATED DOCUMENTATION AND SERVICE
3234
/**
@@ -37,15 +39,16 @@
3739
*
3840
* <pre>
3941
* <code>
40-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
41-
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
42-
* ErrorGroup response = errorGroupServiceApi.getGroup(formattedGroupName);
42+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
43+
* String formattedGroupName = ErrorGroupServiceClient.formatGroupName("[PROJECT]", "[GROUP]");
44+
* ErrorGroup response = errorGroupServiceClient.getGroup(formattedGroupName);
4345
* }
4446
* </code>
4547
* </pre>
4648
*
47-
* <p>Note: close() needs to be called on the errorGroupServiceApi object to clean up resources such
48-
* as threads. In the example above, try-with-resources is used, which automatically calls close().
49+
* <p>Note: close() needs to be called on the errorGroupServiceClient object to clean up resources
50+
* such as threads. In the example above, try-with-resources is used, which automatically calls
51+
* close().
4952
*
5053
* <p>The surface of this class includes several types of Java methods for each of the API's
5154
* methods:
@@ -78,13 +81,14 @@
7881
* .build();
7982
* ErrorGroupServiceSettings errorGroupServiceSettings =
8083
* ErrorGroupServiceSettings.defaultBuilder().setChannelProvider(channelProvider).build();
81-
* ErrorGroupServiceApi errorGroupServiceApi =
82-
* ErrorGroupServiceApi.create(errorGroupServiceSettings);
84+
* ErrorGroupServiceClient errorGroupServiceClient =
85+
* ErrorGroupServiceClient.create(errorGroupServiceSettings);
8386
* </code>
8487
* </pre>
8588
*/
86-
@javax.annotation.Generated("by GAPIC")
87-
public class ErrorGroupServiceApi implements AutoCloseable {
89+
@Generated("by GAPIC")
90+
@ExperimentalApi
91+
public class ErrorGroupServiceClient implements AutoCloseable {
8892
private final ErrorGroupServiceSettings settings;
8993
private final ScheduledExecutorService executor;
9094
private final ManagedChannel channel;
@@ -113,25 +117,26 @@ public static final String parseGroupFromGroupName(String groupName) {
113117
return GROUP_PATH_TEMPLATE.parse(groupName).get("group");
114118
}
115119

116-
/** Constructs an instance of ErrorGroupServiceApi with default settings. */
117-
public static final ErrorGroupServiceApi create() throws IOException {
120+
/** Constructs an instance of ErrorGroupServiceClient with default settings. */
121+
public static final ErrorGroupServiceClient create() throws IOException {
118122
return create(ErrorGroupServiceSettings.defaultBuilder().build());
119123
}
120124

121125
/**
122-
* Constructs an instance of ErrorGroupServiceApi, using the given settings. The channels are
126+
* Constructs an instance of ErrorGroupServiceClient, using the given settings. The channels are
123127
* created based on the settings passed in, or defaults for any settings that are not set.
124128
*/
125-
public static final ErrorGroupServiceApi create(ErrorGroupServiceSettings settings)
129+
public static final ErrorGroupServiceClient create(ErrorGroupServiceSettings settings)
126130
throws IOException {
127-
return new ErrorGroupServiceApi(settings);
131+
return new ErrorGroupServiceClient(settings);
128132
}
129133

130134
/**
131-
* Constructs an instance of ErrorGroupServiceApi, using the given settings. This is protected so
132-
* that it easy to make a subclass, but otherwise, the static factory methods should be preferred.
135+
* Constructs an instance of ErrorGroupServiceClient, using the given settings. This is protected
136+
* so that it easy to make a subclass, but otherwise, the static factory methods should be
137+
* preferred.
133138
*/
134-
protected ErrorGroupServiceApi(ErrorGroupServiceSettings settings) throws IOException {
139+
protected ErrorGroupServiceClient(ErrorGroupServiceSettings settings) throws IOException {
135140
this.settings = settings;
136141
ChannelAndExecutor channelAndExecutor = settings.getChannelAndExecutor();
137142
this.executor = channelAndExecutor.getExecutor();
@@ -173,9 +178,9 @@ public final ErrorGroupServiceSettings getSettings() {
173178
* <p>Sample code:
174179
*
175180
* <pre><code>
176-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
177-
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
178-
* ErrorGroup response = errorGroupServiceApi.getGroup(formattedGroupName);
181+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
182+
* String formattedGroupName = ErrorGroupServiceClient.formatGroupName("[PROJECT]", "[GROUP]");
183+
* ErrorGroup response = errorGroupServiceClient.getGroup(formattedGroupName);
179184
* }
180185
* </code></pre>
181186
*
@@ -200,12 +205,12 @@ public final ErrorGroup getGroup(String groupName) {
200205
* <p>Sample code:
201206
*
202207
* <pre><code>
203-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
204-
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
208+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
209+
* String formattedGroupName = ErrorGroupServiceClient.formatGroupName("[PROJECT]", "[GROUP]");
205210
* GetGroupRequest request = GetGroupRequest.newBuilder()
206211
* .setGroupName(formattedGroupName)
207212
* .build();
208-
* ErrorGroup response = errorGroupServiceApi.getGroup(request);
213+
* ErrorGroup response = errorGroupServiceClient.getGroup(request);
209214
* }
210215
* </code></pre>
211216
*
@@ -223,12 +228,12 @@ private final ErrorGroup getGroup(GetGroupRequest request) {
223228
* <p>Sample code:
224229
*
225230
* <pre><code>
226-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
227-
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
231+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
232+
* String formattedGroupName = ErrorGroupServiceClient.formatGroupName("[PROJECT]", "[GROUP]");
228233
* GetGroupRequest request = GetGroupRequest.newBuilder()
229234
* .setGroupName(formattedGroupName)
230235
* .build();
231-
* ListenableFuture&lt;ErrorGroup&gt; future = errorGroupServiceApi.getGroupCallable().futureCall(request);
236+
* ListenableFuture&lt;ErrorGroup&gt; future = errorGroupServiceClient.getGroupCallable().futureCall(request);
232237
* // Do something
233238
* ErrorGroup response = future.get();
234239
* }
@@ -245,9 +250,9 @@ public final UnaryCallable<GetGroupRequest, ErrorGroup> getGroupCallable() {
245250
* <p>Sample code:
246251
*
247252
* <pre><code>
248-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
253+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
249254
* ErrorGroup group = ErrorGroup.newBuilder().build();
250-
* ErrorGroup response = errorGroupServiceApi.updateGroup(group);
255+
* ErrorGroup response = errorGroupServiceClient.updateGroup(group);
251256
* }
252257
* </code></pre>
253258
*
@@ -267,12 +272,12 @@ public final ErrorGroup updateGroup(ErrorGroup group) {
267272
* <p>Sample code:
268273
*
269274
* <pre><code>
270-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
275+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
271276
* ErrorGroup group = ErrorGroup.newBuilder().build();
272277
* UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
273278
* .setGroup(group)
274279
* .build();
275-
* ErrorGroup response = errorGroupServiceApi.updateGroup(request);
280+
* ErrorGroup response = errorGroupServiceClient.updateGroup(request);
276281
* }
277282
* </code></pre>
278283
*
@@ -290,12 +295,12 @@ private final ErrorGroup updateGroup(UpdateGroupRequest request) {
290295
* <p>Sample code:
291296
*
292297
* <pre><code>
293-
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
298+
* try (ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient.create()) {
294299
* ErrorGroup group = ErrorGroup.newBuilder().build();
295300
* UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
296301
* .setGroup(group)
297302
* .build();
298-
* ListenableFuture&lt;ErrorGroup&gt; future = errorGroupServiceApi.updateGroupCallable().futureCall(request);
303+
* ListenableFuture&lt;ErrorGroup&gt; future = errorGroupServiceClient.updateGroupCallable().futureCall(request);
299304
* // Do something
300305
* ErrorGroup response = future.get();
301306
* }

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import com.google.api.gax.core.GoogleCredentialsProvider;
1919
import com.google.api.gax.core.RetrySettings;
2020
import com.google.api.gax.grpc.ChannelProvider;
21+
import com.google.api.gax.grpc.ClientSettings;
2122
import com.google.api.gax.grpc.ExecutorProvider;
2223
import com.google.api.gax.grpc.InstantiatingChannelProvider;
2324
import com.google.api.gax.grpc.InstantiatingExecutorProvider;
24-
import com.google.api.gax.grpc.ServiceApiSettings;
2525
import com.google.api.gax.grpc.SimpleCallSettings;
2626
import com.google.api.gax.grpc.UnaryCallSettings;
2727
import com.google.common.collect.ImmutableList;
@@ -33,13 +33,15 @@
3333
import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroupServiceGrpc;
3434
import com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest;
3535
import com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest;
36+
import com.google.protobuf.ExperimentalApi;
3637
import io.grpc.Status;
3738
import java.io.IOException;
39+
import javax.annotation.Generated;
3840
import org.joda.time.Duration;
3941

4042
// AUTO-GENERATED DOCUMENTATION AND CLASS
4143
/**
42-
* Settings class to configure an instance of {@link ErrorGroupServiceApi}.
44+
* Settings class to configure an instance of {@link ErrorGroupServiceClient}.
4345
*
4446
* <p>The default instance has everything set to sensible defaults:
4547
*
@@ -64,8 +66,9 @@
6466
* </code>
6567
* </pre>
6668
*/
67-
@javax.annotation.Generated("by GAPIC")
68-
public class ErrorGroupServiceSettings extends ServiceApiSettings {
69+
@Generated("by GAPIC")
70+
@ExperimentalApi
71+
public class ErrorGroupServiceSettings extends ClientSettings {
6972
/** The default address of the service. */
7073
private static final String DEFAULT_SERVICE_ADDRESS = "clouderrorreporting.googleapis.com";
7174

@@ -145,7 +148,7 @@ private ErrorGroupServiceSettings(Builder settingsBuilder) throws IOException {
145148
}
146149

147150
/** Builder for ErrorGroupServiceSettings. */
148-
public static class Builder extends ServiceApiSettings.Builder {
151+
public static class Builder extends ClientSettings.Builder {
149152
private final ImmutableList<UnaryCallSettings.Builder> unaryMethodSettingsBuilders;
150153

151154
private final SimpleCallSettings.Builder<GetGroupRequest, ErrorGroup> getGroupSettings;
@@ -238,9 +241,9 @@ public Builder setChannelProvider(ChannelProvider channelProvider) {
238241
*
239242
* <p>Note: This method does not support applying settings to streaming methods.
240243
*/
241-
public Builder applyToAllApiMethods(UnaryCallSettings.Builder apiCallSettings)
244+
public Builder applyToAllUnaryMethods(UnaryCallSettings.Builder unaryCallSettings)
242245
throws Exception {
243-
super.applyToAllApiMethods(unaryMethodSettingsBuilders, apiCallSettings);
246+
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, unaryCallSettings);
244247
return this;
245248
}
246249

0 commit comments

Comments
 (0)