Skip to content

Commit db9666b

Browse files
Regenerating spi layer - format cleanup
* Formatting using latest google-java-format (1.1) * Removing unused imports
1 parent b61af33 commit db9666b

44 files changed

Lines changed: 1726 additions & 2506 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-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java

Lines changed: 42 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,27 @@
4242
* </pre>
4343
*
4444
* <p>Note: close() needs to be called on the errorGroupServiceApi object to clean up resources such
45-
* as threads. In the example above, try-with-resources is used, which automatically calls
46-
* close().
45+
* as threads. In the example above, try-with-resources is used, which automatically calls close().
4746
*
48-
* <p>The surface of this class includes several types of Java methods for each of the API's methods:
47+
* <p>The surface of this class includes several types of Java methods for each of the API's
48+
* methods:
4949
*
5050
* <ol>
51-
* <li> A "flattened" method. With this type of method, the fields of the request type have been
52-
* converted into function parameters. It may be the case that not all fields are available
53-
* as parameters, and not every API method will have a flattened method entry point.
54-
* <li> A "request object" method. This type of method only takes one parameter, a request
55-
* object, which must be constructed before the call. Not every API method will have a request
56-
* object method.
57-
* <li> A "callable" method. This type of method takes no parameters and returns an immutable
58-
* ApiCallable object, which can be used to initiate calls to the service.
51+
* <li> A "flattened" method. With this type of method, the fields of the request type have been
52+
* converted into function parameters. It may be the case that not all fields are available as
53+
* parameters, and not every API method will have a flattened method entry point.
54+
* <li> A "request object" method. This type of method only takes one parameter, a request object,
55+
* which must be constructed before the call. Not every API method will have a request object
56+
* method.
57+
* <li> A "callable" method. This type of method takes no parameters and returns an immutable
58+
* ApiCallable object, which can be used to initiate calls to the service.
5959
* </ol>
6060
*
6161
* <p>See the individual methods for example code.
6262
*
63-
* <p>Many parameters require resource names to be formatted in a particular way. To assist
64-
* with these names, this class includes a format method for each type of name, and additionally
65-
* a parse method to extract the individual identifiers contained within names that are
66-
* returned.
63+
* <p>Many parameters require resource names to be formatted in a particular way. To assist with
64+
* these names, this class includes a format method for each type of name, and additionally a parse
65+
* method to extract the individual identifiers contained within names that are returned.
6766
*
6867
* <p>This class can be customized by passing in a custom instance of ErrorGroupServiceSettings to
6968
* create(). For example:
@@ -90,53 +89,40 @@ public class ErrorGroupServiceApi implements AutoCloseable {
9089
private static final PathTemplate GROUP_PATH_TEMPLATE =
9190
PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}");
9291

93-
/**
94-
* Formats a string containing the fully-qualified path to represent
95-
* a group resource.
96-
*/
92+
/** Formats a string containing the fully-qualified path to represent a group resource. */
9793
public static final String formatGroupName(String project, String group) {
9894
return GROUP_PATH_TEMPLATE.instantiate(
9995
"project", project,
10096
"group", group);
10197
}
10298

103-
/**
104-
* Parses the project from the given fully-qualified path which
105-
* represents a group resource.
106-
*/
99+
/** Parses the project from the given fully-qualified path which represents a group resource. */
107100
public static final String parseProjectFromGroupName(String groupName) {
108101
return GROUP_PATH_TEMPLATE.parse(groupName).get("project");
109102
}
110103

111-
/**
112-
* Parses the group from the given fully-qualified path which
113-
* represents a group resource.
114-
*/
104+
/** Parses the group from the given fully-qualified path which represents a group resource. */
115105
public static final String parseGroupFromGroupName(String groupName) {
116106
return GROUP_PATH_TEMPLATE.parse(groupName).get("group");
117107
}
118108

