diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java index 8c9ff4b4004c..fecd24c11af0 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceApi.java @@ -42,28 +42,27 @@ * </pre> * * <p>Note: close() needs to be called on the errorGroupServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of ErrorGroupServiceSettings to * create(). For example: @@ -90,43 +89,31 @@ public class ErrorGroupServiceApi implements AutoCloseable { private static final PathTemplate GROUP_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}"); - /** - * Formats a string containing the fully-qualified path to represent - * a group resource. - */ + /** Formats a string containing the fully-qualified path to represent a group resource. */ public static final String formatGroupName(String project, String group) { return GROUP_PATH_TEMPLATE.instantiate( "project", project, "group", group); } - /** - * Parses the project from the given fully-qualified path which - * represents a group resource. - */ + /** Parses the project from the given fully-qualified path which represents a group resource. */ public static final String parseProjectFromGroupName(String groupName) { return GROUP_PATH_TEMPLATE.parse(groupName).get("project"); } - /** - * Parses the group from the given fully-qualified path which - * represents a group resource. - */ + /** Parses the group from the given fully-qualified path which represents a group resource. */ public static final String parseGroupFromGroupName(String groupName) { return GROUP_PATH_TEMPLATE.parse(groupName).get("group"); } - /** - * Constructs an instance of ErrorGroupServiceApi with default settings. - */ + /** Constructs an instance of ErrorGroupServiceApi with default settings. */ public static final ErrorGroupServiceApi create() throws IOException { return create(ErrorGroupServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of ErrorGroupServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of ErrorGroupServiceApi, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final ErrorGroupServiceApi create(ErrorGroupServiceSettings settings) throws IOException { @@ -134,9 +121,8 @@ public static final ErrorGroupServiceApi create(ErrorGroupServiceSettings settin } /** - * Constructs an instance of ErrorGroupServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of ErrorGroupServiceApi, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected ErrorGroupServiceApi(ErrorGroupServiceSettings settings) throws IOException { this.settings = settings; @@ -176,7 +162,8 @@ public final ErrorGroupServiceSettings getSettings() { /** * Get the specified group. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { * String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -185,13 +172,11 @@ public final ErrorGroupServiceSettings getSettings() { * </code></pre> * * @param groupName [Required] The group resource name. Written as - * <code>projects/<var>projectID</var>/groups/<var>group_name</var></code>. - * Call - * <a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list"> - * <code>groupStats.list</code></a> to return a list of groups belonging to - * this project. - * - * Example: <code>projects/my-project-123/groups/my-group</code> + * <code>projects/<var>projectID</var>/groups/<var>group_name</var></code>. + * Call <a href="/error-reporting/reference/rest/v1beta1/projects.groupStats/list"> + * <code>groupStats.list</code></a> to return a list of groups belonging to + * this project. + * <p>Example: <code>projects/my-project-123/groups/my-group</code> * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final ErrorGroup getGroup(String groupName) { @@ -204,7 +189,8 @@ public final ErrorGroup getGroup(String groupName) { /** * Get the specified group. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { * String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -226,7 +212,8 @@ private final ErrorGroup getGroup(GetGroupRequest request) { /** * Get the specified group. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { * String formattedGroupName = ErrorGroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -245,10 +232,10 @@ public final ApiCallable<GetGroupRequest, ErrorGroup> getGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Replace the data for the specified group. - * Fails if the group does not exist. + * Replace the data for the specified group. Fails if the group does not exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { * ErrorGroup group = ErrorGroup.newBuilder().build(); @@ -266,10 +253,10 @@ public final ErrorGroup updateGroup(ErrorGroup group) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Replace the data for the specified group. - * Fails if the group does not exist. + * Replace the data for the specified group. Fails if the group does not exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { * ErrorGroup group = ErrorGroup.newBuilder().build(); @@ -289,10 +276,10 @@ private final ErrorGroup updateGroup(UpdateGroupRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Replace the data for the specified group. - * Fails if the group does not exist. + * Replace the data for the specified group. Fails if the group does not exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { * ErrorGroup group = ErrorGroup.newBuilder().build(); diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java index f591c034ca78..4dc8bbeae7f1 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceSettings.java @@ -16,7 +16,6 @@ import com.google.api.gax.core.ConnectionSettings; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; -import com.google.api.gax.grpc.PageStreamingDescriptor; import com.google.api.gax.grpc.ServiceApiSettings; import com.google.api.gax.grpc.SimpleCallSettings; import com.google.auth.Credentials; @@ -43,15 +42,15 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) are + * used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getGroup to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getGroup to 30 seconds: * * <pre> * <code> @@ -65,25 +64,17 @@ */ @javax.annotation.Generated("by GAPIC") public class ErrorGroupServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "clouderrorreporting.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -94,58 +85,42 @@ public class ErrorGroupServiceSettings extends ServiceApiSettings { private final SimpleCallSettings<GetGroupRequest, ErrorGroup> getGroupSettings; private final SimpleCallSettings<UpdateGroupRequest, ErrorGroup> updateGroupSettings; - /** - * Returns the object with the settings used for calls to getGroup. - */ + /** Returns the object with the settings used for calls to getGroup. */ public SimpleCallSettings<GetGroupRequest, ErrorGroup> getGroupSettings() { return getGroupSettings; } - /** - * Returns the object with the settings used for calls to updateGroup. - */ + /** Returns the object with the settings used for calls to updateGroup. */ public SimpleCallSettings<UpdateGroupRequest, ErrorGroup> updateGroupSettings() { return updateGroupSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -163,9 +138,7 @@ private ErrorGroupServiceSettings(Builder settingsBuilder) throws IOException { updateGroupSettings = settingsBuilder.updateGroupSettings().build(); } - /** - * Builder for ErrorGroupServiceSettings. - */ + /** Builder for ErrorGroupServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -289,25 +262,20 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to getGroup. - */ + /** Returns the builder for the settings used for calls to getGroup. */ public SimpleCallSettings.Builder<GetGroupRequest, ErrorGroup> getGroupSettings() { return getGroupSettings; } - /** - * Returns the builder for the settings used for calls to updateGroup. - */ + /** Returns the builder for the settings used for calls to updateGroup. */ public SimpleCallSettings.Builder<UpdateGroupRequest, ErrorGroup> updateGroupSettings() { return updateGroupSettings; } diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceApi.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceApi.java index c2a79541d076..f333c555e500 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceApi.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceApi.java @@ -50,28 +50,27 @@ * </pre> * * <p>Note: close() needs to be called on the errorStatsServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of ErrorStatsServiceSettings to * create(). For example: @@ -106,33 +105,24 @@ public class ErrorStatsServiceApi implements AutoCloseable { private static final PathTemplate PROJECT_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } - /** - * Constructs an instance of ErrorStatsServiceApi with default settings. - */ + /** Constructs an instance of ErrorStatsServiceApi with default settings. */ public static final ErrorStatsServiceApi create() throws IOException { return create(ErrorStatsServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of ErrorStatsServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of ErrorStatsServiceApi, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final ErrorStatsServiceApi create(ErrorStatsServiceSettings settings) throws IOException { @@ -140,9 +130,8 @@ public static final ErrorStatsServiceApi create(ErrorStatsServiceSettings settin } /** - * Constructs an instance of ErrorStatsServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of ErrorStatsServiceApi, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected ErrorStatsServiceApi(ErrorStatsServiceSettings settings) throws IOException { this.settings = settings; @@ -189,7 +178,8 @@ public final ErrorStatsServiceSettings getSettings() { /** * Lists the specified groups. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -201,15 +191,13 @@ public final ErrorStatsServiceSettings getSettings() { * </code></pre> * * @param projectName [Required] The resource name of the Google Cloud Platform project. Written - * as <code>projects/</code> plus the - * <a href="https://support.google.com/cloud/answer/6158840">Google Cloud - * Platform project ID</a>. - * - * Example: <code>projects/my-project-123</code>. - * @param timeRange [Required] List data for the given time range. - * The service is tuned for retrieving data up to (approximately) 'now'. - * Retrieving data for arbitrary time periods in the past can result in - * higher response times or in returning incomplete results. + * as <code>projects/</code> plus the <a + * href="https://support.google.com/cloud/answer/6158840">Google Cloud Platform project + * ID</a>. + * <p>Example: <code>projects/my-project-123</code>. + * @param timeRange [Required] List data for the given time range. The service is tuned for + * retrieving data up to (approximately) 'now'. Retrieving data for arbitrary time periods in + * the past can result in higher response times or in returning incomplete results. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse<ListGroupStatsRequest, ListGroupStatsResponse, ErrorGroupStats> @@ -227,7 +215,8 @@ public final ErrorStatsServiceSettings getSettings() { /** * Lists the specified groups. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -254,7 +243,8 @@ public final ErrorStatsServiceSettings getSettings() { /** * Lists the specified groups. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -282,7 +272,8 @@ public final ErrorStatsServiceSettings getSettings() { /** * Lists the specified groups. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -314,7 +305,8 @@ public final ApiCallable<ListGroupStatsRequest, ListGroupStatsResponse> listGrou /** * Lists the specified events. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -326,9 +318,8 @@ public final ApiCallable<ListGroupStatsRequest, ListGroupStatsResponse> listGrou * </code></pre> * * @param projectName [Required] The resource name of the Google Cloud Platform project. Written - * as `projects/` plus the - * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). - * Example: `projects/my-project-123`. + * as `projects/` plus the [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. * @param groupId [Required] The group for which events shall be returned. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -344,7 +335,8 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent /** * Lists the specified events. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -371,7 +363,8 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent /** * Lists the specified events. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -398,7 +391,8 @@ public final PagedListResponse<ListEventsRequest, ListEventsResponse, ErrorEvent /** * Lists the specified events. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -430,7 +424,8 @@ public final ApiCallable<ListEventsRequest, ListEventsResponse> listEventsCallab /** * Deletes all error events of a given project. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -439,9 +434,8 @@ public final ApiCallable<ListEventsRequest, ListEventsResponse> listEventsCallab * </code></pre> * * @param projectName [Required] The resource name of the Google Cloud Platform project. Written - * as `projects/` plus the - * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). - * Example: `projects/my-project-123`. + * as `projects/` plus the [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final DeleteEventsResponse deleteEvents(String projectName) { @@ -455,7 +449,8 @@ public final DeleteEventsResponse deleteEvents(String projectName) { /** * Deletes all error events of a given project. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); @@ -477,7 +472,8 @@ private final DeleteEventsResponse deleteEvents(DeleteEventsRequest request) { /** * Deletes all error events of a given project. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { * String formattedProjectName = ErrorStatsServiceApi.formatProjectName("[PROJECT]"); diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java index e04773777a7a..b34dde3f867b 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorStatsServiceSettings.java @@ -14,7 +14,6 @@ package com.google.cloud.errorreporting.spi.v1beta1; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -50,15 +49,15 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) are + * used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteEvents to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteEvents to 30 seconds: * * <pre> * <code> @@ -72,25 +71,17 @@ */ @javax.annotation.Generated("by GAPIC") public class ErrorStatsServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "clouderrorreporting.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -105,67 +96,49 @@ public class ErrorStatsServiceSettings extends ServiceApiSettings { listEventsSettings; private final SimpleCallSettings<DeleteEventsRequest, DeleteEventsResponse> deleteEventsSettings; - /** - * Returns the object with the settings used for calls to listGroupStats. - */ + /** Returns the object with the settings used for calls to listGroupStats. */ public PageStreamingCallSettings<ListGroupStatsRequest, ListGroupStatsResponse, ErrorGroupStats> listGroupStatsSettings() { return listGroupStatsSettings; } - /** - * Returns the object with the settings used for calls to listEvents. - */ + /** Returns the object with the settings used for calls to listEvents. */ public PageStreamingCallSettings<ListEventsRequest, ListEventsResponse, ErrorEvent> listEventsSettings() { return listEventsSettings; } - /** - * Returns the object with the settings used for calls to deleteEvents. - */ + /** Returns the object with the settings used for calls to deleteEvents. */ public SimpleCallSettings<DeleteEventsRequest, DeleteEventsResponse> deleteEventsSettings() { return deleteEventsSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -255,9 +228,7 @@ public Iterable<ErrorEvent> extractResources(ListEventsResponse payload) { } }; - /** - * Builder for ErrorStatsServiceSettings. - */ + /** Builder for ErrorStatsServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -401,35 +372,28 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to listGroupStats. - */ + /** Returns the builder for the settings used for calls to listGroupStats. */ public PageStreamingCallSettings.Builder< ListGroupStatsRequest, ListGroupStatsResponse, ErrorGroupStats> listGroupStatsSettings() { return listGroupStatsSettings; } - /** - * Returns the builder for the settings used for calls to listEvents. - */ + /** Returns the builder for the settings used for calls to listEvents. */ public PageStreamingCallSettings.Builder<ListEventsRequest, ListEventsResponse, ErrorEvent> listEventsSettings() { return listEventsSettings; } - /** - * Returns the builder for the settings used for calls to deleteEvents. - */ + /** Returns the builder for the settings used for calls to deleteEvents. */ public SimpleCallSettings.Builder<DeleteEventsRequest, DeleteEventsResponse> deleteEventsSettings() { return deleteEventsSettings; diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceApi.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceApi.java index 8ecedcb0205c..cdd5714e093e 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceApi.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceApi.java @@ -42,29 +42,29 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the reportErrorsServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls + * <p>Note: close() needs to be called on the reportErrorsServiceApi object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of ReportErrorsServiceSettings to * create(). For example: @@ -91,33 +91,24 @@ public class ReportErrorsServiceApi implements AutoCloseable { private static final PathTemplate PROJECT_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } - /** - * Constructs an instance of ReportErrorsServiceApi with default settings. - */ + /** Constructs an instance of ReportErrorsServiceApi with default settings. */ public static final ReportErrorsServiceApi create() throws IOException { return create(ReportErrorsServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of ReportErrorsServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of ReportErrorsServiceApi, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final ReportErrorsServiceApi create(ReportErrorsServiceSettings settings) throws IOException { @@ -125,9 +116,9 @@ public static final ReportErrorsServiceApi create(ReportErrorsServiceSettings se } /** - * Constructs an instance of ReportErrorsServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of ReportErrorsServiceApi, using the given settings. This is protected + * so that it easy to make a subclass, but otherwise, the static factory methods should be + * preferred. */ protected ReportErrorsServiceApi(ReportErrorsServiceSettings settings) throws IOException { this.settings = settings; @@ -165,14 +156,15 @@ public final ReportErrorsServiceSettings getSettings() { /** * Report an individual error event. * - * This endpoint accepts <strong>either</strong> an OAuth token, - * <strong>or</strong> an - * <a href="https://support.google.com/cloud/answer/6158862">API key</a> - * for authentication. To use an API key, append it to the URL as the value of - * a `key` parameter. For example: - * <pre>POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre> + * <p>This endpoint accepts <strong>either</strong> an OAuth token, + * <strong>or</strong> an <a + * href="https://support.google.com/cloud/answer/6158862">API key</a> for authentication. + * To use an API key, append it to the URL as the value of a `key` parameter. For example: + * <pre>POST + * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre> + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (ReportErrorsServiceApi reportErrorsServiceApi = ReportErrorsServiceApi.create()) { * String formattedProjectName = ReportErrorsServiceApi.formatProjectName("[PROJECT]"); @@ -182,9 +174,8 @@ public final ReportErrorsServiceSettings getSettings() { * </code></pre> * * @param projectName [Required] The resource name of the Google Cloud Platform project. Written - * as `projects/` plus the - * [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). - * Example: `projects/my-project-123`. + * as `projects/` plus the [Google Cloud Platform project + * ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. * @param event [Required] The error event to be reported. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -200,14 +191,15 @@ public final ReportErrorEventResponse reportErrorEvent( /** * Report an individual error event. * - * This endpoint accepts <strong>either</strong> an OAuth token, - * <strong>or</strong> an - * <a href="https://support.google.com/cloud/answer/6158862">API key</a> - * for authentication. To use an API key, append it to the URL as the value of - * a `key` parameter. For example: - * <pre>POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre> + * <p>This endpoint accepts <strong>either</strong> an OAuth token, + * <strong>or</strong> an <a + * href="https://support.google.com/cloud/answer/6158862">API key</a> for authentication. + * To use an API key, append it to the URL as the value of a `key` parameter. For example: + * <pre>POST + * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre> + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (ReportErrorsServiceApi reportErrorsServiceApi = ReportErrorsServiceApi.create()) { * String formattedProjectName = ReportErrorsServiceApi.formatProjectName("[PROJECT]"); @@ -231,14 +223,15 @@ public final ReportErrorEventResponse reportErrorEvent(ReportErrorEventRequest r /** * Report an individual error event. * - * This endpoint accepts <strong>either</strong> an OAuth token, - * <strong>or</strong> an - * <a href="https://support.google.com/cloud/answer/6158862">API key</a> - * for authentication. To use an API key, append it to the URL as the value of - * a `key` parameter. For example: - * <pre>POST https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre> + * <p>This endpoint accepts <strong>either</strong> an OAuth token, + * <strong>or</strong> an <a + * href="https://support.google.com/cloud/answer/6158862">API key</a> for authentication. + * To use an API key, append it to the URL as the value of a `key` parameter. For example: + * <pre>POST + * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456</pre> + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (ReportErrorsServiceApi reportErrorsServiceApi = ReportErrorsServiceApi.create()) { * String formattedProjectName = ReportErrorsServiceApi.formatProjectName("[PROJECT]"); diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java index a61c66655385..a4b390017c31 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceSettings.java @@ -16,7 +16,6 @@ import com.google.api.gax.core.ConnectionSettings; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; -import com.google.api.gax.grpc.PageStreamingDescriptor; import com.google.api.gax.grpc.ServiceApiSettings; import com.google.api.gax.grpc.SimpleCallSettings; import com.google.auth.Credentials; @@ -42,15 +41,15 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (clouderrorreporting.googleapis.com) and default port (443) are + * used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of reportErrorEvent to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of reportErrorEvent to 30 seconds: * * <pre> * <code> @@ -64,25 +63,17 @@ */ @javax.annotation.Generated("by GAPIC") public class ReportErrorsServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "clouderrorreporting.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -93,52 +84,38 @@ public class ReportErrorsServiceSettings extends ServiceApiSettings { private final SimpleCallSettings<ReportErrorEventRequest, ReportErrorEventResponse> reportErrorEventSettings; - /** - * Returns the object with the settings used for calls to reportErrorEvent. - */ + /** Returns the object with the settings used for calls to reportErrorEvent. */ public SimpleCallSettings<ReportErrorEventRequest, ReportErrorEventResponse> reportErrorEventSettings() { return reportErrorEventSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -155,9 +132,7 @@ private ReportErrorsServiceSettings(Builder settingsBuilder) throws IOException reportErrorEventSettings = settingsBuilder.reportErrorEventSettings().build(); } - /** - * Builder for ReportErrorsServiceSettings. - */ + /** Builder for ReportErrorsServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -271,18 +246,15 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to reportErrorEvent. - */ + /** Returns the builder for the settings used for calls to reportErrorEvent. */ public SimpleCallSettings.Builder<ReportErrorEventRequest, ReportErrorEventResponse> reportErrorEventSettings() { return reportErrorEventSettings; diff --git a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java index 84d05a4d0496..15a1f4bf3564 100644 --- a/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java +++ b/google-cloud-errorreporting/src/main/java/com/google/cloud/errorreporting/spi/v1beta1/package-info.java @@ -15,15 +15,14 @@ /** * A client to Stackdriver Error Reporting API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * ==================== - * ErrorGroupServiceApi - * ==================== + * <p>==================== ErrorGroupServiceApi ==================== * - * Service Description: Service for retrieving and updating individual error groups. + * <p>Service Description: Service for retrieving and updating individual error groups. + * + * <p>Sample for ErrorGroupServiceApi: * - * Sample for ErrorGroupServiceApi: * <pre> * <code> * try (ErrorGroupServiceApi errorGroupServiceApi = ErrorGroupServiceApi.create()) { @@ -33,14 +32,13 @@ * </code> * </pre> * - * ==================== - * ErrorStatsServiceApi - * ==================== + * ==================== ErrorStatsServiceApi ==================== * - * Service Description: An API for retrieving and managing error statistics as well as data for + * <p>Service Description: An API for retrieving and managing error statistics as well as data for * individual events. * - * Sample for ErrorStatsServiceApi: + * <p>Sample for ErrorStatsServiceApi: + * * <pre> * <code> * try (ErrorStatsServiceApi errorStatsServiceApi = ErrorStatsServiceApi.create()) { @@ -50,13 +48,12 @@ * </code> * </pre> * - * ====================== - * ReportErrorsServiceApi - * ====================== + * ====================== ReportErrorsServiceApi ====================== * - * Service Description: An API for reporting error events. + * <p>Service Description: An API for reporting error events. + * + * <p>Sample for ReportErrorsServiceApi: * - * Sample for ReportErrorsServiceApi: * <pre> * <code> * try (ReportErrorsServiceApi reportErrorsServiceApi = ReportErrorsServiceApi.create()) { @@ -66,6 +63,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.errorreporting.spi.v1beta1; diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceTest.java index 7ef1423e0800..1a176a4adfa6 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceTest.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ErrorGroupServiceTest.java @@ -14,10 +14,8 @@ package com.google.cloud.errorreporting.spi.v1beta1; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.testing.MockGrpcService; import com.google.api.gax.testing.MockServiceHelper; -import com.google.common.collect.Lists; import com.google.devtools.clouderrorreporting.v1beta1.ErrorGroup; import com.google.devtools.clouderrorreporting.v1beta1.GetGroupRequest; import com.google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest; diff --git a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceTest.java b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceTest.java index ff909ae74914..5149d16a357c 100644 --- a/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceTest.java +++ b/google-cloud-errorreporting/src/test/java/com/google/cloud/errorreporting/spi/v1beta1/ReportErrorsServiceTest.java @@ -14,10 +14,8 @@ package com.google.cloud.errorreporting.spi.v1beta1; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.testing.MockGrpcService; import com.google.api.gax.testing.MockServiceHelper; -import com.google.common.collect.Lists; import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventRequest; import com.google.devtools.clouderrorreporting.v1beta1.ReportErrorEventResponse; import com.google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent; diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceApi.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceApi.java index d47133cf5af3..1f663b9929f6 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceApi.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceApi.java @@ -14,7 +14,6 @@ package com.google.cloud.language.spi.v1beta1; import com.google.api.gax.grpc.ApiCallable; -import com.google.api.gax.protobuf.PathTemplate; import com.google.cloud.language.v1beta1.AnalyzeEntitiesRequest; import com.google.cloud.language.v1beta1.AnalyzeEntitiesResponse; import com.google.cloud.language.v1beta1.AnalyzeSentimentRequest; @@ -49,28 +48,27 @@ * </pre> * * <p>Note: close() needs to be called on the languageServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of LanguageServiceSettings to * create(). For example: @@ -97,17 +95,14 @@ public class LanguageServiceApi implements AutoCloseable { analyzeEntitiesCallable; private final ApiCallable<AnnotateTextRequest, AnnotateTextResponse> annotateTextCallable; - /** - * Constructs an instance of LanguageServiceApi with default settings. - */ + /** Constructs an instance of LanguageServiceApi with default settings. */ public static final LanguageServiceApi create() throws IOException { return create(LanguageServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of LanguageServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of LanguageServiceApi, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final LanguageServiceApi create(LanguageServiceSettings settings) throws IOException { @@ -115,9 +110,8 @@ public static final LanguageServiceApi create(LanguageServiceSettings settings) } /** - * Constructs an instance of LanguageServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of LanguageServiceApi, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected LanguageServiceApi(LanguageServiceSettings settings) throws IOException { this.settings = settings; @@ -159,7 +153,8 @@ public final LanguageServiceSettings getSettings() { /** * Analyzes the sentiment of the provided text. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -168,7 +163,7 @@ public final LanguageServiceSettings getSettings() { * </code></pre> * * @param document Input document. Currently, `analyzeSentiment` only supports English text - * ([Document.language][google.cloud.language.v1beta1.Document.language]="EN"). + * ([Document.language][google.cloud.language.v1beta1.Document.language]="EN"). * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final AnalyzeSentimentResponse analyzeSentiment(Document document) { @@ -181,7 +176,8 @@ public final AnalyzeSentimentResponse analyzeSentiment(Document document) { /** * Analyzes the sentiment of the provided text. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -203,7 +199,8 @@ private final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest /** * Analyzes the sentiment of the provided text. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -223,10 +220,11 @@ private final AnalyzeSentimentResponse analyzeSentiment(AnalyzeSentimentRequest // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Finds named entities (currently finds proper names) in the text, - * entity types, salience, mentions for each entity, and other properties. + * Finds named entities (currently finds proper names) in the text, entity types, salience, + * mentions for each entity, and other properties. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -251,10 +249,11 @@ public final AnalyzeEntitiesResponse analyzeEntities( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Finds named entities (currently finds proper names) in the text, - * entity types, salience, mentions for each entity, and other properties. + * Finds named entities (currently finds proper names) in the text, entity types, salience, + * mentions for each entity, and other properties. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -276,10 +275,11 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Finds named entities (currently finds proper names) in the text, - * entity types, salience, mentions for each entity, and other properties. + * Finds named entities (currently finds proper names) in the text, entity types, salience, + * mentions for each entity, and other properties. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -301,12 +301,12 @@ public final AnalyzeEntitiesResponse analyzeEntities(AnalyzeEntitiesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Advanced API that analyzes the document and provides a full set of text - * annotations, including semantic, syntactic, and sentiment information. This - * API is intended for users who are familiar with machine learning and need - * in-depth text features to build upon. + * Advanced API that analyzes the document and provides a full set of text annotations, including + * semantic, syntactic, and sentiment information. This API is intended for users who are familiar + * with machine learning and need in-depth text features to build upon. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -334,12 +334,12 @@ public final AnnotateTextResponse annotateText( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Advanced API that analyzes the document and provides a full set of text - * annotations, including semantic, syntactic, and sentiment information. This - * API is intended for users who are familiar with machine learning and need - * in-depth text features to build upon. + * Advanced API that analyzes the document and provides a full set of text annotations, including + * semantic, syntactic, and sentiment information. This API is intended for users who are familiar + * with machine learning and need in-depth text features to build upon. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); @@ -363,12 +363,12 @@ public final AnnotateTextResponse annotateText(AnnotateTextRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Advanced API that analyzes the document and provides a full set of text - * annotations, including semantic, syntactic, and sentiment information. This - * API is intended for users who are familiar with machine learning and need - * in-depth text features to build upon. + * Advanced API that analyzes the document and provides a full set of text annotations, including + * semantic, syntactic, and sentiment information. This API is intended for users who are familiar + * with machine learning and need in-depth text features to build upon. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { * Document document = Document.newBuilder().build(); diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceSettings.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceSettings.java index de0a26308a09..394c2a7add5e 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceSettings.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/LanguageServiceSettings.java @@ -16,7 +16,6 @@ import com.google.api.gax.core.ConnectionSettings; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; -import com.google.api.gax.grpc.PageStreamingDescriptor; import com.google.api.gax.grpc.ServiceApiSettings; import com.google.api.gax.grpc.SimpleCallSettings; import com.google.auth.Credentials; @@ -46,15 +45,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (language.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (language.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of analyzeSentiment to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of analyzeSentiment to 30 seconds: * * <pre> * <code> @@ -68,25 +66,17 @@ */ @javax.annotation.Generated("by GAPIC") public class LanguageServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "language.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -100,67 +90,49 @@ public class LanguageServiceSettings extends ServiceApiSettings { analyzeEntitiesSettings; private final SimpleCallSettings<AnnotateTextRequest, AnnotateTextResponse> annotateTextSettings; - /** - * Returns the object with the settings used for calls to analyzeSentiment. - */ + /** Returns the object with the settings used for calls to analyzeSentiment. */ public SimpleCallSettings<AnalyzeSentimentRequest, AnalyzeSentimentResponse> analyzeSentimentSettings() { return analyzeSentimentSettings; } - /** - * Returns the object with the settings used for calls to analyzeEntities. - */ + /** Returns the object with the settings used for calls to analyzeEntities. */ public SimpleCallSettings<AnalyzeEntitiesRequest, AnalyzeEntitiesResponse> analyzeEntitiesSettings() { return analyzeEntitiesSettings; } - /** - * Returns the object with the settings used for calls to annotateText. - */ + /** Returns the object with the settings used for calls to annotateText. */ public SimpleCallSettings<AnnotateTextRequest, AnnotateTextResponse> annotateTextSettings() { return annotateTextSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -179,9 +151,7 @@ private LanguageServiceSettings(Builder settingsBuilder) throws IOException { annotateTextSettings = settingsBuilder.annotateTextSettings().build(); } - /** - * Builder for LanguageServiceSettings. - */ + /** Builder for LanguageServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -321,34 +291,27 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to analyzeSentiment. - */ + /** Returns the builder for the settings used for calls to analyzeSentiment. */ public SimpleCallSettings.Builder<AnalyzeSentimentRequest, AnalyzeSentimentResponse> analyzeSentimentSettings() { return analyzeSentimentSettings; } - /** - * Returns the builder for the settings used for calls to analyzeEntities. - */ + /** Returns the builder for the settings used for calls to analyzeEntities. */ public SimpleCallSettings.Builder<AnalyzeEntitiesRequest, AnalyzeEntitiesResponse> analyzeEntitiesSettings() { return analyzeEntitiesSettings; } - /** - * Returns the builder for the settings used for calls to annotateText. - */ + /** Returns the builder for the settings used for calls to annotateText. */ public SimpleCallSettings.Builder<AnnotateTextRequest, AnnotateTextResponse> annotateTextSettings() { return annotateTextSettings; diff --git a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/package-info.java b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/package-info.java index 07c5cc884e39..9adb4a848362 100644 --- a/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/package-info.java +++ b/google-cloud-language/src/main/java/com/google/cloud/language/spi/v1beta1/package-info.java @@ -15,16 +15,15 @@ /** * A client to Google Cloud Natural Language API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * ================== - * LanguageServiceApi - * ================== + * <p>================== LanguageServiceApi ================== * - * Service Description: Provides text analysis operations such as sentiment analysis and entity + * <p>Service Description: Provides text analysis operations such as sentiment analysis and entity * recognition. * - * Sample for LanguageServiceApi: + * <p>Sample for LanguageServiceApi: + * * <pre> * <code> * try (LanguageServiceApi languageServiceApi = LanguageServiceApi.create()) { @@ -33,6 +32,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.language.spi.v1beta1; diff --git a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta1/LanguageServiceTest.java b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta1/LanguageServiceTest.java index 962cba6419fc..d9765d9ed8a2 100644 --- a/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta1/LanguageServiceTest.java +++ b/google-cloud-language/src/test/java/com/google/cloud/language/spi/v1beta1/LanguageServiceTest.java @@ -14,7 +14,6 @@ package com.google.cloud.language.spi.v1beta1; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.testing.MockGrpcService; import com.google.api.gax.testing.MockServiceHelper; import com.google.cloud.language.v1beta1.AnalyzeEntitiesRequest; @@ -26,7 +25,6 @@ import com.google.cloud.language.v1beta1.AnnotateTextResponse; import com.google.cloud.language.v1beta1.Document; import com.google.cloud.language.v1beta1.EncodingType; -import com.google.common.collect.Lists; import com.google.protobuf.GeneratedMessageV3; import java.io.IOException; import java.util.ArrayList; diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Api.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Api.java index 6172bac44b91..f49aca494e33 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Api.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Api.java @@ -49,28 +49,27 @@ * </pre> * * <p>Note: close() needs to be called on the configServiceV2Api object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of ConfigServiceV2Settings to * create(). For example: @@ -106,59 +105,41 @@ public class ConfigServiceV2Api implements AutoCloseable { private static final PathTemplate SINK_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}"); - /** - * Formats a string containing the fully-qualified path to represent - * a parent resource. - */ + /** Formats a string containing the fully-qualified path to represent a parent resource. */ public static final String formatParentName(String project) { return PARENT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Formats a string containing the fully-qualified path to represent - * a sink resource. - */ + /** Formats a string containing the fully-qualified path to represent a sink resource. */ public static final String formatSinkName(String project, String sink) { return SINK_PATH_TEMPLATE.instantiate( "project", project, "sink", sink); } - /** - * Parses the project from the given fully-qualified path which - * represents a parent resource. - */ + /** Parses the project from the given fully-qualified path which represents a parent resource. */ public static final String parseProjectFromParentName(String parentName) { return PARENT_PATH_TEMPLATE.parse(parentName).get("project"); } - /** - * Parses the project from the given fully-qualified path which - * represents a sink resource. - */ + /** Parses the project from the given fully-qualified path which represents a sink resource. */ public static final String parseProjectFromSinkName(String sinkName) { return SINK_PATH_TEMPLATE.parse(sinkName).get("project"); } - /** - * Parses the sink from the given fully-qualified path which - * represents a sink resource. - */ + /** Parses the sink from the given fully-qualified path which represents a sink resource. */ public static final String parseSinkFromSinkName(String sinkName) { return SINK_PATH_TEMPLATE.parse(sinkName).get("sink"); } - /** - * Constructs an instance of ConfigServiceV2Api with default settings. - */ + /** Constructs an instance of ConfigServiceV2Api with default settings. */ public static final ConfigServiceV2Api create() throws IOException { return create(ConfigServiceV2Settings.defaultBuilder().build()); } /** - * Constructs an instance of ConfigServiceV2Api, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of ConfigServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final ConfigServiceV2Api create(ConfigServiceV2Settings settings) throws IOException { @@ -166,9 +147,8 @@ public static final ConfigServiceV2Api create(ConfigServiceV2Settings settings) } /** - * Constructs an instance of ConfigServiceV2Api, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of ConfigServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected ConfigServiceV2Api(ConfigServiceV2Settings settings) throws IOException { this.settings = settings; @@ -216,7 +196,8 @@ public final ConfigServiceV2Settings getSettings() { /** * Lists sinks. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -226,8 +207,8 @@ public final ConfigServiceV2Settings getSettings() { * } * </code></pre> * - * @param parent Required. The resource name containing the sinks. - * Example: `"projects/my-logging-project"`. + * @param parent Required. The resource name containing the sinks. Example: + * `"projects/my-logging-project"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse<ListSinksRequest, ListSinksResponse, LogSink> listSinks( @@ -241,7 +222,8 @@ public final PagedListResponse<ListSinksRequest, ListSinksResponse, LogSink> lis /** * Lists sinks. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -266,7 +248,8 @@ public final PagedListResponse<ListSinksRequest, ListSinksResponse, LogSink> lis /** * Lists sinks. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -291,7 +274,8 @@ public final PagedListResponse<ListSinksRequest, ListSinksResponse, LogSink> lis /** * Lists sinks. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -321,7 +305,8 @@ public final ApiCallable<ListSinksRequest, ListSinksResponse> listSinksCallable( /** * Gets a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -329,8 +314,8 @@ public final ApiCallable<ListSinksRequest, ListSinksResponse> listSinksCallable( * } * </code></pre> * - * @param sinkName The resource name of the sink to return. - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sinkName The resource name of the sink to return. Example: + * `"projects/my-project-id/sinks/my-sink-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final LogSink getSink(String sinkName) { @@ -343,7 +328,8 @@ public final LogSink getSink(String sinkName) { /** * Gets a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -365,7 +351,8 @@ private final LogSink getSink(GetSinkRequest request) { /** * Gets a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -386,7 +373,8 @@ public final ApiCallable<GetSinkRequest, LogSink> getSinkCallable() { /** * Creates a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -395,12 +383,9 @@ public final ApiCallable<GetSinkRequest, LogSink> getSinkCallable() { * } * </code></pre> * - * @param parent The resource in which to create the sink. - * Example: `"projects/my-project-id"`. - * - * The new sink must be provided in the request. - * @param sink The new sink, which must not have an identifier that already - * exists. + * @param parent The resource in which to create the sink. Example: `"projects/my-project-id"`. + * <p>The new sink must be provided in the request. + * @param sink The new sink, which must not have an identifier that already exists. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final LogSink createSink(String parent, LogSink sink) { @@ -414,7 +399,8 @@ public final LogSink createSink(String parent, LogSink sink) { /** * Creates a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -438,7 +424,8 @@ public final LogSink createSink(CreateSinkRequest request) { /** * Creates a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedParent = ConfigServiceV2Api.formatParentName("[PROJECT]"); @@ -461,7 +448,8 @@ public final ApiCallable<CreateSinkRequest, LogSink> createSinkCallable() { /** * Creates or updates a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -470,15 +458,12 @@ public final ApiCallable<CreateSinkRequest, LogSink> createSinkCallable() { * } * </code></pre> * - * @param sinkName The resource name of the sink to update. - * Example: `"projects/my-project-id/sinks/my-sink-id"`. - * - * The updated sink must be provided in the request and have the - * same name that is specified in `sinkName`. If the sink does not - * exist, it is created. - * @param sink The updated sink, whose name must be the same as the sink - * identifier in `sinkName`. If `sinkName` does not exist, then - * this method creates a new sink. + * @param sinkName The resource name of the sink to update. Example: + * `"projects/my-project-id/sinks/my-sink-id"`. + * <p>The updated sink must be provided in the request and have the same name that is + * specified in `sinkName`. If the sink does not exist, it is created. + * @param sink The updated sink, whose name must be the same as the sink identifier in `sinkName`. + * If `sinkName` does not exist, then this method creates a new sink. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final LogSink updateSink(String sinkName, LogSink sink) { @@ -492,7 +477,8 @@ public final LogSink updateSink(String sinkName, LogSink sink) { /** * Creates or updates a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -516,7 +502,8 @@ public final LogSink updateSink(UpdateSinkRequest request) { /** * Creates or updates a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -539,7 +526,8 @@ public final ApiCallable<UpdateSinkRequest, LogSink> updateSinkCallable() { /** * Deletes a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -547,8 +535,8 @@ public final ApiCallable<UpdateSinkRequest, LogSink> updateSinkCallable() { * } * </code></pre> * - * @param sinkName The resource name of the sink to delete. - * Example: `"projects/my-project-id/sinks/my-sink-id"`. + * @param sinkName The resource name of the sink to delete. Example: + * `"projects/my-project-id/sinks/my-sink-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void deleteSink(String sinkName) { @@ -561,7 +549,8 @@ public final void deleteSink(String sinkName) { /** * Deletes a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); @@ -583,7 +572,8 @@ private final void deleteSink(DeleteSinkRequest request) { /** * Deletes a sink. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { * String formattedSinkName = ConfigServiceV2Api.formatSinkName("[PROJECT]", "[SINK]"); diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java index 82273360d909..f44dddab6743 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java @@ -14,7 +14,6 @@ package com.google.cloud.logging.spi.v2; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -50,15 +49,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (logging.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (logging.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getSink to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getSink to 30 seconds: * * <pre> * <code> @@ -72,19 +70,13 @@ */ @javax.annotation.Generated("by GAPIC") public class ConfigServiceV2Settings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder() .add("https://www.googleapis.com/auth/cloud-platform") @@ -94,9 +86,7 @@ public class ConfigServiceV2Settings extends ServiceApiSettings { .add("https://www.googleapis.com/auth/logging.write") .build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -111,80 +101,58 @@ public class ConfigServiceV2Settings extends ServiceApiSettings { private final SimpleCallSettings<UpdateSinkRequest, LogSink> updateSinkSettings; private final SimpleCallSettings<DeleteSinkRequest, Empty> deleteSinkSettings; - /** - * Returns the object with the settings used for calls to listSinks. - */ + /** Returns the object with the settings used for calls to listSinks. */ public PageStreamingCallSettings<ListSinksRequest, ListSinksResponse, LogSink> listSinksSettings() { return listSinksSettings; } - /** - * Returns the object with the settings used for calls to getSink. - */ + /** Returns the object with the settings used for calls to getSink. */ public SimpleCallSettings<GetSinkRequest, LogSink> getSinkSettings() { return getSinkSettings; } - /** - * Returns the object with the settings used for calls to createSink. - */ + /** Returns the object with the settings used for calls to createSink. */ public SimpleCallSettings<CreateSinkRequest, LogSink> createSinkSettings() { return createSinkSettings; } - /** - * Returns the object with the settings used for calls to updateSink. - */ + /** Returns the object with the settings used for calls to updateSink. */ public SimpleCallSettings<UpdateSinkRequest, LogSink> updateSinkSettings() { return updateSinkSettings; } - /** - * Returns the object with the settings used for calls to deleteSink. - */ + /** Returns the object with the settings used for calls to deleteSink. */ public SimpleCallSettings<DeleteSinkRequest, Empty> deleteSinkSettings() { return deleteSinkSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -239,9 +207,7 @@ public Iterable<LogSink> extractResources(ListSinksResponse payload) { } }; - /** - * Builder for ConfigServiceV2Settings. - */ + /** Builder for ConfigServiceV2Settings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -404,47 +370,36 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to listSinks. - */ + /** Returns the builder for the settings used for calls to listSinks. */ public PageStreamingCallSettings.Builder<ListSinksRequest, ListSinksResponse, LogSink> listSinksSettings() { return listSinksSettings; } - /** - * Returns the builder for the settings used for calls to getSink. - */ + /** Returns the builder for the settings used for calls to getSink. */ public SimpleCallSettings.Builder<GetSinkRequest, LogSink> getSinkSettings() { return getSinkSettings; } - /** - * Returns the builder for the settings used for calls to createSink. - */ + /** Returns the builder for the settings used for calls to createSink. */ public SimpleCallSettings.Builder<CreateSinkRequest, LogSink> createSinkSettings() { return createSinkSettings; } - /** - * Returns the builder for the settings used for calls to updateSink. - */ + /** Returns the builder for the settings used for calls to updateSink. */ public SimpleCallSettings.Builder<UpdateSinkRequest, LogSink> updateSinkSettings() { return updateSinkSettings; } - /** - * Returns the builder for the settings used for calls to deleteSink. - */ + /** Returns the builder for the settings used for calls to deleteSink. */ public SimpleCallSettings.Builder<DeleteSinkRequest, Empty> deleteSinkSettings() { return deleteSinkSettings; } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Api.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Api.java index 712ca4ed21cc..0200b82f7d2a 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Api.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Api.java @@ -52,28 +52,27 @@ * </pre> * * <p>Note: close() needs to be called on the loggingServiceV2Api object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of LoggingServiceV2Settings to * create(). For example: @@ -118,59 +117,41 @@ public class LoggingServiceV2Api implements AutoCloseable { private static final PathTemplate LOG_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}"); - /** - * Formats a string containing the fully-qualified path to represent - * a parent resource. - */ + /** Formats a string containing the fully-qualified path to represent a parent resource. */ public static final String formatParentName(String project) { return PARENT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Formats a string containing the fully-qualified path to represent - * a log resource. - */ + /** Formats a string containing the fully-qualified path to represent a log resource. */ public static final String formatLogName(String project, String log) { return LOG_PATH_TEMPLATE.instantiate( "project", project, "log", log); } - /** - * Parses the project from the given fully-qualified path which - * represents a parent resource. - */ + /** Parses the project from the given fully-qualified path which represents a parent resource. */ public static final String parseProjectFromParentName(String parentName) { return PARENT_PATH_TEMPLATE.parse(parentName).get("project"); } - /** - * Parses the project from the given fully-qualified path which - * represents a log resource. - */ + /** Parses the project from the given fully-qualified path which represents a log resource. */ public static final String parseProjectFromLogName(String logName) { return LOG_PATH_TEMPLATE.parse(logName).get("project"); } - /** - * Parses the log from the given fully-qualified path which - * represents a log resource. - */ + /** Parses the log from the given fully-qualified path which represents a log resource. */ public static final String parseLogFromLogName(String logName) { return LOG_PATH_TEMPLATE.parse(logName).get("log"); } - /** - * Constructs an instance of LoggingServiceV2Api with default settings. - */ + /** Constructs an instance of LoggingServiceV2Api with default settings. */ public static final LoggingServiceV2Api create() throws IOException { return create(LoggingServiceV2Settings.defaultBuilder().build()); } /** - * Constructs an instance of LoggingServiceV2Api, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of LoggingServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final LoggingServiceV2Api create(LoggingServiceV2Settings settings) throws IOException { @@ -178,9 +159,8 @@ public static final LoggingServiceV2Api create(LoggingServiceV2Settings settings } /** - * Constructs an instance of LoggingServiceV2Api, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of LoggingServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected LoggingServiceV2Api(LoggingServiceV2Settings settings) throws IOException { this.settings = settings; @@ -229,10 +209,10 @@ public final LoggingServiceV2Settings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a log and all its log entries. - * The log will reappear if it receives new entries. + * Deletes a log and all its log entries. The log will reappear if it receives new entries. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * String formattedLogName = LoggingServiceV2Api.formatLogName("[PROJECT]", "[LOG]"); @@ -240,8 +220,8 @@ public final LoggingServiceV2Settings getSettings() { * } * </code></pre> * - * @param logName Required. The resource name of the log to delete. Example: - * `"projects/my-project/logs/syslog"`. + * @param logName Required. The resource name of the log to delete. Example: + * `"projects/my-project/logs/syslog"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void deleteLog(String logName) { @@ -252,10 +232,10 @@ public final void deleteLog(String logName) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a log and all its log entries. - * The log will reappear if it receives new entries. + * Deletes a log and all its log entries. The log will reappear if it receives new entries. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * String formattedLogName = LoggingServiceV2Api.formatLogName("[PROJECT]", "[LOG]"); @@ -275,10 +255,10 @@ private final void deleteLog(DeleteLogRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a log and all its log entries. - * The log will reappear if it receives new entries. + * Deletes a log and all its log entries. The log will reappear if it receives new entries. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * String formattedLogName = LoggingServiceV2Api.formatLogName("[PROJECT]", "[LOG]"); @@ -297,10 +277,10 @@ public final ApiCallable<DeleteLogRequest, Empty> deleteLogCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Writes log entries to Stackdriver Logging. All log entries are - * written by this method. + * Writes log entries to Stackdriver Logging. All log entries are written by this method. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * String formattedLogName = LoggingServiceV2Api.formatLogName("[PROJECT]", "[LOG]"); @@ -311,22 +291,19 @@ public final ApiCallable<DeleteLogRequest, Empty> deleteLogCallable() { * } * </code></pre> * - * @param logName Optional. A default log resource name for those log entries in `entries` - * that do not specify their own `logName`. Example: - * `"projects/my-project/logs/syslog"`. See - * [LogEntry][google.logging.v2.LogEntry]. - * @param resource Optional. A default monitored resource for those log entries in `entries` - * that do not specify their own `resource`. - * @param labels Optional. User-defined `key:value` items that are added to - * the `labels` field of each log entry in `entries`, except when a log - * entry specifies its own `key:value` item with the same key. - * Example: `{ "size": "large", "color":"red" }` - * @param entries Required. The log entries to write. The log entries must have values for - * all required fields. - * - * To improve throughput and to avoid exceeding the quota limit for calls - * to `entries.write`, use this field to write multiple log entries at once - * rather than // calling this method for each log entry. + * @param logName Optional. A default log resource name for those log entries in `entries` that do + * not specify their own `logName`. Example: `"projects/my-project/logs/syslog"`. See + * [LogEntry][google.logging.v2.LogEntry]. + * @param resource Optional. A default monitored resource for those log entries in `entries` that + * do not specify their own `resource`. + * @param labels Optional. User-defined `key:value` items that are added to the `labels` field of + * each log entry in `entries`, except when a log entry specifies its own `key:value` item + * with the same key. Example: `{ "size": "large", "color":"red" }` + * @param entries Required. The log entries to write. The log entries must have values for all + * required fields. + * <p>To improve throughput and to avoid exceeding the quota limit for calls to + * `entries.write`, use this field to write multiple log entries at once rather than // + * calling this method for each log entry. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final WriteLogEntriesResponse writeLogEntries( @@ -349,10 +326,10 @@ public final WriteLogEntriesResponse writeLogEntries( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Writes log entries to Stackdriver Logging. All log entries are - * written by this method. + * Writes log entries to Stackdriver Logging. All log entries are written by this method. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * List<LogEntry> entries = new ArrayList<>(); @@ -372,10 +349,10 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Writes log entries to Stackdriver Logging. All log entries are - * written by this method. + * Writes log entries to Stackdriver Logging. All log entries are written by this method. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * List<LogEntry> entries = new ArrayList<>(); @@ -395,11 +372,11 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists log entries. Use this method to retrieve log entries from Cloud - * Logging. For ways to export log entries, see - * [Exporting Logs](/logging/docs/export). + * Lists log entries. Use this method to retrieve log entries from Cloud Logging. For ways to + * export log entries, see [Exporting Logs](/logging/docs/export). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * List<String> projectIds = new ArrayList<>(); @@ -412,17 +389,15 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ * </code></pre> * * @param projectIds Required. One or more project IDs or project numbers from which to retrieve - * log entries. Examples of a project ID: `"my-project-1A"`, `"1234567890"`. - * @param filter Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). - * The filter is compared against all log entries in the projects specified by - * `projectIds`. Only entries that match the filter are retrieved. An empty - * filter matches all log entries. - * @param orderBy Optional. How the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of `LogEntry.insertId`. + * log entries. Examples of a project ID: `"my-project-1A"`, `"1234567890"`. + * @param filter Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). The + * filter is compared against all log entries in the projects specified by `projectIds`. Only + * entries that match the filter are retrieved. An empty filter matches all log entries. + * @param orderBy Optional. How the results should be sorted. Presently, the only permitted values + * are `"timestamp asc"` (default) and `"timestamp desc"`. The first option returns entries in + * order of increasing values of `LogEntry.timestamp` (oldest first), and the second option + * returns entries in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of `LogEntry.insertId`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse<ListLogEntriesRequest, ListLogEntriesResponse, LogEntry> @@ -438,11 +413,11 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists log entries. Use this method to retrieve log entries from Cloud - * Logging. For ways to export log entries, see - * [Exporting Logs](/logging/docs/export). + * Lists log entries. Use this method to retrieve log entries from Cloud Logging. For ways to + * export log entries, see [Exporting Logs](/logging/docs/export). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * List<String> projectIds = new ArrayList<>(); @@ -465,11 +440,11 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists log entries. Use this method to retrieve log entries from Cloud - * Logging. For ways to export log entries, see - * [Exporting Logs](/logging/docs/export). + * Lists log entries. Use this method to retrieve log entries from Cloud Logging. For ways to + * export log entries, see [Exporting Logs](/logging/docs/export). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * List<String> projectIds = new ArrayList<>(); @@ -493,11 +468,11 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists log entries. Use this method to retrieve log entries from Cloud - * Logging. For ways to export log entries, see - * [Exporting Logs](/logging/docs/export). + * Lists log entries. Use this method to retrieve log entries from Cloud Logging. For ways to + * export log entries, see [Exporting Logs](/logging/docs/export). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * List<String> projectIds = new ArrayList<>(); @@ -527,7 +502,8 @@ public final ApiCallable<ListLogEntriesRequest, ListLogEntriesResponse> listLogE /** * Lists the monitored resource descriptors used by Stackdriver Logging. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build(); @@ -551,7 +527,8 @@ public final ApiCallable<ListLogEntriesRequest, ListLogEntriesResponse> listLogE /** * Lists the monitored resource descriptors used by Stackdriver Logging. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build(); @@ -576,7 +553,8 @@ public final ApiCallable<ListLogEntriesRequest, ListLogEntriesResponse> listLogE /** * Lists the monitored resource descriptors used by Stackdriver Logging. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { * ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build(); diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java index 0cc02e00c964..3db49f10b4f0 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java @@ -15,7 +15,6 @@ import com.google.api.MonitoredResourceDescriptor; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -52,15 +51,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (logging.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (logging.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of deleteLog to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of deleteLog to 30 seconds: * * <pre> * <code> @@ -74,19 +72,13 @@ */ @javax.annotation.Generated("by GAPIC") public class LoggingServiceV2Settings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder() .add("https://www.googleapis.com/auth/cloud-platform") @@ -96,9 +88,7 @@ public class LoggingServiceV2Settings extends ServiceApiSettings { .add("https://www.googleapis.com/auth/logging.write") .build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -116,32 +106,24 @@ public class LoggingServiceV2Settings extends ServiceApiSettings { MonitoredResourceDescriptor> listMonitoredResourceDescriptorsSettings; - /** - * Returns the object with the settings used for calls to deleteLog. - */ + /** Returns the object with the settings used for calls to deleteLog. */ public SimpleCallSettings<DeleteLogRequest, Empty> deleteLogSettings() { return deleteLogSettings; } - /** - * Returns the object with the settings used for calls to writeLogEntries. - */ + /** Returns the object with the settings used for calls to writeLogEntries. */ public SimpleCallSettings<WriteLogEntriesRequest, WriteLogEntriesResponse> writeLogEntriesSettings() { return writeLogEntriesSettings; } - /** - * Returns the object with the settings used for calls to listLogEntries. - */ + /** Returns the object with the settings used for calls to listLogEntries. */ public PageStreamingCallSettings<ListLogEntriesRequest, ListLogEntriesResponse, LogEntry> listLogEntriesSettings() { return listLogEntriesSettings; } - /** - * Returns the object with the settings used for calls to listMonitoredResourceDescriptors. - */ + /** Returns the object with the settings used for calls to listMonitoredResourceDescriptors. */ public PageStreamingCallSettings< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, MonitoredResourceDescriptor> @@ -149,44 +131,32 @@ public SimpleCallSettings<DeleteLogRequest, Empty> deleteLogSettings() { return listMonitoredResourceDescriptorsSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -288,9 +258,7 @@ public Iterable<MonitoredResourceDescriptor> extractResources( } }; - /** - * Builder for LoggingServiceV2Settings. - */ + /** Builder for LoggingServiceV2Settings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -462,42 +430,33 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to deleteLog. - */ + /** Returns the builder for the settings used for calls to deleteLog. */ public SimpleCallSettings.Builder<DeleteLogRequest, Empty> deleteLogSettings() { return deleteLogSettings; } - /** - * Returns the builder for the settings used for calls to writeLogEntries. - */ + /** Returns the builder for the settings used for calls to writeLogEntries. */ public SimpleCallSettings.Builder<WriteLogEntriesRequest, WriteLogEntriesResponse> writeLogEntriesSettings() { return writeLogEntriesSettings; } - /** - * Returns the builder for the settings used for calls to listLogEntries. - */ + /** Returns the builder for the settings used for calls to listLogEntries. */ public PageStreamingCallSettings.Builder< ListLogEntriesRequest, ListLogEntriesResponse, LogEntry> listLogEntriesSettings() { return listLogEntriesSettings; } - /** - * Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. - */ + /** Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. */ public PageStreamingCallSettings.Builder< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, MonitoredResourceDescriptor> diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Api.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Api.java index 53c07512a22c..e458ba1c756e 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Api.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Api.java @@ -48,28 +48,27 @@ * </pre> * * <p>Note: close() needs to be called on the metricsServiceV2Api object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of MetricsServiceV2Settings to * create(). For example: @@ -106,59 +105,41 @@ public class MetricsServiceV2Api implements AutoCloseable { private static final PathTemplate METRIC_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}"); - /** - * Formats a string containing the fully-qualified path to represent - * a parent resource. - */ + /** Formats a string containing the fully-qualified path to represent a parent resource. */ public static final String formatParentName(String project) { return PARENT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Formats a string containing the fully-qualified path to represent - * a metric resource. - */ + /** Formats a string containing the fully-qualified path to represent a metric resource. */ public static final String formatMetricName(String project, String metric) { return METRIC_PATH_TEMPLATE.instantiate( "project", project, "metric", metric); } - /** - * Parses the project from the given fully-qualified path which - * represents a parent resource. - */ + /** Parses the project from the given fully-qualified path which represents a parent resource. */ public static final String parseProjectFromParentName(String parentName) { return PARENT_PATH_TEMPLATE.parse(parentName).get("project"); } - /** - * Parses the project from the given fully-qualified path which - * represents a metric resource. - */ + /** Parses the project from the given fully-qualified path which represents a metric resource. */ public static final String parseProjectFromMetricName(String metricName) { return METRIC_PATH_TEMPLATE.parse(metricName).get("project"); } - /** - * Parses the metric from the given fully-qualified path which - * represents a metric resource. - */ + /** Parses the metric from the given fully-qualified path which represents a metric resource. */ public static final String parseMetricFromMetricName(String metricName) { return METRIC_PATH_TEMPLATE.parse(metricName).get("metric"); } - /** - * Constructs an instance of MetricsServiceV2Api with default settings. - */ + /** Constructs an instance of MetricsServiceV2Api with default settings. */ public static final MetricsServiceV2Api create() throws IOException { return create(MetricsServiceV2Settings.defaultBuilder().build()); } /** - * Constructs an instance of MetricsServiceV2Api, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of MetricsServiceV2Api, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. */ public static final MetricsServiceV2Api create(MetricsServiceV2Settings settings) throws IOException { @@ -166,9 +147,8 @@ public static final MetricsServiceV2Api create(MetricsServiceV2Settings settings } /** - * Constructs an instance of MetricsServiceV2Api, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of MetricsServiceV2Api, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected MetricsServiceV2Api(MetricsServiceV2Settings settings) throws IOException { this.settings = settings; @@ -217,7 +197,8 @@ public final MetricsServiceV2Settings getSettings() { /** * Lists logs-based metrics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -227,8 +208,8 @@ public final MetricsServiceV2Settings getSettings() { * } * </code></pre> * - * @param parent Required. The resource name containing the metrics. - * Example: `"projects/my-project-id"`. + * @param parent Required. The resource name containing the metrics. Example: + * `"projects/my-project-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse<ListLogMetricsRequest, ListLogMetricsResponse, LogMetric> @@ -242,7 +223,8 @@ public final MetricsServiceV2Settings getSettings() { /** * Lists logs-based metrics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -267,7 +249,8 @@ public final MetricsServiceV2Settings getSettings() { /** * Lists logs-based metrics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -293,7 +276,8 @@ public final MetricsServiceV2Settings getSettings() { /** * Lists logs-based metrics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -323,7 +307,8 @@ public final ApiCallable<ListLogMetricsRequest, ListLogMetricsResponse> listLogM /** * Gets a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -331,8 +316,8 @@ public final ApiCallable<ListLogMetricsRequest, ListLogMetricsResponse> listLogM * } * </code></pre> * - * @param metricName The resource name of the desired metric. - * Example: `"projects/my-project-id/metrics/my-metric-id"`. + * @param metricName The resource name of the desired metric. Example: + * `"projects/my-project-id/metrics/my-metric-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final LogMetric getLogMetric(String metricName) { @@ -346,7 +331,8 @@ public final LogMetric getLogMetric(String metricName) { /** * Gets a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -368,7 +354,8 @@ private final LogMetric getLogMetric(GetLogMetricRequest request) { /** * Gets a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -389,7 +376,8 @@ public final ApiCallable<GetLogMetricRequest, LogMetric> getLogMetricCallable() /** * Creates a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -398,12 +386,10 @@ public final ApiCallable<GetLogMetricRequest, LogMetric> getLogMetricCallable() * } * </code></pre> * - * @param parent The resource name of the project in which to create the metric. - * Example: `"projects/my-project-id"`. - * - * The new metric must be provided in the request. - * @param metric The new logs-based metric, which must not have an identifier that - * already exists. + * @param parent The resource name of the project in which to create the metric. Example: + * `"projects/my-project-id"`. + * <p>The new metric must be provided in the request. + * @param metric The new logs-based metric, which must not have an identifier that already exists. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final LogMetric createLogMetric(String parent, LogMetric metric) { @@ -417,7 +403,8 @@ public final LogMetric createLogMetric(String parent, LogMetric metric) { /** * Creates a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -441,7 +428,8 @@ public final LogMetric createLogMetric(CreateLogMetricRequest request) { /** * Creates a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedParent = MetricsServiceV2Api.formatParentName("[PROJECT]"); @@ -464,7 +452,8 @@ public final ApiCallable<CreateLogMetricRequest, LogMetric> createLogMetricCalla /** * Creates or updates a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -473,15 +462,12 @@ public final ApiCallable<CreateLogMetricRequest, LogMetric> createLogMetricCalla * } * </code></pre> * - * @param metricName The resource name of the metric to update. - * Example: `"projects/my-project-id/metrics/my-metric-id"`. - * - * The updated metric must be provided in the request and have the - * same identifier that is specified in `metricName`. - * If the metric does not exist, it is created. - * @param metric The updated metric, whose name must be the same as the - * metric identifier in `metricName`. If `metricName` does not - * exist, then a new metric is created. + * @param metricName The resource name of the metric to update. Example: + * `"projects/my-project-id/metrics/my-metric-id"`. + * <p>The updated metric must be provided in the request and have the same identifier that is + * specified in `metricName`. If the metric does not exist, it is created. + * @param metric The updated metric, whose name must be the same as the metric identifier in + * `metricName`. If `metricName` does not exist, then a new metric is created. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final LogMetric updateLogMetric(String metricName, LogMetric metric) { @@ -495,7 +481,8 @@ public final LogMetric updateLogMetric(String metricName, LogMetric metric) { /** * Creates or updates a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -519,7 +506,8 @@ public final LogMetric updateLogMetric(UpdateLogMetricRequest request) { /** * Creates or updates a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -542,7 +530,8 @@ public final ApiCallable<UpdateLogMetricRequest, LogMetric> updateLogMetricCalla /** * Deletes a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -550,8 +539,8 @@ public final ApiCallable<UpdateLogMetricRequest, LogMetric> updateLogMetricCalla * } * </code></pre> * - * @param metricName The resource name of the metric to delete. - * Example: `"projects/my-project-id/metrics/my-metric-id"`. + * @param metricName The resource name of the metric to delete. Example: + * `"projects/my-project-id/metrics/my-metric-id"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void deleteLogMetric(String metricName) { @@ -565,7 +554,8 @@ public final void deleteLogMetric(String metricName) { /** * Deletes a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); @@ -587,7 +577,8 @@ private final void deleteLogMetric(DeleteLogMetricRequest request) { /** * Deletes a logs-based metric. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { * String formattedMetricName = MetricsServiceV2Api.formatMetricName("[PROJECT]", "[METRIC]"); diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java index c58f60f8e3e0..33302e500c2f 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java @@ -14,7 +14,6 @@ package com.google.cloud.logging.spi.v2; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -50,15 +49,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (logging.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (logging.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getLogMetric to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getLogMetric to 30 seconds: * * <pre> * <code> @@ -72,19 +70,13 @@ */ @javax.annotation.Generated("by GAPIC") public class MetricsServiceV2Settings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder() .add("https://www.googleapis.com/auth/cloud-platform") @@ -94,9 +86,7 @@ public class MetricsServiceV2Settings extends ServiceApiSettings { .add("https://www.googleapis.com/auth/logging.write") .build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -111,80 +101,58 @@ public class MetricsServiceV2Settings extends ServiceApiSettings { private final SimpleCallSettings<UpdateLogMetricRequest, LogMetric> updateLogMetricSettings; private final SimpleCallSettings<DeleteLogMetricRequest, Empty> deleteLogMetricSettings; - /** - * Returns the object with the settings used for calls to listLogMetrics. - */ + /** Returns the object with the settings used for calls to listLogMetrics. */ public PageStreamingCallSettings<ListLogMetricsRequest, ListLogMetricsResponse, LogMetric> listLogMetricsSettings() { return listLogMetricsSettings; } - /** - * Returns the object with the settings used for calls to getLogMetric. - */ + /** Returns the object with the settings used for calls to getLogMetric. */ public SimpleCallSettings<GetLogMetricRequest, LogMetric> getLogMetricSettings() { return getLogMetricSettings; } - /** - * Returns the object with the settings used for calls to createLogMetric. - */ + /** Returns the object with the settings used for calls to createLogMetric. */ public SimpleCallSettings<CreateLogMetricRequest, LogMetric> createLogMetricSettings() { return createLogMetricSettings; } - /** - * Returns the object with the settings used for calls to updateLogMetric. - */ + /** Returns the object with the settings used for calls to updateLogMetric. */ public SimpleCallSettings<UpdateLogMetricRequest, LogMetric> updateLogMetricSettings() { return updateLogMetricSettings; } - /** - * Returns the object with the settings used for calls to deleteLogMetric. - */ + /** Returns the object with the settings used for calls to deleteLogMetric. */ public SimpleCallSettings<DeleteLogMetricRequest, Empty> deleteLogMetricSettings() { return deleteLogMetricSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -241,9 +209,7 @@ public Iterable<LogMetric> extractResources(ListLogMetricsResponse payload) { } }; - /** - * Builder for MetricsServiceV2Settings. - */ + /** Builder for MetricsServiceV2Settings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -413,48 +379,37 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to listLogMetrics. - */ + /** Returns the builder for the settings used for calls to listLogMetrics. */ public PageStreamingCallSettings.Builder< ListLogMetricsRequest, ListLogMetricsResponse, LogMetric> listLogMetricsSettings() { return listLogMetricsSettings; } - /** - * Returns the builder for the settings used for calls to getLogMetric. - */ + /** Returns the builder for the settings used for calls to getLogMetric. */ public SimpleCallSettings.Builder<GetLogMetricRequest, LogMetric> getLogMetricSettings() { return getLogMetricSettings; } - /** - * Returns the builder for the settings used for calls to createLogMetric. - */ + /** Returns the builder for the settings used for calls to createLogMetric. */ public SimpleCallSettings.Builder<CreateLogMetricRequest, LogMetric> createLogMetricSettings() { return createLogMetricSettings; } - /** - * Returns the builder for the settings used for calls to updateLogMetric. - */ + /** Returns the builder for the settings used for calls to updateLogMetric. */ public SimpleCallSettings.Builder<UpdateLogMetricRequest, LogMetric> updateLogMetricSettings() { return updateLogMetricSettings; } - /** - * Returns the builder for the settings used for calls to deleteLogMetric. - */ + /** Returns the builder for the settings used for calls to deleteLogMetric. */ public SimpleCallSettings.Builder<DeleteLogMetricRequest, Empty> deleteLogMetricSettings() { return deleteLogMetricSettings; } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java index e16b370463dc..c579f3ff26d6 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/package-info.java @@ -15,15 +15,14 @@ /** * A client to Stackdriver Logging API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * =================== - * LoggingServiceV2Api - * =================== + * <p>=================== LoggingServiceV2Api =================== * - * Service Description: Service for ingesting and querying logs. + * <p>Service Description: Service for ingesting and querying logs. + * + * <p>Sample for LoggingServiceV2Api: * - * Sample for LoggingServiceV2Api: * <pre> * <code> * try (LoggingServiceV2Api loggingServiceV2Api = LoggingServiceV2Api.create()) { @@ -33,14 +32,13 @@ * </code> * </pre> * - * ================== - * ConfigServiceV2Api - * ================== + * ================== ConfigServiceV2Api ================== + * + * <p>Service Description: Service for configuring sinks used to export log entries outside + * Stackdriver Logging. * - * Service Description: Service for configuring sinks used to export log entries outside Stackdriver - * Logging. + * <p>Sample for ConfigServiceV2Api: * - * Sample for ConfigServiceV2Api: * <pre> * <code> * try (ConfigServiceV2Api configServiceV2Api = ConfigServiceV2Api.create()) { @@ -50,13 +48,12 @@ * </code> * </pre> * - * =================== - * MetricsServiceV2Api - * =================== + * =================== MetricsServiceV2Api =================== * - * Service Description: Service for configuring logs-based metrics. + * <p>Service Description: Service for configuring logs-based metrics. + * + * <p>Sample for MetricsServiceV2Api: * - * Sample for MetricsServiceV2Api: * <pre> * <code> * try (MetricsServiceV2Api metricsServiceV2Api = MetricsServiceV2Api.create()) { @@ -65,6 +62,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.logging.spi.v2; diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceApi.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceApi.java index f08630cd7fa9..a81142c23194 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceApi.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceApi.java @@ -28,9 +28,8 @@ // AUTO-GENERATED DOCUMENTATION AND SERVICE /** - * Service Description: The AgentTranslation API allows `collectd`-based agents to - * write time series data to Cloud Monitoring. - * See [google.monitoring.v3.MetricService.CreateTimeSeries] instead. + * Service Description: The AgentTranslation API allows `collectd`-based agents to write time series + * data to Cloud Monitoring. See [google.monitoring.v3.MetricService.CreateTimeSeries] instead. * * <p>This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -47,32 +46,32 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the agentTranslationServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the agentTranslationServiceApi object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - * <p>This class can be customized by passing in a custom instance of AgentTranslationServiceSettings to - * create(). For example: + * <p>This class can be customized by passing in a custom instance of + * AgentTranslationServiceSettings to create(). For example: * * <pre> * <code> @@ -96,33 +95,24 @@ public class AgentTranslationServiceApi implements AutoCloseable { private static final PathTemplate PROJECT_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } - /** - * Constructs an instance of AgentTranslationServiceApi with default settings. - */ + /** Constructs an instance of AgentTranslationServiceApi with default settings. */ public static final AgentTranslationServiceApi create() throws IOException { return create(AgentTranslationServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of AgentTranslationServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of AgentTranslationServiceApi, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. */ public static final AgentTranslationServiceApi create(AgentTranslationServiceSettings settings) throws IOException { @@ -130,9 +120,9 @@ public static final AgentTranslationServiceApi create(AgentTranslationServiceSet } /** - * Constructs an instance of AgentTranslationServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of AgentTranslationServiceApi, using the given settings. This is + * protected so that it easy to make a subclass, but otherwise, the static factory methods should + * be preferred. */ protected AgentTranslationServiceApi(AgentTranslationServiceSettings settings) throws IOException { @@ -172,11 +162,12 @@ public final AgentTranslationServiceSettings getSettings() { /** * **Stackdriver Monitoring Agent only:** Creates a new time series. * - * <aside class="caution">This method is only for use by the Google Monitoring Agent. - * Use [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + * <p><aside class="caution">This method is only for use by the Google Monitoring Agent. Use + * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] * instead.</aside> * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (AgentTranslationServiceApi agentTranslationServiceApi = AgentTranslationServiceApi.create()) { * String formattedName = AgentTranslationServiceApi.formatProjectName("[PROJECT]"); @@ -188,13 +179,13 @@ public final AgentTranslationServiceSettings getSettings() { * </code></pre> * * @param name The project in which to create the time series. The format is - * `"projects/PROJECT_ID_OR_NUMBER"`. + * `"projects/PROJECT_ID_OR_NUMBER"`. * @param resource The monitored resource associated with the time series. - * @param collectdVersion The version of `collectd` that collected the data. Example: `"5.3.0-192.el6"`. - * @param collectdPayloads The `collectd` payloads representing the time series data. - * You must not include more than a single point for each - * time series, so no two payloads can have the same values - * for all of the fields `plugin`, `plugin_instance`, `type`, and `type_instance`. + * @param collectdVersion The version of `collectd` that collected the data. Example: + * `"5.3.0-192.el6"`. + * @param collectdPayloads The `collectd` payloads representing the time series data. You must not + * include more than a single point for each time series, so no two payloads can have the same + * values for all of the fields `plugin`, `plugin_instance`, `type`, and `type_instance`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void createCollectdTimeSeries( @@ -217,11 +208,12 @@ public final void createCollectdTimeSeries( /** * **Stackdriver Monitoring Agent only:** Creates a new time series. * - * <aside class="caution">This method is only for use by the Google Monitoring Agent. - * Use [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + * <p><aside class="caution">This method is only for use by the Google Monitoring Agent. Use + * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] * instead.</aside> * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (AgentTranslationServiceApi agentTranslationServiceApi = AgentTranslationServiceApi.create()) { * String formattedName = AgentTranslationServiceApi.formatProjectName("[PROJECT]"); @@ -249,11 +241,12 @@ public final void createCollectdTimeSeries(CreateCollectdTimeSeriesRequest reque /** * **Stackdriver Monitoring Agent only:** Creates a new time series. * - * <aside class="caution">This method is only for use by the Google Monitoring Agent. - * Use [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] + * <p><aside class="caution">This method is only for use by the Google Monitoring Agent. Use + * [projects.timeSeries.create][google.monitoring.v3.MetricService.CreateTimeSeries] * instead.</aside> * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (AgentTranslationServiceApi agentTranslationServiceApi = AgentTranslationServiceApi.create()) { * String formattedName = AgentTranslationServiceApi.formatProjectName("[PROJECT]"); diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceSettings.java index 9af3c0b4c166..72bbff0eebbb 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceSettings.java @@ -16,7 +16,6 @@ import com.google.api.gax.core.ConnectionSettings; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; -import com.google.api.gax.grpc.PageStreamingDescriptor; import com.google.api.gax.grpc.ServiceApiSettings; import com.google.api.gax.grpc.SimpleCallSettings; import com.google.auth.Credentials; @@ -42,15 +41,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (monitoring.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (monitoring.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of createCollectdTimeSeries to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createCollectdTimeSeries to 30 seconds: * * <pre> * <code> @@ -64,25 +62,17 @@ */ @javax.annotation.Generated("by GAPIC") public class AgentTranslationServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "monitoring.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -93,52 +83,38 @@ public class AgentTranslationServiceSettings extends ServiceApiSettings { private final SimpleCallSettings<CreateCollectdTimeSeriesRequest, Empty> createCollectdTimeSeriesSettings; - /** - * Returns the object with the settings used for calls to createCollectdTimeSeries. - */ + /** Returns the object with the settings used for calls to createCollectdTimeSeries. */ public SimpleCallSettings<CreateCollectdTimeSeriesRequest, Empty> createCollectdTimeSeriesSettings() { return createCollectdTimeSeriesSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -155,9 +131,7 @@ private AgentTranslationServiceSettings(Builder settingsBuilder) throws IOExcept createCollectdTimeSeriesSettings = settingsBuilder.createCollectdTimeSeriesSettings().build(); } - /** - * Builder for AgentTranslationServiceSettings. - */ + /** Builder for AgentTranslationServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -274,18 +248,15 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to createCollectdTimeSeries. - */ + /** Returns the builder for the settings used for calls to createCollectdTimeSeries. */ public SimpleCallSettings.Builder<CreateCollectdTimeSeriesRequest, Empty> createCollectdTimeSeriesSettings() { return createCollectdTimeSeriesSettings; diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceApi.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceApi.java index 48f7a007e528..850406c119de 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceApi.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceApi.java @@ -40,15 +40,12 @@ * Service Description: The Group API lets you inspect and manage your * [groups](google.monitoring.v3.Group). * - * A group is a named filter that is used to identify - * a collection of monitored resources. Groups are typically used to - * mirror the physical and/or logical topology of the environment. - * Because group membership is computed dynamically, monitored - * resources that are started in the future are automatically placed - * in matching groups. By using a group to name monitored resources in, - * for example, an alert policy, the target of that alert policy is - * updated automatically as monitored resources are added and removed - * from the infrastructure. + * <p>A group is a named filter that is used to identify a collection of monitored resources. Groups + * are typically used to mirror the physical and/or logical topology of the environment. Because + * group membership is computed dynamically, monitored resources that are started in the future are + * automatically placed in matching groups. By using a group to name monitored resources in, for + * example, an alert policy, the target of that alert policy is updated automatically as monitored + * resources are added and removed from the infrastructure. * * <p>This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -62,29 +59,28 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the groupServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the groupServiceApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of GroupServiceSettings to * create(). For example: @@ -126,68 +122,49 @@ public class GroupServiceApi implements AutoCloseable { private static final PathTemplate GROUP_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Formats a string containing the fully-qualified path to represent - * a group resource. - */ + /** Formats a string containing the fully-qualified path to represent a group resource. */ public static final String formatGroupName(String project, String group) { return GROUP_PATH_TEMPLATE.instantiate( "project", project, "group", group); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } - /** - * Parses the project from the given fully-qualified path which - * represents a group resource. - */ + /** Parses the project from the given fully-qualified path which represents a group resource. */ public static final String parseProjectFromGroupName(String groupName) { return GROUP_PATH_TEMPLATE.parse(groupName).get("project"); } - /** - * Parses the group from the given fully-qualified path which - * represents a group resource. - */ + /** Parses the group from the given fully-qualified path which represents a group resource. */ public static final String parseGroupFromGroupName(String groupName) { return GROUP_PATH_TEMPLATE.parse(groupName).get("group"); } - /** - * Constructs an instance of GroupServiceApi with default settings. - */ + /** Constructs an instance of GroupServiceApi with default settings. */ public static final GroupServiceApi create() throws IOException { return create(GroupServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of GroupServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of GroupServiceApi, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. */ public static final GroupServiceApi create(GroupServiceSettings settings) throws IOException { return new GroupServiceApi(settings); } /** - * Constructs an instance of GroupServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of GroupServiceApi, using the given settings. This is protected so that + * it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected GroupServiceApi(GroupServiceSettings settings) throws IOException { this.settings = settings; @@ -238,10 +215,10 @@ public final GroupServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the existing groups. The project ID in the URL path must refer - * to a Stackdriver account. + * Lists the existing groups. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatProjectName("[PROJECT]"); @@ -264,10 +241,10 @@ public final PagedListResponse<ListGroupsRequest, ListGroupsResponse, Group> lis // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the existing groups. The project ID in the URL path must refer - * to a Stackdriver account. + * Lists the existing groups. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatProjectName("[PROJECT]"); @@ -290,10 +267,10 @@ public final PagedListResponse<ListGroupsRequest, ListGroupsResponse, Group> lis // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the existing groups. The project ID in the URL path must refer - * to a Stackdriver account. + * Lists the existing groups. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatProjectName("[PROJECT]"); @@ -321,10 +298,10 @@ public final ApiCallable<ListGroupsRequest, ListGroupsResponse> listGroupsCallab // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single group. The project ID in the URL path must refer to a - * Stackdriver account. + * Gets a single group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -333,7 +310,7 @@ public final ApiCallable<ListGroupsRequest, ListGroupsResponse> listGroupsCallab * </code></pre> * * @param name The group to retrieve. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. + * `"projects/{project_id_or_number}/groups/{group_id}"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Group getGroup(String name) { @@ -344,10 +321,10 @@ public final Group getGroup(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single group. The project ID in the URL path must refer to a - * Stackdriver account. + * Gets a single group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -367,10 +344,10 @@ private final Group getGroup(GetGroupRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single group. The project ID in the URL path must refer to a - * Stackdriver account. + * Gets a single group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -389,10 +366,10 @@ public final ApiCallable<GetGroupRequest, Group> getGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new group. The project ID in the URL path must refer to a - * Stackdriver account. + * Creates a new group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatProjectName("[PROJECT]"); @@ -403,9 +380,9 @@ public final ApiCallable<GetGroupRequest, Group> getGroupCallable() { * </code></pre> * * @param name The project in which to create the group. The format is - * `"projects/{project_id_or_number}"`. - * @param group A group definition. It is an error to define the `name` field because - * the system assigns the name. + * `"projects/{project_id_or_number}"`. + * @param group A group definition. It is an error to define the `name` field because the system + * assigns the name. * @param validateOnly If true, validate this request but do not create the group. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -422,10 +399,10 @@ public final Group createGroup(String name, Group group, boolean validateOnly) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new group. The project ID in the URL path must refer to a - * Stackdriver account. + * Creates a new group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatProjectName("[PROJECT]"); @@ -449,10 +426,10 @@ public final Group createGroup(CreateGroupRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new group. The project ID in the URL path must refer to a - * Stackdriver account. + * Creates a new group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatProjectName("[PROJECT]"); @@ -475,11 +452,11 @@ public final ApiCallable<CreateGroupRequest, Group> createGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an existing group. - * You can change any group attributes except `name`. - * The project ID in the URL path must refer to a Stackdriver account. + * Updates an existing group. You can change any group attributes except `name`. The project ID in + * the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * Group group = Group.newBuilder().build(); @@ -488,8 +465,8 @@ public final ApiCallable<CreateGroupRequest, Group> createGroupCallable() { * } * </code></pre> * - * @param group The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of this group. + * @param group The new definition of the group. All fields of the existing group, excepting + * `name`, are replaced with the corresponding fields of this group. * @param validateOnly If true, validate this request but do not update the existing group. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -501,11 +478,11 @@ public final Group updateGroup(Group group, boolean validateOnly) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an existing group. - * You can change any group attributes except `name`. - * The project ID in the URL path must refer to a Stackdriver account. + * Updates an existing group. You can change any group attributes except `name`. The project ID in + * the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * Group group = Group.newBuilder().build(); @@ -527,11 +504,11 @@ public final Group updateGroup(UpdateGroupRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates an existing group. - * You can change any group attributes except `name`. - * The project ID in the URL path must refer to a Stackdriver account. + * Updates an existing group. You can change any group attributes except `name`. The project ID in + * the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * Group group = Group.newBuilder().build(); @@ -552,10 +529,10 @@ public final ApiCallable<UpdateGroupRequest, Group> updateGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing group. The project ID in the URL path must refer to a - * Stackdriver account. + * Deletes an existing group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -564,7 +541,7 @@ public final ApiCallable<UpdateGroupRequest, Group> updateGroupCallable() { * </code></pre> * * @param name The group to delete. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. + * `"projects/{project_id_or_number}/groups/{group_id}"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void deleteGroup(String name) { @@ -575,10 +552,10 @@ public final void deleteGroup(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing group. The project ID in the URL path must refer to a - * Stackdriver account. + * Deletes an existing group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -598,10 +575,10 @@ private final void deleteGroup(DeleteGroupRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing group. The project ID in the URL path must refer to a - * Stackdriver account. + * Deletes an existing group. The project ID in the URL path must refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -620,10 +597,11 @@ public final ApiCallable<DeleteGroupRequest, Empty> deleteGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the monitored resources that are members of a group. The project ID - * in the URL path must refer to a Stackdriver account. + * Lists the monitored resources that are members of a group. The project ID in the URL path must + * refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -636,18 +614,15 @@ public final ApiCallable<DeleteGroupRequest, Empty> deleteGroupCallable() { * </code></pre> * * @param name The group whose members are listed. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. - * @param filter An optional [list filter](/monitoring/api/learn_more#filtering) describing - * the members to be returned. The filter may reference the type, labels, and - * metadata of monitored resources that comprise the group. - * For example, to return only resources representing Compute Engine VM - * instances, use this filter: - * - * resource.type = "gce_instance" - * @param interval An optional time interval for which results should be returned. Only - * members that were part of the group during the specified interval are - * included in the response. If no interval is provided then the group - * membership over the last minute is returned. + * `"projects/{project_id_or_number}/groups/{group_id}"`. + * @param filter An optional [list filter](/monitoring/api/learn_more#filtering) describing the + * members to be returned. The filter may reference the type, labels, and metadata of + * monitored resources that comprise the group. For example, to return only resources + * representing Compute Engine VM instances, use this filter: + * <p>resource.type = "gce_instance" + * @param interval An optional time interval for which results should be returned. Only members + * that were part of the group during the specified interval are included in the response. If + * no interval is provided then the group membership over the last minute is returned. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse< @@ -665,10 +640,11 @@ public final ApiCallable<DeleteGroupRequest, Empty> deleteGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the monitored resources that are members of a group. The project ID - * in the URL path must refer to a Stackdriver account. + * Lists the monitored resources that are members of a group. The project ID in the URL path must + * refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -696,10 +672,11 @@ public final ApiCallable<DeleteGroupRequest, Empty> deleteGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the monitored resources that are members of a group. The project ID - * in the URL path must refer to a Stackdriver account. + * Lists the monitored resources that are members of a group. The project ID in the URL path must + * refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); @@ -727,10 +704,11 @@ public final ApiCallable<DeleteGroupRequest, Empty> deleteGroupCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the monitored resources that are members of a group. The project ID - * in the URL path must refer to a Stackdriver account. + * Lists the monitored resources that are members of a group. The project ID in the URL path must + * refer to a Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { * String formattedName = GroupServiceApi.formatGroupName("[PROJECT]", "[GROUP]"); diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java index 2b2b02fea282..a5e1f1d06d73 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java @@ -15,7 +15,6 @@ import com.google.api.MonitoredResource; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -53,15 +52,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (monitoring.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (monitoring.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getGroup to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getGroup to 30 seconds: * * <pre> * <code> @@ -75,25 +73,17 @@ */ @javax.annotation.Generated("by GAPIC") public class GroupServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "monitoring.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -111,89 +101,65 @@ public class GroupServiceSettings extends ServiceApiSettings { ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource> listGroupMembersSettings; - /** - * Returns the object with the settings used for calls to listGroups. - */ + /** Returns the object with the settings used for calls to listGroups. */ public PageStreamingCallSettings<ListGroupsRequest, ListGroupsResponse, Group> listGroupsSettings() { return listGroupsSettings; } - /** - * Returns the object with the settings used for calls to getGroup. - */ + /** Returns the object with the settings used for calls to getGroup. */ public SimpleCallSettings<GetGroupRequest, Group> getGroupSettings() { return getGroupSettings; } - /** - * Returns the object with the settings used for calls to createGroup. - */ + /** Returns the object with the settings used for calls to createGroup. */ public SimpleCallSettings<CreateGroupRequest, Group> createGroupSettings() { return createGroupSettings; } - /** - * Returns the object with the settings used for calls to updateGroup. - */ + /** Returns the object with the settings used for calls to updateGroup. */ public SimpleCallSettings<UpdateGroupRequest, Group> updateGroupSettings() { return updateGroupSettings; } - /** - * Returns the object with the settings used for calls to deleteGroup. - */ + /** Returns the object with the settings used for calls to deleteGroup. */ public SimpleCallSettings<DeleteGroupRequest, Empty> deleteGroupSettings() { return deleteGroupSettings; } - /** - * Returns the object with the settings used for calls to listGroupMembers. - */ + /** Returns the object with the settings used for calls to listGroupMembers. */ public PageStreamingCallSettings< ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource> listGroupMembersSettings() { return listGroupMembersSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -289,9 +255,7 @@ public Iterable<MonitoredResource> extractResources(ListGroupMembersResponse pay } }; - /** - * Builder for GroupServiceSettings. - */ + /** Builder for GroupServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -469,54 +433,41 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to listGroups. - */ + /** Returns the builder for the settings used for calls to listGroups. */ public PageStreamingCallSettings.Builder<ListGroupsRequest, ListGroupsResponse, Group> listGroupsSettings() { return listGroupsSettings; } - /** - * Returns the builder for the settings used for calls to getGroup. - */ + /** Returns the builder for the settings used for calls to getGroup. */ public SimpleCallSettings.Builder<GetGroupRequest, Group> getGroupSettings() { return getGroupSettings; } - /** - * Returns the builder for the settings used for calls to createGroup. - */ + /** Returns the builder for the settings used for calls to createGroup. */ public SimpleCallSettings.Builder<CreateGroupRequest, Group> createGroupSettings() { return createGroupSettings; } - /** - * Returns the builder for the settings used for calls to updateGroup. - */ + /** Returns the builder for the settings used for calls to updateGroup. */ public SimpleCallSettings.Builder<UpdateGroupRequest, Group> updateGroupSettings() { return updateGroupSettings; } - /** - * Returns the builder for the settings used for calls to deleteGroup. - */ + /** Returns the builder for the settings used for calls to deleteGroup. */ public SimpleCallSettings.Builder<DeleteGroupRequest, Empty> deleteGroupSettings() { return deleteGroupSettings; } - /** - * Returns the builder for the settings used for calls to listGroupMembers. - */ + /** Returns the builder for the settings used for calls to listGroupMembers. */ public PageStreamingCallSettings.Builder< ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource> listGroupMembersSettings() { diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceApi.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceApi.java index f1ba47dc1283..bd3599c6d493 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceApi.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceApi.java @@ -40,8 +40,8 @@ // AUTO-GENERATED DOCUMENTATION AND SERVICE /** - * Service Description: Manages metric descriptors, monitored resource descriptors, and - * time series data. + * Service Description: Manages metric descriptors, monitored resource descriptors, and time series + * data. * * <p>This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -55,29 +55,28 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the metricServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the metricServiceApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of MetricServiceSettings to * create(). For example: @@ -139,17 +138,14 @@ public class MetricServiceApi implements AutoCloseable { PathTemplate.createWithoutUrlEncoding( "projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } /** - * Formats a string containing the fully-qualified path to represent - * a metric_descriptor_path resource. + * Formats a string containing the fully-qualified path to represent a metric_descriptor_path + * resource. */ public static final String formatMetricDescriptorPathName( String project, String metricDescriptorPath) { @@ -159,8 +155,8 @@ public static final String formatMetricDescriptorPathName( } /** - * Formats a string containing the fully-qualified path to represent - * a monitored_resource_descriptor resource. + * Formats a string containing the fully-qualified path to represent a + * monitored_resource_descriptor resource. */ public static final String formatMonitoredResourceDescriptorName( String project, String monitoredResourceDescriptor) { @@ -169,17 +165,14 @@ public static final String formatMonitoredResourceDescriptorName( "monitored_resource_descriptor", monitoredResourceDescriptor); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } /** - * Parses the project from the given fully-qualified path which - * represents a metricDescriptorPath resource. + * Parses the project from the given fully-qualified path which represents a metricDescriptorPath + * resource. */ public static final String parseProjectFromMetricDescriptorPathName( String metricDescriptorPathName) { @@ -187,8 +180,8 @@ public static final String parseProjectFromMetricDescriptorPathName( } /** - * Parses the metric_descriptor_path from the given fully-qualified path which - * represents a metricDescriptorPath resource. + * Parses the metric_descriptor_path from the given fully-qualified path which represents a + * metricDescriptorPath resource. */ public static final String parseMetricDescriptorPathFromMetricDescriptorPathName( String metricDescriptorPathName) { @@ -198,8 +191,8 @@ public static final String parseMetricDescriptorPathFromMetricDescriptorPathName } /** - * Parses the project from the given fully-qualified path which - * represents a monitoredResourceDescriptor resource. + * Parses the project from the given fully-qualified path which represents a + * monitoredResourceDescriptor resource. */ public static final String parseProjectFromMonitoredResourceDescriptorName( String monitoredResourceDescriptorName) { @@ -209,8 +202,8 @@ public static final String parseProjectFromMonitoredResourceDescriptorName( } /** - * Parses the monitored_resource_descriptor from the given fully-qualified path which - * represents a monitoredResourceDescriptor resource. + * Parses the monitored_resource_descriptor from the given fully-qualified path which represents a + * monitoredResourceDescriptor resource. */ public static final String parseMonitoredResourceDescriptorFromMonitoredResourceDescriptorName( String monitoredResourceDescriptorName) { @@ -219,26 +212,22 @@ public static final String parseMonitoredResourceDescriptorFromMonitoredResource .get("monitored_resource_descriptor"); } - /** - * Constructs an instance of MetricServiceApi with default settings. - */ + /** Constructs an instance of MetricServiceApi with default settings. */ public static final MetricServiceApi create() throws IOException { return create(MetricServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of MetricServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of MetricServiceApi, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. */ public static final MetricServiceApi create(MetricServiceSettings settings) throws IOException { return new MetricServiceApi(settings); } /** - * Constructs an instance of MetricServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of MetricServiceApi, using the given settings. This is protected so that + * it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected MetricServiceApi(MetricServiceSettings settings) throws IOException { this.settings = settings; @@ -299,9 +288,11 @@ public final MetricServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + * Lists monitored resource descriptors that match a filter. This method does not require a + * Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -313,14 +304,11 @@ public final MetricServiceSettings getSettings() { * </code></pre> * * @param name The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param filter An optional [filter](/monitoring/api/v3/filters) describing - * the descriptors to be returned. The filter can reference - * the descriptor's type and labels. For example, the - * following filter returns only Google Compute Engine descriptors - * that have an `id` label: - * - * resource.type = starts_with("gce_") AND resource.label:id + * `"projects/{project_id_or_number}"`. + * @param filter An optional [filter](/monitoring/api/v3/filters) describing the descriptors to be + * returned. The filter can reference the descriptor's type and labels. For example, the + * following filter returns only Google Compute Engine descriptors that have an `id` label: + * <p>resource.type = starts_with("gce_") AND resource.label:id * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse< @@ -338,9 +326,11 @@ public final MetricServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + * Lists monitored resource descriptors that match a filter. This method does not require a + * Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -367,9 +357,11 @@ public final MetricServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + * Lists monitored resource descriptors that match a filter. This method does not require a + * Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -397,9 +389,11 @@ public final MetricServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account. + * Lists monitored resource descriptors that match a filter. This method does not require a + * Stackdriver account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -431,9 +425,11 @@ public final MetricServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single monitored resource descriptor. This method does not require a Stackdriver account. + * Gets a single monitored resource descriptor. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]"); @@ -441,10 +437,9 @@ public final MetricServiceSettings getSettings() { * } * </code></pre> * - * @param name The monitored resource descriptor to get. The format is - * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. - * The `{resource_type}` is a predefined type, such as - * `cloudsql_database`. + * @param name The monitored resource descriptor to get. The format is + * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. The + * `{resource_type}` is a predefined type, such as `cloudsql_database`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String name) { @@ -456,9 +451,11 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String n // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single monitored resource descriptor. This method does not require a Stackdriver account. + * Gets a single monitored resource descriptor. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]"); @@ -479,9 +476,11 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single monitored resource descriptor. This method does not require a Stackdriver account. + * Gets a single monitored resource descriptor. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]"); @@ -501,9 +500,11 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + * Lists metric descriptors that match a filter. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -515,15 +516,12 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( * </code></pre> * * @param name The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param filter If this field is empty, all custom and - * system-defined metric descriptors are returned. - * Otherwise, the [filter](/monitoring/api/v3/filters) - * specifies which metric descriptors are to be - * returned. For example, the following filter matches all - * [custom metrics](/monitoring/custom-metrics): - * - * metric.type = starts_with("custom.googleapis.com/") + * `"projects/{project_id_or_number}"`. + * @param filter If this field is empty, all custom and system-defined metric descriptors are + * returned. Otherwise, the [filter](/monitoring/api/v3/filters) specifies which metric + * descriptors are to be returned. For example, the following filter matches all [custom + * metrics](/monitoring/custom-metrics): + * <p>metric.type = starts_with("custom.googleapis.com/") * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PagedListResponse< @@ -537,9 +535,11 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + * Lists metric descriptors that match a filter. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -565,9 +565,11 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + * Lists metric descriptors that match a filter. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -594,9 +596,11 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists metric descriptors that match a filter. This method does not require a Stackdriver account. + * Lists metric descriptors that match a filter. This method does not require a Stackdriver + * account. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -629,7 +633,8 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( /** * Gets a single metric descriptor. This method does not require a Stackdriver account. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMetricDescriptorPathName("[PROJECT]", "[METRIC_DESCRIPTOR_PATH]"); @@ -638,9 +643,8 @@ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor( * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is - * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example value of `{metric_id}` is - * `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example value of + * `{metric_id}` is `"compute.googleapis.com/instance/disk/read_bytes_count"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final MetricDescriptor getMetricDescriptor(String name) { @@ -654,7 +658,8 @@ public final MetricDescriptor getMetricDescriptor(String name) { /** * Gets a single metric descriptor. This method does not require a Stackdriver account. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMetricDescriptorPathName("[PROJECT]", "[METRIC_DESCRIPTOR_PATH]"); @@ -676,7 +681,8 @@ private final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest re /** * Gets a single metric descriptor. This method does not require a Stackdriver account. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMetricDescriptorPathName("[PROJECT]", "[METRIC_DESCRIPTOR_PATH]"); @@ -696,11 +702,11 @@ private final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest re // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new metric descriptor. - * User-created metric descriptors define - * [custom metrics](/monitoring/custom-metrics). + * Creates a new metric descriptor. User-created metric descriptors define [custom + * metrics](/monitoring/custom-metrics). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -710,9 +716,8 @@ private final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest re * </code></pre> * * @param name The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param metricDescriptor The new [custom metric](/monitoring/custom-metrics) - * descriptor. + * `"projects/{project_id_or_number}"`. + * @param metricDescriptor The new [custom metric](/monitoring/custom-metrics) descriptor. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final MetricDescriptor createMetricDescriptor( @@ -728,11 +733,11 @@ public final MetricDescriptor createMetricDescriptor( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new metric descriptor. - * User-created metric descriptors define - * [custom metrics](/monitoring/custom-metrics). + * Creates a new metric descriptor. User-created metric descriptors define [custom + * metrics](/monitoring/custom-metrics). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -754,11 +759,11 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new metric descriptor. - * User-created metric descriptors define - * [custom metrics](/monitoring/custom-metrics). + * Creates a new metric descriptor. User-created metric descriptors define [custom + * metrics](/monitoring/custom-metrics). + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -780,10 +785,11 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](/monitoring/custom-metrics) can be deleted. + * Deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can + * be deleted. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMetricDescriptorPathName("[PROJECT]", "[METRIC_DESCRIPTOR_PATH]"); @@ -792,9 +798,8 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque * </code></pre> * * @param name The metric descriptor on which to execute the request. The format is - * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example of `{metric_id}` is: - * `"custom.googleapis.com/my_test_metric"`. + * `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. An example of + * `{metric_id}` is: `"custom.googleapis.com/my_test_metric"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void deleteMetricDescriptor(String name) { @@ -806,10 +811,11 @@ public final void deleteMetricDescriptor(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](/monitoring/custom-metrics) can be deleted. + * Deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can + * be deleted. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMetricDescriptorPathName("[PROJECT]", "[METRIC_DESCRIPTOR_PATH]"); @@ -829,10 +835,11 @@ private final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a metric descriptor. Only user-created - * [custom metrics](/monitoring/custom-metrics) can be deleted. + * Deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can + * be deleted. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatMetricDescriptorPathName("[PROJECT]", "[METRIC_DESCRIPTOR_PATH]"); @@ -853,7 +860,8 @@ public final ApiCallable<DeleteMetricDescriptorRequest, Empty> deleteMetricDescr /** * Lists time series that match a filter. This method does not require a Stackdriver account. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -888,7 +896,8 @@ public final ApiCallable<DeleteMetricDescriptorRequest, Empty> deleteMetricDescr /** * Lists time series that match a filter. This method does not require a Stackdriver account. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -924,7 +933,8 @@ public final ApiCallable<DeleteMetricDescriptorRequest, Empty> deleteMetricDescr /** * Lists time series that match a filter. This method does not require a Stackdriver account. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -962,12 +972,12 @@ public final ApiCallable<ListTimeSeriesRequest, ListTimeSeriesResponse> listTime // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. + * Creates or adds data to one or more time series. The response is empty if all time series in + * the request were written. If any time series could not be written, a corresponding failure + * message is included in the error response. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -977,12 +987,11 @@ public final ApiCallable<ListTimeSeriesRequest, ListTimeSeriesResponse> listTime * </code></pre> * * @param name The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. - * @param timeSeries The new data to be added to a list of time series. - * Adds at most one data point to each of several time series. The new data - * point must be more recent than any other point in its time series. Each - * `TimeSeries` value must fully specify a unique time series by supplying - * all label values for the metric and the monitored resource. + * `"projects/{project_id_or_number}"`. + * @param timeSeries The new data to be added to a list of time series. Adds at most one data + * point to each of several time series. The new data point must be more recent than any other + * point in its time series. Each `TimeSeries` value must fully specify a unique time series + * by supplying all label values for the metric and the monitored resource. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void createTimeSeries(String name, List<TimeSeries> timeSeries) { @@ -994,12 +1003,12 @@ public final void createTimeSeries(String name, List<TimeSeries> timeSeries) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. + * Creates or adds data to one or more time series. The response is empty if all time series in + * the request were written. If any time series could not be written, a corresponding failure + * message is included in the error response. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); @@ -1021,12 +1030,12 @@ public final void createTimeSeries(CreateTimeSeriesRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates or adds data to one or more time series. - * The response is empty if all time series in the request were written. - * If any time series could not be written, a corresponding failure message is - * included in the error response. + * Creates or adds data to one or more time series. The response is empty if all time series in + * the request were written. If any time series could not be written, a corresponding failure + * message is included in the error response. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { * String formattedName = MetricServiceApi.formatProjectName("[PROJECT]"); diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java index dd1ec8c244ca..c7c89badb66d 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java @@ -16,7 +16,6 @@ import com.google.api.MetricDescriptor; import com.google.api.MonitoredResourceDescriptor; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -57,15 +56,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (monitoring.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (monitoring.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of getMonitoredResourceDescriptor to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getMonitoredResourceDescriptor to 30 seconds: * * <pre> * <code> @@ -79,25 +77,17 @@ */ @javax.annotation.Generated("by GAPIC") public class MetricServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "monitoring.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -125,9 +115,7 @@ public class MetricServiceSettings extends ServiceApiSettings { listTimeSeriesSettings; private final SimpleCallSettings<CreateTimeSeriesRequest, Empty> createTimeSeriesSettings; - /** - * Returns the object with the settings used for calls to listMonitoredResourceDescriptors. - */ + /** Returns the object with the settings used for calls to listMonitoredResourceDescriptors. */ public PageStreamingCallSettings< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, MonitoredResourceDescriptor> @@ -135,99 +123,73 @@ public class MetricServiceSettings extends ServiceApiSettings { return listMonitoredResourceDescriptorsSettings; } - /** - * Returns the object with the settings used for calls to getMonitoredResourceDescriptor. - */ + /** Returns the object with the settings used for calls to getMonitoredResourceDescriptor. */ public SimpleCallSettings<GetMonitoredResourceDescriptorRequest, MonitoredResourceDescriptor> getMonitoredResourceDescriptorSettings() { return getMonitoredResourceDescriptorSettings; } - /** - * Returns the object with the settings used for calls to listMetricDescriptors. - */ + /** Returns the object with the settings used for calls to listMetricDescriptors. */ public PageStreamingCallSettings< ListMetricDescriptorsRequest, ListMetricDescriptorsResponse, MetricDescriptor> listMetricDescriptorsSettings() { return listMetricDescriptorsSettings; } - /** - * Returns the object with the settings used for calls to getMetricDescriptor. - */ + /** Returns the object with the settings used for calls to getMetricDescriptor. */ public SimpleCallSettings<GetMetricDescriptorRequest, MetricDescriptor> getMetricDescriptorSettings() { return getMetricDescriptorSettings; } - /** - * Returns the object with the settings used for calls to createMetricDescriptor. - */ + /** Returns the object with the settings used for calls to createMetricDescriptor. */ public SimpleCallSettings<CreateMetricDescriptorRequest, MetricDescriptor> createMetricDescriptorSettings() { return createMetricDescriptorSettings; } - /** - * Returns the object with the settings used for calls to deleteMetricDescriptor. - */ + /** Returns the object with the settings used for calls to deleteMetricDescriptor. */ public SimpleCallSettings<DeleteMetricDescriptorRequest, Empty> deleteMetricDescriptorSettings() { return deleteMetricDescriptorSettings; } - /** - * Returns the object with the settings used for calls to listTimeSeries. - */ + /** Returns the object with the settings used for calls to listTimeSeries. */ public PageStreamingCallSettings<ListTimeSeriesRequest, ListTimeSeriesResponse, TimeSeries> listTimeSeriesSettings() { return listTimeSeriesSettings; } - /** - * Returns the object with the settings used for calls to createTimeSeries. - */ + /** Returns the object with the settings used for calls to createTimeSeries. */ public SimpleCallSettings<CreateTimeSeriesRequest, Empty> createTimeSeriesSettings() { return createTimeSeriesSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -375,9 +337,7 @@ public Iterable<TimeSeries> extractResources(ListTimeSeriesResponse payload) { } }; - /** - * Builder for MetricServiceSettings. - */ + /** Builder for MetricServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -598,18 +558,15 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. - */ + /** Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. */ public PageStreamingCallSettings.Builder< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse, MonitoredResourceDescriptor> @@ -617,60 +574,46 @@ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) thr return listMonitoredResourceDescriptorsSettings; } - /** - * Returns the builder for the settings used for calls to getMonitoredResourceDescriptor. - */ + /** Returns the builder for the settings used for calls to getMonitoredResourceDescriptor. */ public SimpleCallSettings.Builder< GetMonitoredResourceDescriptorRequest, MonitoredResourceDescriptor> getMonitoredResourceDescriptorSettings() { return getMonitoredResourceDescriptorSettings; } - /** - * Returns the builder for the settings used for calls to listMetricDescriptors. - */ + /** Returns the builder for the settings used for calls to listMetricDescriptors. */ public PageStreamingCallSettings.Builder< ListMetricDescriptorsRequest, ListMetricDescriptorsResponse, MetricDescriptor> listMetricDescriptorsSettings() { return listMetricDescriptorsSettings; } - /** - * Returns the builder for the settings used for calls to getMetricDescriptor. - */ + /** Returns the builder for the settings used for calls to getMetricDescriptor. */ public SimpleCallSettings.Builder<GetMetricDescriptorRequest, MetricDescriptor> getMetricDescriptorSettings() { return getMetricDescriptorSettings; } - /** - * Returns the builder for the settings used for calls to createMetricDescriptor. - */ + /** Returns the builder for the settings used for calls to createMetricDescriptor. */ public SimpleCallSettings.Builder<CreateMetricDescriptorRequest, MetricDescriptor> createMetricDescriptorSettings() { return createMetricDescriptorSettings; } - /** - * Returns the builder for the settings used for calls to deleteMetricDescriptor. - */ + /** Returns the builder for the settings used for calls to deleteMetricDescriptor. */ public SimpleCallSettings.Builder<DeleteMetricDescriptorRequest, Empty> deleteMetricDescriptorSettings() { return deleteMetricDescriptorSettings; } - /** - * Returns the builder for the settings used for calls to listTimeSeries. - */ + /** Returns the builder for the settings used for calls to listTimeSeries. */ public PageStreamingCallSettings.Builder< ListTimeSeriesRequest, ListTimeSeriesResponse, TimeSeries> listTimeSeriesSettings() { return listTimeSeriesSettings; } - /** - * Returns the builder for the settings used for calls to createTimeSeries. - */ + /** Returns the builder for the settings used for calls to createTimeSeries. */ public SimpleCallSettings.Builder<CreateTimeSeriesRequest, Empty> createTimeSeriesSettings() { return createTimeSeriesSettings; } diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java index d37c7e7690ff..9d1a0e61adb7 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/package-info.java @@ -15,26 +15,22 @@ /** * A client to Stackdriver Monitoring API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * =============== - * GroupServiceApi - * =============== + * <p>=============== GroupServiceApi =============== * - * Service Description: The Group API lets you inspect and manage your + * <p>Service Description: The Group API lets you inspect and manage your * [groups](google.monitoring.v3.Group). * - * A group is a named filter that is used to identify - * a collection of monitored resources. Groups are typically used to - * mirror the physical and/or logical topology of the environment. - * Because group membership is computed dynamically, monitored - * resources that are started in the future are automatically placed - * in matching groups. By using a group to name monitored resources in, - * for example, an alert policy, the target of that alert policy is - * updated automatically as monitored resources are added and removed - * from the infrastructure. - * - * Sample for GroupServiceApi: + * <p>A group is a named filter that is used to identify a collection of monitored resources. Groups + * are typically used to mirror the physical and/or logical topology of the environment. Because + * group membership is computed dynamically, monitored resources that are started in the future are + * automatically placed in matching groups. By using a group to name monitored resources in, for + * example, an alert policy, the target of that alert policy is updated automatically as monitored + * resources are added and removed from the infrastructure. + * + * <p>Sample for GroupServiceApi: + * * <pre> * <code> * try (GroupServiceApi groupServiceApi = GroupServiceApi.create()) { @@ -44,14 +40,13 @@ * </code> * </pre> * - * ================ - * MetricServiceApi - * ================ + * ================ MetricServiceApi ================ + * + * <p>Service Description: Manages metric descriptors, monitored resource descriptors, and time + * series data. * - * Service Description: Manages metric descriptors, monitored resource descriptors, and - * time series data. + * <p>Sample for MetricServiceApi: * - * Sample for MetricServiceApi: * <pre> * <code> * try (MetricServiceApi metricServiceApi = MetricServiceApi.create()) { @@ -61,15 +56,14 @@ * </code> * </pre> * - * ========================== - * AgentTranslationServiceApi - * ========================== + * ========================== AgentTranslationServiceApi ========================== * - * Service Description: The AgentTranslation API allows `collectd`-based agents to - * write time series data to Cloud Monitoring. - * See [google.monitoring.v3.MetricService.CreateTimeSeries] instead. + * <p>Service Description: The AgentTranslation API allows `collectd`-based agents to write time + * series data to Cloud Monitoring. See [google.monitoring.v3.MetricService.CreateTimeSeries] + * instead. + * + * <p>Sample for AgentTranslationServiceApi: * - * Sample for AgentTranslationServiceApi: * <pre> * <code> * try (AgentTranslationServiceApi agentTranslationServiceApi = AgentTranslationServiceApi.create()) { @@ -81,6 +75,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.monitoring.spi.v3; diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceTest.java index 21921b188880..5e622b537d0e 100644 --- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceTest.java +++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceTest.java @@ -15,10 +15,8 @@ package com.google.cloud.monitoring.spi.v3; import com.google.api.MonitoredResource; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.testing.MockGrpcService; import com.google.api.gax.testing.MockServiceHelper; -import com.google.common.collect.Lists; import com.google.monitoring.v3.CollectdPayload; import com.google.monitoring.v3.CreateCollectdTimeSeriesRequest; import com.google.protobuf.Empty; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java index 717563c89914..be922966c3c3 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherApi.java @@ -56,32 +56,31 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the publisherApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the publisherApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - * <p>This class can be customized by passing in a custom instance of PublisherSettings to - * create(). For example: + * <p>This class can be customized by passing in a custom instance of PublisherSettings to create(). + * For example: * * <pre> * <code> @@ -124,68 +123,49 @@ public class PublisherApi implements AutoCloseable { private static final PathTemplate TOPIC_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/topics/{topic}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Formats a string containing the fully-qualified path to represent - * a topic resource. - */ + /** Formats a string containing the fully-qualified path to represent a topic resource. */ public static final String formatTopicName(String project, String topic) { return TOPIC_PATH_TEMPLATE.instantiate( "project", project, "topic", topic); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } - /** - * Parses the project from the given fully-qualified path which - * represents a topic resource. - */ + /** Parses the project from the given fully-qualified path which represents a topic resource. */ public static final String parseProjectFromTopicName(String topicName) { return TOPIC_PATH_TEMPLATE.parse(topicName).get("project"); } - /** - * Parses the topic from the given fully-qualified path which - * represents a topic resource. - */ + /** Parses the topic from the given fully-qualified path which represents a topic resource. */ public static final String parseTopicFromTopicName(String topicName) { return TOPIC_PATH_TEMPLATE.parse(topicName).get("topic"); } - /** - * Constructs an instance of PublisherApi with default settings. - */ + /** Constructs an instance of PublisherApi with default settings. */ public static final PublisherApi create() throws IOException { return create(PublisherSettings.defaultBuilder().build()); } /** - * Constructs an instance of PublisherApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of PublisherApi, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. */ public static final PublisherApi create(PublisherSettings settings) throws IOException { return new PublisherApi(settings); } /** - * Constructs an instance of PublisherApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of PublisherApi, using the given settings. This is protected so that it + * easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected PublisherApi(PublisherSettings settings) throws IOException { this.settings = settings; @@ -247,7 +227,8 @@ public final PublisherSettings getSettings() { /** * Creates the given topic with the given name. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedName = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -256,11 +237,10 @@ public final PublisherSettings getSettings() { * </code></pre> * * @param name The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - * and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - * underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - * signs (`%`). It must be between 3 and 255 characters in length, and it - * must not start with `"goog"`. + * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only + * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), + * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in + * length, and it must not start with `"goog"`. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Topic createTopic(String name) { @@ -273,7 +253,8 @@ public final Topic createTopic(String name) { /** * Creates the given topic with the given name. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedName = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -295,7 +276,8 @@ private final Topic createTopic(Topic request) { /** * Creates the given topic with the given name. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedName = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -314,11 +296,12 @@ public final ApiCallable<Topic, Topic> createTopicCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - * does not exist. The message payload must not be empty; it must contain - * either a non-empty data field, or at least one attribute. + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The + * message payload must not be empty; it must contain either a non-empty data field, or at least + * one attribute. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -344,11 +327,12 @@ public final PublishResponse publish(String topic, List<PubsubMessage> messages) // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - * does not exist. The message payload must not be empty; it must contain - * either a non-empty data field, or at least one attribute. + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The + * message payload must not be empty; it must contain either a non-empty data field, or at least + * one attribute. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -374,11 +358,12 @@ public final PublishResponse publish(PublishRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - * does not exist. The message payload must not be empty; it must contain - * either a non-empty data field, or at least one attribute. + * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist. The + * message payload must not be empty; it must contain either a non-empty data field, or at least + * one attribute. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -405,7 +390,8 @@ public final ApiCallable<PublishRequest, PublishResponse> publishCallable() { /** * Gets the configuration of a topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -426,7 +412,8 @@ public final Topic getTopic(String topic) { /** * Gets the configuration of a topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -448,7 +435,8 @@ private final Topic getTopic(GetTopicRequest request) { /** * Gets the configuration of a topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -469,7 +457,8 @@ public final ApiCallable<GetTopicRequest, Topic> getTopicCallable() { /** * Lists matching topics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedProject = PublisherApi.formatProjectName("[PROJECT]"); @@ -493,7 +482,8 @@ public final PagedListResponse<ListTopicsRequest, ListTopicsResponse, Topic> lis /** * Lists matching topics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedProject = PublisherApi.formatProjectName("[PROJECT]"); @@ -518,7 +508,8 @@ public final PagedListResponse<ListTopicsRequest, ListTopicsResponse, Topic> lis /** * Lists matching topics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedProject = PublisherApi.formatProjectName("[PROJECT]"); @@ -543,7 +534,8 @@ public final PagedListResponse<ListTopicsRequest, ListTopicsResponse, Topic> lis /** * Lists matching topics. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedProject = PublisherApi.formatProjectName("[PROJECT]"); @@ -573,7 +565,8 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab /** * Lists the name of the subscriptions for this topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -599,7 +592,8 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab /** * Lists the name of the subscriptions for this topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -625,7 +619,8 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab /** * Lists the name of the subscriptions for this topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -651,7 +646,8 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab /** * Lists the name of the subscriptions for this topic. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -680,13 +676,13 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a + * topic is deleted, a new topic may be created with the same name; this is an entirely new topic + * with none of the old configuration or subscriptions. Existing subscriptions to this topic are * not deleted, but their `topic` field is set to `_deleted-topic_`. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -705,13 +701,13 @@ public final void deleteTopic(String topic) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a + * topic is deleted, a new topic may be created with the same name; this is an entirely new topic + * with none of the old configuration or subscriptions. Existing subscriptions to this topic are * not deleted, but their `topic` field is set to `_deleted-topic_`. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -731,13 +727,13 @@ private final void deleteTopic(DeleteTopicRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a + * topic is deleted, a new topic may be created with the same name; this is an entirely new topic + * with none of the old configuration or subscriptions. Existing subscriptions to this topic are * not deleted, but their `topic` field is set to `_deleted-topic_`. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedTopic = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -756,10 +752,10 @@ public final ApiCallable<DeleteTopicRequest, Empty> deleteTopicCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -768,12 +764,11 @@ public final ApiCallable<DeleteTopicRequest, Empty> deleteTopicCallable() { * } * </code></pre> * - * @param resource REQUIRED: The resource for which policy is being specified. - * Resource is usually specified as a path, such as, - * projects/{project}/zones/{zone}/disks/{disk}. - * @param policy REQUIRED: The complete policy to be applied to the 'resource'. The size of - * the policy is limited to a few 10s of KB. An empty policy is in general a - * valid policy but certain services (like Projects) might reject them. + * @param resource REQUIRED: The resource for which policy is being specified. Resource is usually + * specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}. + * @param policy REQUIRED: The complete policy to be applied to the 'resource'. The size of the + * policy is limited to a few 10s of KB. An empty policy is in general a valid policy but + * certain services (like Projects) might reject them. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Policy setIamPolicy(String resource, Policy policy) { @@ -785,10 +780,10 @@ public final Policy setIamPolicy(String resource, Policy policy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -810,10 +805,10 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -834,10 +829,11 @@ public final ApiCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a resource. Is empty if the - * policy or the resource does not exist. + * Gets the access control policy for a resource. Is empty if the policy or the resource does not + * exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -845,8 +841,8 @@ public final ApiCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { * } * </code></pre> * - * @param resource REQUIRED: The resource for which policy is being requested. Resource - * is usually specified as a path, such as, projects/{project}. + * @param resource REQUIRED: The resource for which policy is being requested. Resource is usually + * specified as a path, such as, projects/{project}. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Policy getIamPolicy(String resource) { @@ -857,10 +853,11 @@ public final Policy getIamPolicy(String resource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a resource. Is empty if the - * policy or the resource does not exist. + * Gets the access control policy for a resource. Is empty if the policy or the resource does not + * exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -880,10 +877,11 @@ private final Policy getIamPolicy(GetIamPolicyRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a resource. Is empty if the - * policy or the resource does not exist. + * Gets the access control policy for a resource. Is empty if the policy or the resource does not + * exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -904,7 +902,8 @@ public final ApiCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { /** * Returns permissions that a caller has on the specified resource. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -913,10 +912,10 @@ public final ApiCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { * } * </code></pre> * - * @param resource REQUIRED: The resource for which policy detail is being requested. - * Resource is usually specified as a path, such as, projects/{project}. + * @param resource REQUIRED: The resource for which policy detail is being requested. Resource is + * usually specified as a path, such as, projects/{project}. * @param permissions The set of permissions to check for the 'resource'. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. + * wildcards (such as '*' or 'storage.*') are not allowed. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final TestIamPermissionsResponse testIamPermissions( @@ -934,7 +933,8 @@ public final TestIamPermissionsResponse testIamPermissions( /** * Returns permissions that a caller has on the specified resource. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); @@ -958,7 +958,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq /** * Returns permissions that a caller has on the specified resource. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (PublisherApi publisherApi = PublisherApi.create()) { * String formattedResource = PublisherApi.formatTopicName("[PROJECT]", "[TOPIC]"); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java index 53089e87744f..8c50b07d0d06 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/PublisherSettings.java @@ -14,7 +14,6 @@ package com.google.cloud.pubsub.spi.v1; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.BundlingCallSettings; @@ -65,15 +64,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (pubsub.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (pubsub.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of createTopic to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createTopic to 30 seconds: * * <pre> * <code> @@ -87,28 +85,20 @@ */ @javax.annotation.Generated("by GAPIC") public class PublisherSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "pubsub.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder() .add("https://www.googleapis.com/auth/cloud-platform") .add("https://www.googleapis.com/auth/pubsub") .build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -130,111 +120,81 @@ public class PublisherSettings extends ServiceApiSettings { private final SimpleCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings; - /** - * Returns the object with the settings used for calls to createTopic. - */ + /** Returns the object with the settings used for calls to createTopic. */ public SimpleCallSettings<Topic, Topic> createTopicSettings() { return createTopicSettings; } - /** - * Returns the object with the settings used for calls to publish. - */ + /** Returns the object with the settings used for calls to publish. */ public BundlingCallSettings<PublishRequest, PublishResponse> publishSettings() { return publishSettings; } - /** - * Returns the object with the settings used for calls to getTopic. - */ + /** Returns the object with the settings used for calls to getTopic. */ public SimpleCallSettings<GetTopicRequest, Topic> getTopicSettings() { return getTopicSettings; } - /** - * Returns the object with the settings used for calls to listTopics. - */ + /** Returns the object with the settings used for calls to listTopics. */ public PageStreamingCallSettings<ListTopicsRequest, ListTopicsResponse, Topic> listTopicsSettings() { return listTopicsSettings; } - /** - * Returns the object with the settings used for calls to listTopicSubscriptions. - */ + /** Returns the object with the settings used for calls to listTopicSubscriptions. */ public PageStreamingCallSettings< ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse, String> listTopicSubscriptionsSettings() { return listTopicSubscriptionsSettings; } - /** - * Returns the object with the settings used for calls to deleteTopic. - */ + /** Returns the object with the settings used for calls to deleteTopic. */ public SimpleCallSettings<DeleteTopicRequest, Empty> deleteTopicSettings() { return deleteTopicSettings; } - /** - * Returns the object with the settings used for calls to setIamPolicy. - */ + /** Returns the object with the settings used for calls to setIamPolicy. */ public SimpleCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() { return setIamPolicySettings; } - /** - * Returns the object with the settings used for calls to getIamPolicy. - */ + /** Returns the object with the settings used for calls to getIamPolicy. */ public SimpleCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() { return getIamPolicySettings; } - /** - * Returns the object with the settings used for calls to testIamPermissions. - */ + /** Returns the object with the settings used for calls to testIamPermissions. */ public SimpleCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings() { return testIamPermissionsSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -397,9 +357,7 @@ public long countBytes(PublishRequest request) { } }; - /** - * Builder for PublisherSettings. - */ + /** Builder for PublisherSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -639,77 +597,58 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to createTopic. - */ + /** Returns the builder for the settings used for calls to createTopic. */ public SimpleCallSettings.Builder<Topic, Topic> createTopicSettings() { return createTopicSettings; } - /** - * Returns the builder for the settings used for calls to publish. - */ + /** Returns the builder for the settings used for calls to publish. */ public BundlingCallSettings.Builder<PublishRequest, PublishResponse> publishSettings() { return publishSettings; } - /** - * Returns the builder for the settings used for calls to getTopic. - */ + /** Returns the builder for the settings used for calls to getTopic. */ public SimpleCallSettings.Builder<GetTopicRequest, Topic> getTopicSettings() { return getTopicSettings; } - /** - * Returns the builder for the settings used for calls to listTopics. - */ + /** Returns the builder for the settings used for calls to listTopics. */ public PageStreamingCallSettings.Builder<ListTopicsRequest, ListTopicsResponse, Topic> listTopicsSettings() { return listTopicsSettings; } - /** - * Returns the builder for the settings used for calls to listTopicSubscriptions. - */ + /** Returns the builder for the settings used for calls to listTopicSubscriptions. */ public PageStreamingCallSettings.Builder< ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse, String> listTopicSubscriptionsSettings() { return listTopicSubscriptionsSettings; } - /** - * Returns the builder for the settings used for calls to deleteTopic. - */ + /** Returns the builder for the settings used for calls to deleteTopic. */ public SimpleCallSettings.Builder<DeleteTopicRequest, Empty> deleteTopicSettings() { return deleteTopicSettings; } - /** - * Returns the builder for the settings used for calls to setIamPolicy. - */ + /** Returns the builder for the settings used for calls to setIamPolicy. */ public SimpleCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() { return setIamPolicySettings; } - /** - * Returns the builder for the settings used for calls to getIamPolicy. - */ + /** Returns the builder for the settings used for calls to getIamPolicy. */ public SimpleCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() { return getIamPolicySettings; } - /** - * Returns the builder for the settings used for calls to testIamPermissions. - */ + /** Returns the builder for the settings used for calls to testIamPermissions. */ public SimpleCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings() { return testIamPermissionsSettings; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java index 1d2a33d77990..3505cd9d1825 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberApi.java @@ -60,29 +60,28 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the subscriberApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the subscriberApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of SubscriberSettings to * create(). For example: @@ -130,94 +129,72 @@ public class SubscriberApi implements AutoCloseable { private static final PathTemplate TOPIC_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/topics/{topic}"); - /** - * Formats a string containing the fully-qualified path to represent - * a project resource. - */ + /** Formats a string containing the fully-qualified path to represent a project resource. */ public static final String formatProjectName(String project) { return PROJECT_PATH_TEMPLATE.instantiate("project", project); } - /** - * Formats a string containing the fully-qualified path to represent - * a subscription resource. - */ + /** Formats a string containing the fully-qualified path to represent a subscription resource. */ public static final String formatSubscriptionName(String project, String subscription) { return SUBSCRIPTION_PATH_TEMPLATE.instantiate( "project", project, "subscription", subscription); } - /** - * Formats a string containing the fully-qualified path to represent - * a topic resource. - */ + /** Formats a string containing the fully-qualified path to represent a topic resource. */ public static final String formatTopicName(String project, String topic) { return TOPIC_PATH_TEMPLATE.instantiate( "project", project, "topic", topic); } - /** - * Parses the project from the given fully-qualified path which - * represents a project resource. - */ + /** Parses the project from the given fully-qualified path which represents a project resource. */ public static final String parseProjectFromProjectName(String projectName) { return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); } /** - * Parses the project from the given fully-qualified path which - * represents a subscription resource. + * Parses the project from the given fully-qualified path which represents a subscription + * resource. */ public static final String parseProjectFromSubscriptionName(String subscriptionName) { return SUBSCRIPTION_PATH_TEMPLATE.parse(subscriptionName).get("project"); } /** - * Parses the subscription from the given fully-qualified path which - * represents a subscription resource. + * Parses the subscription from the given fully-qualified path which represents a subscription + * resource. */ public static final String parseSubscriptionFromSubscriptionName(String subscriptionName) { return SUBSCRIPTION_PATH_TEMPLATE.parse(subscriptionName).get("subscription"); } - /** - * Parses the project from the given fully-qualified path which - * represents a topic resource. - */ + /** Parses the project from the given fully-qualified path which represents a topic resource. */ public static final String parseProjectFromTopicName(String topicName) { return TOPIC_PATH_TEMPLATE.parse(topicName).get("project"); } - /** - * Parses the topic from the given fully-qualified path which - * represents a topic resource. - */ + /** Parses the topic from the given fully-qualified path which represents a topic resource. */ public static final String parseTopicFromTopicName(String topicName) { return TOPIC_PATH_TEMPLATE.parse(topicName).get("topic"); } - /** - * Constructs an instance of SubscriberApi with default settings. - */ + /** Constructs an instance of SubscriberApi with default settings. */ public static final SubscriberApi create() throws IOException { return create(SubscriberSettings.defaultBuilder().build()); } /** - * Constructs an instance of SubscriberApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of SubscriberApi, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. */ public static final SubscriberApi create(SubscriberSettings settings) throws IOException { return new SubscriberApi(settings); } /** - * Constructs an instance of SubscriberApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of SubscriberApi, using the given settings. This is protected so that it + * easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected SubscriberApi(SubscriberSettings settings) throws IOException { this.settings = settings; @@ -275,15 +252,15 @@ public final SubscriberSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a subscription to a given topic. - * If the subscription already exists, returns `ALREADY_EXISTS`. - * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * Creates a subscription to a given topic. If the subscription already exists, returns + * `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. * - * If the name is not provided in the request, the server will assign a random - * name for this subscription on the same project as the topic. Note that - * for REST API requests, you must specify a name. + * <p>If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic. Note that for REST API requests, you must + * specify a name. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedName = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -295,36 +272,28 @@ public final SubscriberSettings getSettings() { * </code></pre> * * @param name The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - * start with a letter, and contain only letters (`[A-Za-z]`), numbers - * (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - * plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - * in length, and it must not start with `"goog"`. - * @param topic The name of the topic from which this subscription is receiving messages. - * The value of this field will be `_deleted-topic_` if the topic has been - * deleted. - * @param pushConfig If push delivery is used with this subscription, this field is - * used to configure it. An empty `pushConfig` signifies that the subscriber - * will pull and ack messages using API methods. + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a + * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores + * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + * and 255 characters in length, and it must not start with `"goog"`. + * @param topic The name of the topic from which this subscription is receiving messages. The + * value of this field will be `_deleted-topic_` if the topic has been deleted. + * @param pushConfig If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack + * messages using API methods. * @param ackDeadlineSeconds This value is the maximum time after a subscriber receives a message - * before the subscriber should acknowledge the message. After message - * delivery but before the ack deadline expires and before the message is - * acknowledged, it is an outstanding message and will not be delivered - * again during that time (on a best-effort basis). - * - * For pull subscriptions, this value is used as the initial value for the ack - * deadline. To override this value for a given message, call - * `ModifyAckDeadline` with the corresponding `ack_id` if using - * pull. - * The maximum custom deadline you can specify is 600 seconds (10 minutes). - * - * For push delivery, this value is also used to set the request timeout for - * the call to the push endpoint. - * - * If the subscriber never acknowledges the message, the Pub/Sub - * system will eventually redeliver the message. - * - * If this parameter is 0, a default value of 10 seconds is used. + * before the subscriber should acknowledge the message. After message delivery but before the + * ack deadline expires and before the message is acknowledged, it is an outstanding message + * and will not be delivered again during that time (on a best-effort basis). + * <p>For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using pull. The maximum custom deadline you can specify is 600 seconds (10 + * minutes). + * <p>For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + * <p>If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * <p>If this parameter is 0, a default value of 10 seconds is used. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Subscription createSubscription( @@ -343,15 +312,15 @@ public final Subscription createSubscription( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a subscription to a given topic. - * If the subscription already exists, returns `ALREADY_EXISTS`. - * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * Creates a subscription to a given topic. If the subscription already exists, returns + * `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * + * <p>If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic. Note that for REST API requests, you must + * specify a name. * - * If the name is not provided in the request, the server will assign a random - * name for this subscription on the same project as the topic. Note that - * for REST API requests, you must specify a name. + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedName = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -373,15 +342,15 @@ public final Subscription createSubscription(Subscription request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a subscription to a given topic. - * If the subscription already exists, returns `ALREADY_EXISTS`. - * If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * Creates a subscription to a given topic. If the subscription already exists, returns + * `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. + * + * <p>If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic. Note that for REST API requests, you must + * specify a name. * - * If the name is not provided in the request, the server will assign a random - * name for this subscription on the same project as the topic. Note that - * for REST API requests, you must specify a name. + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedName = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -404,7 +373,8 @@ public final ApiCallable<Subscription, Subscription> createSubscriptionCallable( /** * Gets the configuration details of a subscription. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -426,7 +396,8 @@ public final Subscription getSubscription(String subscription) { /** * Gets the configuration details of a subscription. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -448,7 +419,8 @@ private final Subscription getSubscription(GetSubscriptionRequest request) { /** * Gets the configuration details of a subscription. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -469,7 +441,8 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa /** * Lists matching subscriptions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedProject = SubscriberApi.formatProjectName("[PROJECT]"); @@ -494,7 +467,8 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa /** * Lists matching subscriptions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedProject = SubscriberApi.formatProjectName("[PROJECT]"); @@ -519,7 +493,8 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa /** * Lists matching subscriptions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedProject = SubscriberApi.formatProjectName("[PROJECT]"); @@ -545,7 +520,8 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa /** * Lists matching subscriptions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedProject = SubscriberApi.formatProjectName("[PROJECT]"); @@ -574,13 +550,13 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing subscription. All pending messages in the subscription - * are immediately dropped. Calls to `Pull` after deletion will return - * `NOT_FOUND`. After a subscription is deleted, a new one may be created with - * the same name, but the new one has no association with the old - * subscription, or its topic unless the same topic is specified. + * Deletes an existing subscription. All pending messages in the subscription are immediately + * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is + * deleted, a new one may be created with the same name, but the new one has no association with + * the old subscription, or its topic unless the same topic is specified. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -600,13 +576,13 @@ public final void deleteSubscription(String subscription) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing subscription. All pending messages in the subscription - * are immediately dropped. Calls to `Pull` after deletion will return - * `NOT_FOUND`. After a subscription is deleted, a new one may be created with - * the same name, but the new one has no association with the old - * subscription, or its topic unless the same topic is specified. + * Deletes an existing subscription. All pending messages in the subscription are immediately + * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is + * deleted, a new one may be created with the same name, but the new one has no association with + * the old subscription, or its topic unless the same topic is specified. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -626,13 +602,13 @@ private final void deleteSubscription(DeleteSubscriptionRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes an existing subscription. All pending messages in the subscription - * are immediately dropped. Calls to `Pull` after deletion will return - * `NOT_FOUND`. After a subscription is deleted, a new one may be created with - * the same name, but the new one has no association with the old - * subscription, or its topic unless the same topic is specified. + * Deletes an existing subscription. All pending messages in the subscription are immediately + * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is + * deleted, a new one may be created with the same name, but the new one has no association with + * the old subscription, or its topic unless the same topic is specified. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -651,13 +627,13 @@ public final ApiCallable<DeleteSubscriptionRequest, Empty> deleteSubscriptionCal // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the ack deadline for a specific message. This method is useful - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the + * Modifies the ack deadline for a specific message. This method is useful to indicate that more + * time is needed to process a message by the subscriber, or to make the message available for + * redelivery if the processing was interrupted. Note that this does not modify the * subscription-level `ackDeadlineSeconds` used for subsequent messages. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -669,11 +645,10 @@ public final ApiCallable<DeleteSubscriptionRequest, Empty> deleteSubscriptionCal * * @param subscription The name of the subscription. * @param ackIds List of acknowledgment IDs. - * @param ackDeadlineSeconds The new ack deadline with respect to the time this request was sent to - * the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new - * ack deadline will expire 10 seconds after the `ModifyAckDeadline` call - * was made. Specifying zero may immediately make the message available for - * another pull request. + * @param ackDeadlineSeconds The new ack deadline with respect to the time this request was sent + * to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack + * deadline will expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying + * zero may immediately make the message available for another pull request. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void modifyAckDeadline( @@ -690,13 +665,13 @@ public final void modifyAckDeadline( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the ack deadline for a specific message. This method is useful - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the + * Modifies the ack deadline for a specific message. This method is useful to indicate that more + * time is needed to process a message by the subscriber, or to make the message available for + * redelivery if the processing was interrupted. Note that this does not modify the * subscription-level `ackDeadlineSeconds` used for subsequent messages. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -720,13 +695,13 @@ public final void modifyAckDeadline(ModifyAckDeadlineRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Modifies the ack deadline for a specific message. This method is useful - * to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the + * Modifies the ack deadline for a specific message. This method is useful to indicate that more + * time is needed to process a message by the subscriber, or to make the message available for + * redelivery if the processing was interrupted. Note that this does not modify the * subscription-level `ackDeadlineSeconds` used for subsequent messages. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -749,15 +724,14 @@ public final ApiCallable<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineCalla // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. + * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The + * Pub/Sub system can remove the relevant messages from the subscription. * - * Acknowledging a message whose ack deadline has expired may succeed, - * but such a message may be redelivered later. Acknowledging a message more - * than once will not result in an error. + * <p>Acknowledging a message whose ack deadline has expired may succeed, but such a message may + * be redelivered later. Acknowledging a message more than once will not result in an error. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -767,8 +741,8 @@ public final ApiCallable<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineCalla * </code></pre> * * @param subscription The subscription whose message is being acknowledged. - * @param ackIds The acknowledgment ID for the messages being acknowledged that was returned - * by the Pub/Sub system in the `Pull` response. Must not be empty. + * @param ackIds The acknowledgment ID for the messages being acknowledged that was returned by + * the Pub/Sub system in the `Pull` response. Must not be empty. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void acknowledge(String subscription, List<String> ackIds) { @@ -780,15 +754,14 @@ public final void acknowledge(String subscription, List<String> ackIds) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. + * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The + * Pub/Sub system can remove the relevant messages from the subscription. + * + * <p>Acknowledging a message whose ack deadline has expired may succeed, but such a message may + * be redelivered later. Acknowledging a message more than once will not result in an error. * - * Acknowledging a message whose ack deadline has expired may succeed, - * but such a message may be redelivered later. Acknowledging a message more - * than once will not result in an error. + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -810,15 +783,14 @@ public final void acknowledge(AcknowledgeRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. + * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The + * Pub/Sub system can remove the relevant messages from the subscription. + * + * <p>Acknowledging a message whose ack deadline has expired may succeed, but such a message may + * be redelivered later. Acknowledging a message more than once will not result in an error. * - * Acknowledging a message whose ack deadline has expired may succeed, - * but such a message may be redelivered later. Acknowledging a message more - * than once will not result in an error. + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -839,12 +811,12 @@ public final ApiCallable<AcknowledgeRequest, Empty> acknowledgeCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Pulls messages from the server. Returns an empty list if there are no - * messages available in the backlog. The server may return `UNAVAILABLE` if - * there are too many concurrent pull requests pending for the given - * subscription. + * Pulls messages from the server. Returns an empty list if there are no messages available in the + * backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests + * pending for the given subscription. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -855,13 +827,12 @@ public final ApiCallable<AcknowledgeRequest, Empty> acknowledgeCallable() { * </code></pre> * * @param subscription The subscription from which messages should be pulled. - * @param returnImmediately If this is specified as true the system will respond immediately even if - * it is not able to return a message in the `Pull` response. Otherwise the - * system is allowed to wait until at least one message is available rather - * than returning no messages. The client may cancel the request if it does - * not wish to wait any longer for the response. - * @param maxMessages The maximum number of messages returned for this request. The Pub/Sub - * system may return fewer than the number specified. + * @param returnImmediately If this is specified as true the system will respond immediately even + * if it is not able to return a message in the `Pull` response. Otherwise the system is + * allowed to wait until at least one message is available rather than returning no messages. + * The client may cancel the request if it does not wish to wait any longer for the response. + * @param maxMessages The maximum number of messages returned for this request. The Pub/Sub system + * may return fewer than the number specified. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final PullResponse pull(String subscription, boolean returnImmediately, int maxMessages) { @@ -877,12 +848,12 @@ public final PullResponse pull(String subscription, boolean returnImmediately, i // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Pulls messages from the server. Returns an empty list if there are no - * messages available in the backlog. The server may return `UNAVAILABLE` if - * there are too many concurrent pull requests pending for the given - * subscription. + * Pulls messages from the server. Returns an empty list if there are no messages available in the + * backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests + * pending for the given subscription. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -904,12 +875,12 @@ public final PullResponse pull(PullRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Pulls messages from the server. Returns an empty list if there are no - * messages available in the backlog. The server may return `UNAVAILABLE` if - * there are too many concurrent pull requests pending for the given - * subscription. + * Pulls messages from the server. Returns an empty list if there are no messages available in the + * backlog. The server may return `UNAVAILABLE` if there are too many concurrent pull requests + * pending for the given subscription. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -932,12 +903,13 @@ public final ApiCallable<PullRequest, PullResponse> pullCallable() { /** * Modifies the `PushConfig` for a specified subscription. * - * This may be used to change a push subscription to a pull one (signified by - * an empty `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. + * <p>This may be used to change a push subscription to a pull one (signified by an empty + * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push + * subscription. Messages will accumulate for delivery continuously through the call regardless of + * changes to the `PushConfig`. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -948,11 +920,9 @@ public final ApiCallable<PullRequest, PullResponse> pullCallable() { * * @param subscription The name of the subscription. * @param pushConfig The push configuration for future deliveries. - * - * An empty `pushConfig` indicates that the Pub/Sub system should - * stop pushing messages from the given subscription and allow - * messages to be pulled and acknowledged - effectively pausing - * the subscription if `Pull` is not called. + * <p>An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages + * from the given subscription and allow messages to be pulled and acknowledged - effectively + * pausing the subscription if `Pull` is not called. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final void modifyPushConfig(String subscription, PushConfig pushConfig) { @@ -969,12 +939,13 @@ public final void modifyPushConfig(String subscription, PushConfig pushConfig) { /** * Modifies the `PushConfig` for a specified subscription. * - * This may be used to change a push subscription to a pull one (signified by - * an empty `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. + * <p>This may be used to change a push subscription to a pull one (signified by an empty + * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push + * subscription. Messages will accumulate for delivery continuously through the call regardless of + * changes to the `PushConfig`. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -998,12 +969,13 @@ public final void modifyPushConfig(ModifyPushConfigRequest request) { /** * Modifies the `PushConfig` for a specified subscription. * - * This may be used to change a push subscription to a pull one (signified by - * an empty `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. + * <p>This may be used to change a push subscription to a pull one (signified by an empty + * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push + * subscription. Messages will accumulate for delivery continuously through the call regardless of + * changes to the `PushConfig`. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedSubscription = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1024,10 +996,10 @@ public final ApiCallable<ModifyPushConfigRequest, Empty> modifyPushConfigCallabl // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1036,12 +1008,11 @@ public final ApiCallable<ModifyPushConfigRequest, Empty> modifyPushConfigCallabl * } * </code></pre> * - * @param resource REQUIRED: The resource for which policy is being specified. - * Resource is usually specified as a path, such as, - * projects/{project}/zones/{zone}/disks/{disk}. - * @param policy REQUIRED: The complete policy to be applied to the 'resource'. The size of - * the policy is limited to a few 10s of KB. An empty policy is in general a - * valid policy but certain services (like Projects) might reject them. + * @param resource REQUIRED: The resource for which policy is being specified. Resource is usually + * specified as a path, such as, projects/{project}/zones/{zone}/disks/{disk}. + * @param policy REQUIRED: The complete policy to be applied to the 'resource'. The size of the + * policy is limited to a few 10s of KB. An empty policy is in general a valid policy but + * certain services (like Projects) might reject them. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Policy setIamPolicy(String resource, Policy policy) { @@ -1053,10 +1024,10 @@ public final Policy setIamPolicy(String resource, Policy policy) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1078,10 +1049,10 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1102,10 +1073,11 @@ public final ApiCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a resource. Is empty if the - * policy or the resource does not exist. + * Gets the access control policy for a resource. Is empty if the policy or the resource does not + * exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1113,8 +1085,8 @@ public final ApiCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() { * } * </code></pre> * - * @param resource REQUIRED: The resource for which policy is being requested. Resource - * is usually specified as a path, such as, projects/{project}. + * @param resource REQUIRED: The resource for which policy is being requested. Resource is usually + * specified as a path, such as, projects/{project}. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final Policy getIamPolicy(String resource) { @@ -1125,10 +1097,11 @@ public final Policy getIamPolicy(String resource) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a resource. Is empty if the - * policy or the resource does not exist. + * Gets the access control policy for a resource. Is empty if the policy or the resource does not + * exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1148,10 +1121,11 @@ private final Policy getIamPolicy(GetIamPolicyRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets the access control policy for a resource. Is empty if the - * policy or the resource does not exist. + * Gets the access control policy for a resource. Is empty if the policy or the resource does not + * exist. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1172,7 +1146,8 @@ public final ApiCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { /** * Returns permissions that a caller has on the specified resource. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1181,10 +1156,10 @@ public final ApiCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() { * } * </code></pre> * - * @param resource REQUIRED: The resource for which policy detail is being requested. - * Resource is usually specified as a path, such as, projects/{project}. + * @param resource REQUIRED: The resource for which policy detail is being requested. Resource is + * usually specified as a path, such as, projects/{project}. * @param permissions The set of permissions to check for the 'resource'. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. + * wildcards (such as '*' or 'storage.*') are not allowed. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ public final TestIamPermissionsResponse testIamPermissions( @@ -1202,7 +1177,8 @@ public final TestIamPermissionsResponse testIamPermissions( /** * Returns permissions that a caller has on the specified resource. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); @@ -1226,7 +1202,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq /** * Returns permissions that a caller has on the specified resource. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { * String formattedResource = SubscriberApi.formatSubscriptionName("[PROJECT]", "[SUBSCRIPTION]"); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java index d29209d5e860..4396e5b692f9 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/SubscriberSettings.java @@ -14,7 +14,6 @@ package com.google.cloud.pubsub.spi.v1; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -59,15 +58,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (pubsub.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (pubsub.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of createSubscription to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createSubscription to 30 seconds: * * <pre> * <code> @@ -81,28 +79,20 @@ */ @javax.annotation.Generated("by GAPIC") public class SubscriberSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "pubsub.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder() .add("https://www.googleapis.com/auth/cloud-platform") .add("https://www.googleapis.com/auth/pubsub") .build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -125,124 +115,90 @@ public class SubscriberSettings extends ServiceApiSettings { private final SimpleCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings; - /** - * Returns the object with the settings used for calls to createSubscription. - */ + /** Returns the object with the settings used for calls to createSubscription. */ public SimpleCallSettings<Subscription, Subscription> createSubscriptionSettings() { return createSubscriptionSettings; } - /** - * Returns the object with the settings used for calls to getSubscription. - */ + /** Returns the object with the settings used for calls to getSubscription. */ public SimpleCallSettings<GetSubscriptionRequest, Subscription> getSubscriptionSettings() { return getSubscriptionSettings; } - /** - * Returns the object with the settings used for calls to listSubscriptions. - */ + /** Returns the object with the settings used for calls to listSubscriptions. */ public PageStreamingCallSettings< ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription> listSubscriptionsSettings() { return listSubscriptionsSettings; } - /** - * Returns the object with the settings used for calls to deleteSubscription. - */ + /** Returns the object with the settings used for calls to deleteSubscription. */ public SimpleCallSettings<DeleteSubscriptionRequest, Empty> deleteSubscriptionSettings() { return deleteSubscriptionSettings; } - /** - * Returns the object with the settings used for calls to modifyAckDeadline. - */ + /** Returns the object with the settings used for calls to modifyAckDeadline. */ public SimpleCallSettings<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineSettings() { return modifyAckDeadlineSettings; } - /** - * Returns the object with the settings used for calls to acknowledge. - */ + /** Returns the object with the settings used for calls to acknowledge. */ public SimpleCallSettings<AcknowledgeRequest, Empty> acknowledgeSettings() { return acknowledgeSettings; } - /** - * Returns the object with the settings used for calls to pull. - */ + /** Returns the object with the settings used for calls to pull. */ public SimpleCallSettings<PullRequest, PullResponse> pullSettings() { return pullSettings; } - /** - * Returns the object with the settings used for calls to modifyPushConfig. - */ + /** Returns the object with the settings used for calls to modifyPushConfig. */ public SimpleCallSettings<ModifyPushConfigRequest, Empty> modifyPushConfigSettings() { return modifyPushConfigSettings; } - /** - * Returns the object with the settings used for calls to setIamPolicy. - */ + /** Returns the object with the settings used for calls to setIamPolicy. */ public SimpleCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() { return setIamPolicySettings; } - /** - * Returns the object with the settings used for calls to getIamPolicy. - */ + /** Returns the object with the settings used for calls to getIamPolicy. */ public SimpleCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() { return getIamPolicySettings; } - /** - * Returns the object with the settings used for calls to testIamPermissions. - */ + /** Returns the object with the settings used for calls to testIamPermissions. */ public SimpleCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings() { return testIamPermissionsSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -309,9 +265,7 @@ public Iterable<Subscription> extractResources(ListSubscriptionsResponse payload } }; - /** - * Builder for SubscriberSettings. - */ + /** Builder for SubscriberSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -562,92 +516,69 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to createSubscription. - */ + /** Returns the builder for the settings used for calls to createSubscription. */ public SimpleCallSettings.Builder<Subscription, Subscription> createSubscriptionSettings() { return createSubscriptionSettings; } - /** - * Returns the builder for the settings used for calls to getSubscription. - */ + /** Returns the builder for the settings used for calls to getSubscription. */ public SimpleCallSettings.Builder<GetSubscriptionRequest, Subscription> getSubscriptionSettings() { return getSubscriptionSettings; } - /** - * Returns the builder for the settings used for calls to listSubscriptions. - */ + /** Returns the builder for the settings used for calls to listSubscriptions. */ public PageStreamingCallSettings.Builder< ListSubscriptionsRequest, ListSubscriptionsResponse, Subscription> listSubscriptionsSettings() { return listSubscriptionsSettings; } - /** - * Returns the builder for the settings used for calls to deleteSubscription. - */ + /** Returns the builder for the settings used for calls to deleteSubscription. */ public SimpleCallSettings.Builder<DeleteSubscriptionRequest, Empty> deleteSubscriptionSettings() { return deleteSubscriptionSettings; } - /** - * Returns the builder for the settings used for calls to modifyAckDeadline. - */ + /** Returns the builder for the settings used for calls to modifyAckDeadline. */ public SimpleCallSettings.Builder<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineSettings() { return modifyAckDeadlineSettings; } - /** - * Returns the builder for the settings used for calls to acknowledge. - */ + /** Returns the builder for the settings used for calls to acknowledge. */ public SimpleCallSettings.Builder<AcknowledgeRequest, Empty> acknowledgeSettings() { return acknowledgeSettings; } - /** - * Returns the builder for the settings used for calls to pull. - */ + /** Returns the builder for the settings used for calls to pull. */ public SimpleCallSettings.Builder<PullRequest, PullResponse> pullSettings() { return pullSettings; } - /** - * Returns the builder for the settings used for calls to modifyPushConfig. - */ + /** Returns the builder for the settings used for calls to modifyPushConfig. */ public SimpleCallSettings.Builder<ModifyPushConfigRequest, Empty> modifyPushConfigSettings() { return modifyPushConfigSettings; } - /** - * Returns the builder for the settings used for calls to setIamPolicy. - */ + /** Returns the builder for the settings used for calls to setIamPolicy. */ public SimpleCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() { return setIamPolicySettings; } - /** - * Returns the builder for the settings used for calls to getIamPolicy. - */ + /** Returns the builder for the settings used for calls to getIamPolicy. */ public SimpleCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() { return getIamPolicySettings; } - /** - * Returns the builder for the settings used for calls to testIamPermissions. - */ + /** Returns the builder for the settings used for calls to testIamPermissions. */ public SimpleCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse> testIamPermissionsSettings() { return testIamPermissionsSettings; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java index 1bac8a3590f9..99a7c0144671 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/package-info.java @@ -15,16 +15,15 @@ /** * A client to Google Cloud Pub/Sub API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * ============ - * PublisherApi - * ============ + * <p>============ PublisherApi ============ * - * Service Description: The service that an application uses to manipulate topics, and to send + * <p>Service Description: The service that an application uses to manipulate topics, and to send * messages to a topic. * - * Sample for PublisherApi: + * <p>Sample for PublisherApi: + * * <pre> * <code> * try (PublisherApi publisherApi = PublisherApi.create()) { @@ -34,14 +33,13 @@ * </code> * </pre> * - * ============= - * SubscriberApi - * ============= + * ============= SubscriberApi ============= * - * Service Description: The service that an application uses to manipulate subscriptions and to + * <p>Service Description: The service that an application uses to manipulate subscriptions and to * consume messages from a subscription via the `Pull` method. * - * Sample for SubscriberApi: + * <p>Sample for SubscriberApi: + * * <pre> * <code> * try (SubscriberApi subscriberApi = SubscriberApi.create()) { @@ -53,6 +51,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.pubsub.spi.v1; diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechApi.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechApi.java index 149793e08103..9ce5e2917edc 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechApi.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechApi.java @@ -14,7 +14,6 @@ package com.google.cloud.speech.spi.v1beta1; import com.google.api.gax.grpc.ApiCallable; -import com.google.api.gax.protobuf.PathTemplate; import com.google.cloud.speech.v1beta1.AsyncRecognizeRequest; import com.google.cloud.speech.v1beta1.RecognitionAudio; import com.google.cloud.speech.v1beta1.RecognitionConfig; @@ -45,32 +44,31 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the speechApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the speechApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * - * <p>This class can be customized by passing in a custom instance of SpeechSettings to - * create(). For example: + * <p>This class can be customized by passing in a custom instance of SpeechSettings to create(). + * For example: * * <pre> * <code> @@ -91,26 +89,22 @@ public class SpeechApi implements AutoCloseable { private final ApiCallable<SyncRecognizeRequest, SyncRecognizeResponse> syncRecognizeCallable; private final ApiCallable<AsyncRecognizeRequest, Operation> asyncRecognizeCallable; - /** - * Constructs an instance of SpeechApi with default settings. - */ + /** Constructs an instance of SpeechApi with default settings. */ public static final SpeechApi create() throws IOException { return create(SpeechSettings.defaultBuilder().build()); } /** - * Constructs an instance of SpeechApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of SpeechApi, using the given settings. The channels are created based + * on the settings passed in, or defaults for any settings that are not set. */ public static final SpeechApi create(SpeechSettings settings) throws IOException { return new SpeechApi(settings); } /** - * Constructs an instance of SpeechApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of SpeechApi, using the given settings. This is protected so that it + * easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected SpeechApi(SpeechSettings settings) throws IOException { this.settings = settings; @@ -148,10 +142,11 @@ public final SpeechSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Perform synchronous speech-recognition: receive results after all audio - * has been sent and processed. + * Perform synchronous speech-recognition: receive results after all audio has been sent and + * processed. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SpeechApi speechApi = SpeechApi.create()) { * RecognitionConfig config = RecognitionConfig.newBuilder().build(); @@ -160,8 +155,8 @@ public final SpeechSettings getSettings() { * } * </code></pre> * - * @param config [Required] The `config` message provides information to the recognizer - * that specifies how to process the request. + * @param config [Required] The `config` message provides information to the recognizer that + * specifies how to process the request. * @param audio [Required] The audio data to be recognized. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -174,10 +169,11 @@ public final SyncRecognizeResponse syncRecognize( // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Perform synchronous speech-recognition: receive results after all audio - * has been sent and processed. + * Perform synchronous speech-recognition: receive results after all audio has been sent and + * processed. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SpeechApi speechApi = SpeechApi.create()) { * RecognitionConfig config = RecognitionConfig.newBuilder().build(); @@ -199,10 +195,11 @@ public final SyncRecognizeResponse syncRecognize(SyncRecognizeRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Perform synchronous speech-recognition: receive results after all audio - * has been sent and processed. + * Perform synchronous speech-recognition: receive results after all audio has been sent and + * processed. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SpeechApi speechApi = SpeechApi.create()) { * RecognitionConfig config = RecognitionConfig.newBuilder().build(); @@ -223,12 +220,12 @@ public final ApiCallable<SyncRecognizeRequest, SyncRecognizeResponse> syncRecogn // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Perform asynchronous speech-recognition: receive results via the - * google.longrunning.Operations interface. Returns either an - * `Operation.error` or an `Operation.response` which contains - * an `AsyncRecognizeResponse` message. + * Perform asynchronous speech-recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains an + * `AsyncRecognizeResponse` message. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SpeechApi speechApi = SpeechApi.create()) { * RecognitionConfig config = RecognitionConfig.newBuilder().build(); @@ -237,8 +234,8 @@ public final ApiCallable<SyncRecognizeRequest, SyncRecognizeResponse> syncRecogn * } * </code></pre> * - * @param config [Required] The `config` message provides information to the recognizer - * that specifies how to process the request. + * @param config [Required] The `config` message provides information to the recognizer that + * specifies how to process the request. * @param audio [Required] The audio data to be recognized. * @throws com.google.api.gax.grpc.ApiException if the remote call fails */ @@ -250,12 +247,12 @@ public final Operation asyncRecognize(RecognitionConfig config, RecognitionAudio // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Perform asynchronous speech-recognition: receive results via the - * google.longrunning.Operations interface. Returns either an - * `Operation.error` or an `Operation.response` which contains - * an `AsyncRecognizeResponse` message. + * Perform asynchronous speech-recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains an + * `AsyncRecognizeResponse` message. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SpeechApi speechApi = SpeechApi.create()) { * RecognitionConfig config = RecognitionConfig.newBuilder().build(); @@ -277,12 +274,12 @@ public final Operation asyncRecognize(AsyncRecognizeRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Perform asynchronous speech-recognition: receive results via the - * google.longrunning.Operations interface. Returns either an - * `Operation.error` or an `Operation.response` which contains - * an `AsyncRecognizeResponse` message. + * Perform asynchronous speech-recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains an + * `AsyncRecognizeResponse` message. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (SpeechApi speechApi = SpeechApi.create()) { * RecognitionConfig config = RecognitionConfig.newBuilder().build(); diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java index 6cffd44dac83..ed78555815e4 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/SpeechSettings.java @@ -16,7 +16,6 @@ import com.google.api.gax.core.ConnectionSettings; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; -import com.google.api.gax.grpc.PageStreamingDescriptor; import com.google.api.gax.grpc.ServiceApiSettings; import com.google.api.gax.grpc.SimpleCallSettings; import com.google.auth.Credentials; @@ -44,15 +43,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (speech.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (speech.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of syncRecognize to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of syncRecognize to 30 seconds: * * <pre> * <code> @@ -66,25 +64,17 @@ */ @javax.annotation.Generated("by GAPIC") public class SpeechSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "speech.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -96,58 +86,42 @@ public class SpeechSettings extends ServiceApiSettings { syncRecognizeSettings; private final SimpleCallSettings<AsyncRecognizeRequest, Operation> asyncRecognizeSettings; - /** - * Returns the object with the settings used for calls to syncRecognize. - */ + /** Returns the object with the settings used for calls to syncRecognize. */ public SimpleCallSettings<SyncRecognizeRequest, SyncRecognizeResponse> syncRecognizeSettings() { return syncRecognizeSettings; } - /** - * Returns the object with the settings used for calls to asyncRecognize. - */ + /** Returns the object with the settings used for calls to asyncRecognize. */ public SimpleCallSettings<AsyncRecognizeRequest, Operation> asyncRecognizeSettings() { return asyncRecognizeSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -165,9 +139,7 @@ private SpeechSettings(Builder settingsBuilder) throws IOException { asyncRecognizeSettings = settingsBuilder.asyncRecognizeSettings().build(); } - /** - * Builder for SpeechSettings. - */ + /** Builder for SpeechSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -292,26 +264,21 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to syncRecognize. - */ + /** Returns the builder for the settings used for calls to syncRecognize. */ public SimpleCallSettings.Builder<SyncRecognizeRequest, SyncRecognizeResponse> syncRecognizeSettings() { return syncRecognizeSettings; } - /** - * Returns the builder for the settings used for calls to asyncRecognize. - */ + /** Returns the builder for the settings used for calls to asyncRecognize. */ public SimpleCallSettings.Builder<AsyncRecognizeRequest, Operation> asyncRecognizeSettings() { return asyncRecognizeSettings; } diff --git a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java index 8ec07dd8e306..e7348c17639b 100644 --- a/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java +++ b/google-cloud-speech/src/main/java/com/google/cloud/speech/spi/v1beta1/package-info.java @@ -15,15 +15,14 @@ /** * A client to Google Cloud Speech API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * ========= - * SpeechApi - * ========= + * <p>========= SpeechApi ========= * - * Service Description: Service that implements Google Cloud Speech API. + * <p>Service Description: Service that implements Google Cloud Speech API. + * + * <p>Sample for SpeechApi: * - * Sample for SpeechApi: * <pre> * <code> * try (SpeechApi speechApi = SpeechApi.create()) { @@ -33,6 +32,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.speech.spi.v1beta1; diff --git a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechTest.java b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechTest.java index a41f6bf15dc7..c59e64f80ddc 100644 --- a/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechTest.java +++ b/google-cloud-speech/src/test/java/com/google/cloud/speech/spi/v1beta1/SpeechTest.java @@ -14,7 +14,6 @@ package com.google.cloud.speech.spi.v1beta1; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.testing.MockGrpcService; import com.google.api.gax.testing.MockServiceHelper; import com.google.cloud.speech.v1beta1.AsyncRecognizeRequest; @@ -22,7 +21,6 @@ import com.google.cloud.speech.v1beta1.RecognitionConfig; import com.google.cloud.speech.v1beta1.SyncRecognizeRequest; import com.google.cloud.speech.v1beta1.SyncRecognizeResponse; -import com.google.common.collect.Lists; import com.google.longrunning.Operation; import com.google.protobuf.GeneratedMessageV3; import java.io.IOException; diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceApi.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceApi.java index 0342aa225dba..d990e788a3b6 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceApi.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceApi.java @@ -15,7 +15,6 @@ import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.grpc.ApiCallable; -import com.google.api.gax.protobuf.PathTemplate; import com.google.devtools.cloudtrace.v1.GetTraceRequest; import com.google.devtools.cloudtrace.v1.ListTracesRequest; import com.google.devtools.cloudtrace.v1.ListTracesResponse; @@ -33,10 +32,9 @@ // AUTO-GENERATED DOCUMENTATION AND SERVICE /** * Service Description: This file describes an API for collecting and viewing traces and spans - * within a trace. A Trace is a collection of spans corresponding to a single - * operation or set of operations for an application. A span is an individual - * timed event which forms a node of the trace tree. Spans for a single trace - * may span multiple services. + * within a trace. A Trace is a collection of spans corresponding to a single operation or set of + * operations for an application. A span is an individual timed event which forms a node of the + * trace tree. Spans for a single trace may span multiple services. * * <p>This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -51,29 +49,28 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the traceServiceApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the traceServiceApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of TraceServiceSettings to * create(). For example: @@ -101,26 +98,22 @@ public class TraceServiceApi implements AutoCloseable { ListTracesRequest, PagedListResponse<ListTracesRequest, ListTracesResponse, Trace>> listTracesPagedCallable; - /** - * Constructs an instance of TraceServiceApi with default settings. - */ + /** Constructs an instance of TraceServiceApi with default settings. */ public static final TraceServiceApi create() throws IOException { return create(TraceServiceSettings.defaultBuilder().build()); } /** - * Constructs an instance of TraceServiceApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of TraceServiceApi, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. */ public static final TraceServiceApi create(TraceServiceSettings settings) throws IOException { return new TraceServiceApi(settings); } /** - * Constructs an instance of TraceServiceApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of TraceServiceApi, using the given settings. This is protected so that + * it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected TraceServiceApi(TraceServiceSettings settings) throws IOException { this.settings = settings; @@ -162,13 +155,13 @@ public final TraceServiceSettings getSettings() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sends new traces to Cloud Trace or updates existing traces. If the ID of - * a trace that you send matches that of an existing trace, any fields - * in the existing trace and its spans are overwritten by the provided values, - * and any new fields provided are merged with the existing trace data. If the - * ID does not match, a new trace is created. + * Sends new traces to Cloud Trace or updates existing traces. If the ID of a trace that you send + * matches that of an existing trace, any fields in the existing trace and its spans are + * overwritten by the provided values, and any new fields provided are merged with the existing + * trace data. If the ID does not match, a new trace is created. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -189,13 +182,13 @@ public final void patchTraces(String projectId, Traces traces) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sends new traces to Cloud Trace or updates existing traces. If the ID of - * a trace that you send matches that of an existing trace, any fields - * in the existing trace and its spans are overwritten by the provided values, - * and any new fields provided are merged with the existing trace data. If the - * ID does not match, a new trace is created. + * Sends new traces to Cloud Trace or updates existing traces. If the ID of a trace that you send + * matches that of an existing trace, any fields in the existing trace and its spans are + * overwritten by the provided values, and any new fields provided are merged with the existing + * trace data. If the ID does not match, a new trace is created. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -217,13 +210,13 @@ public final void patchTraces(PatchTracesRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Sends new traces to Cloud Trace or updates existing traces. If the ID of - * a trace that you send matches that of an existing trace, any fields - * in the existing trace and its spans are overwritten by the provided values, - * and any new fields provided are merged with the existing trace data. If the - * ID does not match, a new trace is created. + * Sends new traces to Cloud Trace or updates existing traces. If the ID of a trace that you send + * matches that of an existing trace, any fields in the existing trace and its spans are + * overwritten by the provided values, and any new fields provided are merged with the existing + * trace data. If the ID does not match, a new trace is created. + * + * <p>Sample code: * - * Sample code: * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -246,7 +239,8 @@ public final ApiCallable<PatchTracesRequest, Empty> patchTracesCallable() { /** * Gets a single trace by its ID. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -269,7 +263,8 @@ public final Trace getTrace(String projectId, String traceId) { /** * Gets a single trace by its ID. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -293,7 +288,8 @@ private final Trace getTrace(GetTraceRequest request) { /** * Gets a single trace by its ID. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -316,7 +312,8 @@ public final ApiCallable<GetTraceRequest, Trace> getTraceCallable() { /** * Returns of a list of traces that match the specified filter conditions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -339,7 +336,8 @@ public final PagedListResponse<ListTracesRequest, ListTracesResponse, Trace> lis /** * Returns of a list of traces that match the specified filter conditions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -364,7 +362,8 @@ public final PagedListResponse<ListTracesRequest, ListTracesResponse, Trace> lis /** * Returns of a list of traces that match the specified filter conditions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; @@ -389,7 +388,8 @@ public final PagedListResponse<ListTracesRequest, ListTracesResponse, Trace> lis /** * Returns of a list of traces that match the specified filter conditions. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { * String projectId = ""; diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java index 39445d3c148b..698295f4b86b 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/TraceServiceSettings.java @@ -14,7 +14,6 @@ package com.google.cloud.trace.spi.v1; import com.google.api.gax.core.ConnectionSettings; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; import com.google.api.gax.grpc.PageStreamingCallSettings; @@ -48,15 +47,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (cloudtrace.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (cloudtrace.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of patchTraces to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of patchTraces to 30 seconds: * * <pre> * <code> @@ -70,19 +68,13 @@ */ @javax.annotation.Generated("by GAPIC") public class TraceServiceSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "cloudtrace.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder() .add("https://www.googleapis.com/auth/cloud-platform") @@ -90,9 +82,7 @@ public class TraceServiceSettings extends ServiceApiSettings { .add("https://www.googleapis.com/auth/trace.readonly") .build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -105,66 +95,48 @@ public class TraceServiceSettings extends ServiceApiSettings { private final PageStreamingCallSettings<ListTracesRequest, ListTracesResponse, Trace> listTracesSettings; - /** - * Returns the object with the settings used for calls to patchTraces. - */ + /** Returns the object with the settings used for calls to patchTraces. */ public SimpleCallSettings<PatchTracesRequest, Empty> patchTracesSettings() { return patchTracesSettings; } - /** - * Returns the object with the settings used for calls to getTrace. - */ + /** Returns the object with the settings used for calls to getTrace. */ public SimpleCallSettings<GetTraceRequest, Trace> getTraceSettings() { return getTraceSettings; } - /** - * Returns the object with the settings used for calls to listTraces. - */ + /** Returns the object with the settings used for calls to listTraces. */ public PageStreamingCallSettings<ListTracesRequest, ListTracesResponse, Trace> listTracesSettings() { return listTracesSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -219,9 +191,7 @@ public Iterable<Trace> extractResources(ListTracesResponse payload) { } }; - /** - * Builder for TraceServiceSettings. - */ + /** Builder for TraceServiceSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -358,32 +328,25 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to patchTraces. - */ + /** Returns the builder for the settings used for calls to patchTraces. */ public SimpleCallSettings.Builder<PatchTracesRequest, Empty> patchTracesSettings() { return patchTracesSettings; } - /** - * Returns the builder for the settings used for calls to getTrace. - */ + /** Returns the builder for the settings used for calls to getTrace. */ public SimpleCallSettings.Builder<GetTraceRequest, Trace> getTraceSettings() { return getTraceSettings; } - /** - * Returns the builder for the settings used for calls to listTraces. - */ + /** Returns the builder for the settings used for calls to listTraces. */ public PageStreamingCallSettings.Builder<ListTracesRequest, ListTracesResponse, Trace> listTracesSettings() { return listTracesSettings; diff --git a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java index 0d89aecc3319..ade6ff07dc7a 100644 --- a/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java +++ b/google-cloud-trace/src/main/java/com/google/cloud/trace/spi/v1/package-info.java @@ -15,19 +15,17 @@ /** * A client to Stackdriver Trace API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * =============== - * TraceServiceApi - * =============== + * <p>=============== TraceServiceApi =============== * - * Service Description: This file describes an API for collecting and viewing traces and spans - * within a trace. A Trace is a collection of spans corresponding to a single - * operation or set of operations for an application. A span is an individual - * timed event which forms a node of the trace tree. Spans for a single trace - * may span multiple services. + * <p>Service Description: This file describes an API for collecting and viewing traces and spans + * within a trace. A Trace is a collection of spans corresponding to a single operation or set of + * operations for an application. A span is an individual timed event which forms a node of the + * trace tree. Spans for a single trace may span multiple services. + * + * <p>Sample for TraceServiceApi: * - * Sample for TraceServiceApi: * <pre> * <code> * try (TraceServiceApi traceServiceApi = TraceServiceApi.create()) { @@ -37,6 +35,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.trace.spi.v1; diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorApi.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorApi.java index 461f37be77af..58672211034a 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorApi.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorApi.java @@ -14,7 +14,6 @@ package com.google.cloud.vision.spi.v1; import com.google.api.gax.grpc.ApiCallable; -import com.google.api.gax.protobuf.PathTemplate; import com.google.cloud.vision.v1.AnnotateImageRequest; import com.google.cloud.vision.v1.BatchAnnotateImagesRequest; import com.google.cloud.vision.v1.BatchAnnotateImagesResponse; @@ -28,8 +27,8 @@ // AUTO-GENERATED DOCUMENTATION AND SERVICE /** * Service Description: Service that performs Google Cloud Vision API detection tasks, such as face, - * landmark, logo, label, and text detection, over client images, and returns - * detected entities from the images. + * landmark, logo, label, and text detection, over client images, and returns detected entities from + * the images. * * <p>This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -43,29 +42,28 @@ * </code> * </pre> * - * <p>Note: close() needs to be called on the imageAnnotatorApi object to clean up resources such - * as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + * <p>Note: close() needs to be called on the imageAnnotatorApi object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * - * <p>The surface of this class includes several types of Java methods for each of the API's methods: + * <p>The surface of this class includes several types of Java methods for each of the API's + * methods: * * <ol> - * <li> A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available - * as parameters, and not every API method will have a flattened method entry point. - * <li> A "request object" method. This type of method only takes one parameter, a request - * object, which must be constructed before the call. Not every API method will have a request - * object method. - * <li> A "callable" method. This type of method takes no parameters and returns an immutable - * ApiCallable object, which can be used to initiate calls to the service. + * <li> A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + * <li> A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + * <li> A "callable" method. This type of method takes no parameters and returns an immutable + * ApiCallable object, which can be used to initiate calls to the service. * </ol> * * <p>See the individual methods for example code. * - * <p>Many parameters require resource names to be formatted in a particular way. To assist - * with these names, this class includes a format method for each type of name, and additionally - * a parse method to extract the individual identifiers contained within names that are - * returned. + * <p>Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. * * <p>This class can be customized by passing in a custom instance of ImageAnnotatorSettings to * create(). For example: @@ -89,26 +87,22 @@ public class ImageAnnotatorApi implements AutoCloseable { private final ApiCallable<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse> batchAnnotateImagesCallable; - /** - * Constructs an instance of ImageAnnotatorApi with default settings. - */ + /** Constructs an instance of ImageAnnotatorApi with default settings. */ public static final ImageAnnotatorApi create() throws IOException { return create(ImageAnnotatorSettings.defaultBuilder().build()); } /** - * Constructs an instance of ImageAnnotatorApi, using the given settings. - * The channels are created based on the settings passed in, or defaults for any - * settings that are not set. + * Constructs an instance of ImageAnnotatorApi, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. */ public static final ImageAnnotatorApi create(ImageAnnotatorSettings settings) throws IOException { return new ImageAnnotatorApi(settings); } /** - * Constructs an instance of ImageAnnotatorApi, using the given settings. - * This is protected so that it easy to make a subclass, but otherwise, the static - * factory methods should be preferred. + * Constructs an instance of ImageAnnotatorApi, using the given settings. This is protected so + * that it easy to make a subclass, but otherwise, the static factory methods should be preferred. */ protected ImageAnnotatorApi(ImageAnnotatorSettings settings) throws IOException { this.settings = settings; @@ -146,7 +140,8 @@ public final ImageAnnotatorSettings getSettings() { /** * Run image detection and annotation for a batch of images. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ImageAnnotatorApi imageAnnotatorApi = ImageAnnotatorApi.create()) { * List<AnnotateImageRequest> requests = new ArrayList<>(); @@ -168,7 +163,8 @@ public final BatchAnnotateImagesResponse batchAnnotateImages( /** * Run image detection and annotation for a batch of images. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ImageAnnotatorApi imageAnnotatorApi = ImageAnnotatorApi.create()) { * List<AnnotateImageRequest> requests = new ArrayList<>(); @@ -191,7 +187,8 @@ private final BatchAnnotateImagesResponse batchAnnotateImages( /** * Run image detection and annotation for a batch of images. * - * Sample code: + * <p>Sample code: + * * <pre><code> * try (ImageAnnotatorApi imageAnnotatorApi = ImageAnnotatorApi.create()) { * List<AnnotateImageRequest> requests = new ArrayList<>(); diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java index cb742141e4e0..e23eb9a78f52 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/ImageAnnotatorSettings.java @@ -16,7 +16,6 @@ import com.google.api.gax.core.ConnectionSettings; import com.google.api.gax.core.RetrySettings; import com.google.api.gax.grpc.ApiCallSettings; -import com.google.api.gax.grpc.PageStreamingDescriptor; import com.google.api.gax.grpc.ServiceApiSettings; import com.google.api.gax.grpc.SimpleCallSettings; import com.google.auth.Credentials; @@ -42,15 +41,14 @@ * <p>The default instance has everything set to sensible defaults: * * <ul> - * <li>The default service address (vision.googleapis.com) and default port (443) - * are used. - * <li>Credentials are acquired automatically through Application Default Credentials. - * <li>Retries are configured for idempotent methods but not for non-idempotent methods. + * <li>The default service address (vision.googleapis.com) and default port (443) are used. + * <li>Credentials are acquired automatically through Application Default Credentials. + * <li>Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * - * <p>The builder of this class is recursive, so contained classes are themselves builders. - * When build() is called, the tree of builders is called to create the complete settings - * object. For example, to set the total timeout of batchAnnotateImages to 30 seconds: + * <p>The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of batchAnnotateImages to 30 seconds: * * <pre> * <code> @@ -64,25 +62,17 @@ */ @javax.annotation.Generated("by GAPIC") public class ImageAnnotatorSettings extends ServiceApiSettings { - /** - * The default address of the service. - */ + /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "vision.googleapis.com"; - /** - * The default port of the service. - */ + /** The default port of the service. */ private static final int DEFAULT_SERVICE_PORT = 443; - /** - * The default scopes of the service. - */ + /** The default scopes of the service. */ private static final ImmutableList<String> DEFAULT_SERVICE_SCOPES = ImmutableList.<String>builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - /** - * The default connection settings of the service. - */ + /** The default connection settings of the service. */ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS = ConnectionSettings.newBuilder() .setServiceAddress(DEFAULT_SERVICE_ADDRESS) @@ -93,52 +83,38 @@ public class ImageAnnotatorSettings extends ServiceApiSettings { private final SimpleCallSettings<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse> batchAnnotateImagesSettings; - /** - * Returns the object with the settings used for calls to batchAnnotateImages. - */ + /** Returns the object with the settings used for calls to batchAnnotateImages. */ public SimpleCallSettings<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse> batchAnnotateImagesSettings() { return batchAnnotateImagesSettings; } - /** - * Returns the default service address. - */ + /** Returns the default service address. */ public static String getDefaultServiceAddress() { return DEFAULT_SERVICE_ADDRESS; } - /** - * Returns the default service port. - */ + /** Returns the default service port. */ public static int getDefaultServicePort() { return DEFAULT_SERVICE_PORT; } - /** - * Returns the default service scopes. - */ + /** Returns the default service scopes. */ public static ImmutableList<String> getDefaultServiceScopes() { return DEFAULT_SERVICE_SCOPES; } - /** - * Returns a builder for this class with recommended defaults. - */ + /** Returns a builder for this class with recommended defaults. */ public static Builder defaultBuilder() { return Builder.createDefault(); } - /** - * Returns a new builder for this class. - */ + /** Returns a new builder for this class. */ public static Builder newBuilder() { return new Builder(); } - /** - * Returns a builder containing all the values of this settings class. - */ + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } @@ -155,9 +131,7 @@ private ImageAnnotatorSettings(Builder settingsBuilder) throws IOException { batchAnnotateImagesSettings = settingsBuilder.batchAnnotateImagesSettings().build(); } - /** - * Builder for ImageAnnotatorSettings. - */ + /** Builder for ImageAnnotatorSettings. */ public static class Builder extends ServiceApiSettings.Builder { private final ImmutableList<ApiCallSettings.Builder> methodSettingsBuilders; @@ -274,18 +248,15 @@ public Builder setClientLibHeader(String name, String version) { } /** - * Applies the given settings to all of the API methods in this service. Only - * values that are non-null will be applied, so this method is not capable - * of un-setting any values. + * Applies the given settings to all of the API methods in this service. Only values that are + * non-null will be applied, so this method is not capable of un-setting any values. */ public Builder applyToAllApiMethods(ApiCallSettings.Builder apiCallSettings) throws Exception { super.applyToAllApiMethods(methodSettingsBuilders, apiCallSettings); return this; } - /** - * Returns the builder for the settings used for calls to batchAnnotateImages. - */ + /** Returns the builder for the settings used for calls to batchAnnotateImages. */ public SimpleCallSettings.Builder<BatchAnnotateImagesRequest, BatchAnnotateImagesResponse> batchAnnotateImagesSettings() { return batchAnnotateImagesSettings; diff --git a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java index 99f77552a7b2..96458058a2f6 100644 --- a/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java +++ b/google-cloud-vision/src/main/java/com/google/cloud/vision/spi/v1/package-info.java @@ -15,17 +15,16 @@ /** * A client to Google Cloud Vision API. * - * The interfaces provided are listed below, along with a usage sample + * <p>The interfaces provided are listed below, along with a usage sample * - * ================= - * ImageAnnotatorApi - * ================= + * <p>================= ImageAnnotatorApi ================= * - * Service Description: Service that performs Google Cloud Vision API detection tasks, such as face, - * landmark, logo, label, and text detection, over client images, and returns - * detected entities from the images. + * <p>Service Description: Service that performs Google Cloud Vision API detection tasks, such as + * face, landmark, logo, label, and text detection, over client images, and returns detected + * entities from the images. + * + * <p>Sample for ImageAnnotatorApi: * - * Sample for ImageAnnotatorApi: * <pre> * <code> * try (ImageAnnotatorApi imageAnnotatorApi = ImageAnnotatorApi.create()) { @@ -34,6 +33,5 @@ * } * </code> * </pre> - * */ package com.google.cloud.vision.spi.v1; diff --git a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorTest.java b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorTest.java index c9afa9f00c43..c617612031f9 100644 --- a/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorTest.java +++ b/google-cloud-vision/src/test/java/com/google/cloud/vision/spi/v1/ImageAnnotatorTest.java @@ -14,13 +14,11 @@ package com.google.cloud.vision.spi.v1; -import com.google.api.gax.core.PagedListResponse; import com.google.api.gax.testing.MockGrpcService; import com.google.api.gax.testing.MockServiceHelper; import com.google.cloud.vision.v1.AnnotateImageRequest; import com.google.cloud.vision.v1.BatchAnnotateImagesRequest; import com.google.cloud.vision.v1.BatchAnnotateImagesResponse; -import com.google.common.collect.Lists; import com.google.protobuf.GeneratedMessageV3; import java.io.IOException; import java.util.ArrayList;