119-
/**
120-
* Constructs an instance of ErrorGroupServiceApi with default settings.
121-
*/
109+
/** Constructs an instance of ErrorGroupServiceApi with default settings. */
122110
public static final ErrorGroupServiceApi create() throws IOException {
123111
return create(ErrorGroupServiceSettings.defaultBuilder().build());
124112
}
125113

126114
/**
127-
* Constructs an instance of ErrorGroupServiceApi, using the given settings.
128-
* The channels are created based on the settings passed in, or defaults for any
129-
* settings that are not set.
115+
* Constructs an instance of ErrorGroupServiceApi, using the given settings. The channels are
116+
* created based on the settings passed in, or defaults for any settings that are not set.
130117
*/
131118
public static final ErrorGroupServiceApi create(ErrorGroupServiceSettings settings)
132119
throws IOException {
133120
return new ErrorGroupServiceApi(settings);
134121
}
135122

136123
/**
137-
* Constructs an instance of ErrorGroupServiceApi, using the given settings.
138-
* This is protected so that it easy to make a subclass, but otherwise, the static
139-
* factory methods should be preferred.
124+
* Constructs an instance of ErrorGroupServiceApi, using the given settings. This is protected so
125+
* that it easy to make a subclass, but otherwise, the static factory methods should be preferred.
140126
*/
141127
protected ErrorGroupServiceApi(ErrorGroupServiceSettings settings) throws IOException {
142128
this.settings = settings;
@@ -176,7 +162,8 @@ public final ErrorGroupServiceSettings getSettings() {
176162
/**
177163
* Get the specified group.
178164
*
179-
* Sample code:
165+
* <p>Sample code:
166+
*
180167
* <pre><code>
181168
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
182169
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
@@ -185,13 +172,11 @@ public final ErrorGroupServiceSettings getSettings() {
185172
* </code></pre>
186173
*
187174
* @param groupName [Required] The group resource name. Written as
188-
* &lt;code&gt;projects/&lt;var&gt;projectID&lt;/var&gt;/groups/&lt;var&gt;group_name&lt;/var&gt;&lt;/code&gt;.
189-
* Call
190-
* &lt;a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list"&gt;
191-
* &lt;code&gt;groupStats.list&lt;/code&gt;&lt;/a&gt; to return a list of groups belonging to
192-
* this project.
193-
*
194-
* Example: &lt;code&gt;projects/my-project-123/groups/my-group&lt;/code&gt;
175+
* &lt;code&gt;projects/&lt;var&gt;projectID&lt;/var&gt;/groups/&lt;var&gt;group_name&lt;/var&gt;&lt;/code&gt;.
176+
* Call &lt;a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list"&gt;
177+
* &lt;code&gt;groupStats.list&lt;/code&gt;&lt;/a&gt; to return a list of groups belonging to
178+
* this project.
179+
* <p>Example: &lt;code&gt;projects/my-project-123/groups/my-group&lt;/code&gt;
195180
* @throws com.google.api.gax.grpc.ApiException if the remote call fails
196181
*/
197182
public final ErrorGroup getGroup(String groupName) {
@@ -204,7 +189,8 @@ public final ErrorGroup getGroup(String groupName) {
204189
/**
205190
* Get the specified group.
206191
*
207-
* Sample code:
192+
* <p>Sample code:
193+
*
208194
* <pre><code>
209195
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
210196
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
@@ -226,7 +212,8 @@ private final ErrorGroup getGroup(GetGroupRequest request) {
226212
/**
227213
* Get the specified group.
228214
*
229-
* Sample code:
215+
* <p>Sample code:
216+
*
230217
* <pre><code>
231218
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
232219
* String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]");
@@ -245,10 +232,10 @@ public final ApiCallable<GetGroupRequest, ErrorGroup> getGroupCallable() {
245232

246233
// AUTO-GENERATED DOCUMENTATION AND METHOD
247234
/**
248-
* Replace the data for the specified group.
249-
* Fails if the group does not exist.
235+
* Replace the data for the specified group. Fails if the group does not exist.
236+
*
237+
* <p>Sample code:
250238
*
251-
* Sample code:
252239
* <pre><code>
253240
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
254241
* ErrorGroup group = ErrorGroup.newBuilder().build();
@@ -266,10 +253,10 @@ public final ErrorGroup updateGroup(ErrorGroup group) {
266253

267254
// AUTO-GENERATED DOCUMENTATION AND METHOD
268255
/**
269-
* Replace the data for the specified group.
270-
* Fails if the group does not exist.
256+
* Replace the data for the specified group. Fails if the group does not exist.
257+
*
258+
* <p>Sample code:
271259
*
272-
* Sample code:
273260
* <pre><code>
274261
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
275262
* ErrorGroup group = ErrorGroup.newBuilder().build();
@@ -289,10 +276,10 @@ private final ErrorGroup updateGroup(UpdateGroupRequest request) {
289276

290277
// AUTO-GENERATED DOCUMENTATION AND METHOD
291278
/**
292-
* Replace the data for the specified group.
293-
* Fails if the group does not exist.
279+
* Replace the data for the specified group. Fails if the group does not exist.
280+
*
281+
* <p>Sample code:
294282
*
295-
* Sample code:
296283
* <pre><code>
297284
* try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) {
298285
* ErrorGroup group = ErrorGroup.newBuilder().build();

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

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import com.google.api.gax.core.ConnectionSettings;
1717
import com.google.api.gax.core.RetrySettings;
1818
import com.google.api.gax.grpc.ApiCallSettings;
19-
import com.google.api.gax.grpc.PageStreamingDescriptor;
2019
import com.google.api.gax.grpc.ServiceApiSettings;
2120
import com.google.api.gax.grpc.SimpleCallSettings;
2221
import com.google.auth.Credentials;
@@ -43,15 +42,15 @@
4342
* <p>The default instance has everything set to sensible defaults:
4443
*
4544
* <ul>
46-
* <li>The default service address (clouderrorreporting.googleapis.com) and default port (443)
47-
* are used.
48-
* <li>Credentials are acquired automatically through Application Default Credentials.
49-
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
45+
* <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) are
46+
* used.
47+
* <li>Credentials are acquired automatically through Application Default Credentials.
48+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
5049
* </ul>
5150
*
52-
* <p>The builder of this class is recursive, so contained classes are themselves builders.
53-
* When build() is called, the tree of builders is called to create the complete settings
54-
* object. For example, to set the total timeout of getGroup to 30 seconds:
51+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
52+
* build() is called, the tree of builders is called to create the complete settings object. For
53+
* example, to set the total timeout of getGroup to 30 seconds:
5554
*
5655
* <pre>
5756
* <code>
@@ -65,25 +64,17 @@
6564
*/
6665
@javax.annotation.Generated("by GAPIC")
6766
public class ErrorGroupServiceSettings extends ServiceApiSettings {
68-
/**
69-
* The default address of the service.
70-
*/
67+
/** The default address of the service. */
7168
private static final String DEFAULT_SERVICE_ADDRESS = "clouderrorreporting.googleapis.com";
7269

73-
/**
74-
* The default port of the service.
75-
*/
70+
/** The default port of the service. */
7671
private static final int DEFAULT_SERVICE_PORT = 443;
7772

78-
/**
79-
* The default scopes of the service.
80-
*/
73+
/** The default scopes of the service. */
8174
private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES =
8275
ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build();
8376

84-
/**
85-
* The default connection settings of the service.
86-
*/
77+
/** The default connection settings of the service. */
8778
public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS =
8879
ConnectionSettings.newBuilder()
8980
.setServiceAddress(DEFAULT_SERVICE_ADDRESS)
@@ -94,58 +85,42 @@ public class ErrorGroupServiceSettings extends ServiceApiSettings {
9485
private final SimpleCallSettings<GetGroupRequest, ErrorGroup> getGroupSettings;
9586
private final SimpleCallSettings<UpdateGroupRequest, ErrorGroup> updateGroupSettings;
9687

97-
/**
98-
* Returns the object with the settings used for calls to getGroup.
99-
*/
88+
/** Returns the object with the settings used for calls to getGroup. */
10089
public SimpleCallSettings<GetGroupRequest, ErrorGroup> getGroupSettings() {
10190
return getGroupSettings;
10291
}
10392

104-
/**
105-
* Returns the object with the settings used for calls to updateGroup.
106-
*/
93+
/** Returns the object with the settings used for calls to updateGroup. */
10794
public SimpleCallSettings<UpdateGroupRequest, ErrorGroup> updateGroupSettings() {
10895
return updateGroupSettings;
10996
}
11097

111-
/**
112-
* Returns the default service address.
113-
*/
98+
/** Returns the default service address. */
11499
public static String getDefaultServiceAddress() {
115100
return DEFAULT_SERVICE_ADDRESS;
116101
}
117102

118-
/**
119-
* Returns the default service port.
120-
*/
103+
/** Returns the default service port. */
121104
public static int getDefaultServicePort() {
122105
return DEFAULT_SERVICE_PORT;
123106
}
124107

125-
/**
126-
* Returns the default service scopes.
127-
*/
108+
/** Returns the default service scopes. */
128109
public static ImmutableList<String> getDefaultServiceScopes() {
129110
return DEFAULT_SERVICE_SCOPES;
130111
}
131112

132-
/**
133-
* Returns a builder for this class with recommended defaults.
134-
*/
113+
/** Returns a builder for this class with recommended defaults. */
135114
public static Builder defaultBuilder() {
136115
return Builder.createDefault();
137116
}
138117

139-
/**
140-
* Returns a new builder for this class.
141-
*/
118+
/** Returns a new builder for this class. */
142119
public static Builder newBuilder() {
143120
return new Builder();
144121
}
145122

146-
/**
147-
* Returns a builder containing all the values of this settings class.
148-
*/
123+
/** Returns a builder containing all the values of this settings class. */
149124
public Builder toBuilder() {
150125
return new Builder(this);
151126
}
@@ -163,9 +138,7 @@ private ErrorGroupServiceSettings(Builder settingsBuilder) throws IOException {
163138
updateGroupSettings = settingsBuilder.updateGroupSettings().build();
164139
}
165140

166-
/**
167-
* Builder for ErrorGroupServiceSettings.
168-
*/
141+
/** Builder for ErrorGroupServiceSettings. */
169142
public static class Builder extends ServiceApiSettings.Builder {
170143
private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders;
171144

@@ -289,25 +262,20 @@ public Builder setClientLibHeader(String name, String version) {
289262
}
290263

291264
/**
292-
* Applies the given settings to all of the API methods in this service. Only
293-
* values that are non-null will be applied, so this method is not capable
294-
* of un-setting any values.
265+
* Applies the given settings to all of the API methods in this service. Only values that are
266+
* non-null will be applied, so this method is not capable of un-setting any values.
295267
*/
296268
public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception {
297269
super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings);
298270
return this;
299271
}
300272

301-
/**
302-
* Returns the builder for the settings used for calls to getGroup.
303-
*/
273+
/** Returns the builder for the settings used for calls to getGroup. */
304274
public SimpleCallSettings.Builder<GetGroupRequest, ErrorGroup> getGroupSettings() {
305275
return getGroupSettings;
306276
}
307277

308-
/**
309-
* Returns the builder for the settings used for calls to updateGroup.
310-
*/
278+
/** Returns the builder for the settings used for calls to updateGroup. */
311279
public SimpleCallSettings.Builder<UpdateGroupRequest, ErrorGroup> updateGroupSettings() {
312280
return updateGroupSettings;
313281
}

0 commit comments

Comments
 (0)