diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java index 6a815efd5800..8c66e0ab9b71 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingOptions.java @@ -20,7 +20,7 @@ import com.google.cloud.logging.spi.DefaultLoggingRpc; import com.google.cloud.logging.spi.LoggingRpc; import com.google.cloud.logging.spi.LoggingRpcFactory; -import com.google.cloud.logging.spi.v2.LoggingServiceV2Settings; +import com.google.cloud.logging.spi.v2.LoggingSettings; import com.google.common.collect.ImmutableSet; import java.io.IOException; @@ -32,8 +32,8 @@ public class LoggingOptions extends GrpcServiceOptions SCOPES = ImmutableSet.of(LOGGING_SCOPE); - private static final String DEFAULT_HOST = LoggingServiceV2Settings.getDefaultServiceAddress() - + ':' + LoggingServiceV2Settings.getDefaultServicePort(); + private static final String DEFAULT_HOST = LoggingSettings.getDefaultServiceAddress() + + ':' + LoggingSettings.getDefaultServicePort(); public static class DefaultLoggingFactory implements LoggingFactory { private static final LoggingFactory INSTANCE = new DefaultLoggingFactory(); diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/DefaultLoggingRpc.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/DefaultLoggingRpc.java index e44f56ff19dc..1a2d00b0bd8f 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/DefaultLoggingRpc.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/DefaultLoggingRpc.java @@ -30,12 +30,12 @@ import com.google.cloud.NoCredentials; import com.google.cloud.logging.LoggingException; import com.google.cloud.logging.LoggingOptions; -import com.google.cloud.logging.spi.v2.ConfigServiceV2Client; -import com.google.cloud.logging.spi.v2.ConfigServiceV2Settings; -import com.google.cloud.logging.spi.v2.LoggingServiceV2Client; -import com.google.cloud.logging.spi.v2.LoggingServiceV2Settings; -import com.google.cloud.logging.spi.v2.MetricsServiceV2Client; -import com.google.cloud.logging.spi.v2.MetricsServiceV2Settings; +import com.google.cloud.logging.spi.v2.ConfigClient; +import com.google.cloud.logging.spi.v2.ConfigSettings; +import com.google.cloud.logging.spi.v2.LoggingClient; +import com.google.cloud.logging.spi.v2.LoggingSettings; +import com.google.cloud.logging.spi.v2.MetricsClient; +import com.google.cloud.logging.spi.v2.MetricsSettings; import com.google.logging.v2.CreateLogMetricRequest; import com.google.logging.v2.CreateSinkRequest; import com.google.logging.v2.DeleteLogMetricRequest; @@ -71,9 +71,9 @@ public class DefaultLoggingRpc implements LoggingRpc { - private final ConfigServiceV2Client configClient; - private final LoggingServiceV2Client loggingClient; - private final MetricsServiceV2Client metricsClient; + private final ConfigClient configClient; + private final LoggingClient loggingClient; + private final MetricsClient metricsClient; private final ScheduledExecutorService executor; private final ProviderManager providerManager; private final ExecutorFactory executorFactory; @@ -127,21 +127,24 @@ public DefaultLoggingRpc(LoggingOptions options) throws IOException { .setExecutorProvider(executorProvider) .build(); UnaryCallSettings.Builder callSettingsBuilder = internalOptions.getApiCallSettings(); - ConfigServiceV2Settings.Builder confBuilder = ConfigServiceV2Settings.defaultBuilder() - .setExecutorProvider(providerManager) - .setChannelProvider(providerManager) - .applyToAllUnaryMethods(callSettingsBuilder); - LoggingServiceV2Settings.Builder logBuilder = LoggingServiceV2Settings.defaultBuilder() - .setExecutorProvider(providerManager) - .setChannelProvider(providerManager) - .applyToAllUnaryMethods(callSettingsBuilder); - MetricsServiceV2Settings.Builder metricsBuilder = MetricsServiceV2Settings.defaultBuilder() - .setExecutorProvider(providerManager) - .setChannelProvider(providerManager) - .applyToAllUnaryMethods(callSettingsBuilder); - configClient = ConfigServiceV2Client.create(confBuilder.build()); - loggingClient = LoggingServiceV2Client.create(logBuilder.build()); - metricsClient = MetricsServiceV2Client.create(metricsBuilder.build()); + ConfigSettings.Builder confBuilder = + ConfigSettings.defaultBuilder() + .setExecutorProvider(providerManager) + .setChannelProvider(providerManager) + .applyToAllUnaryMethods(callSettingsBuilder); + LoggingSettings.Builder logBuilder = + LoggingSettings.defaultBuilder() + .setExecutorProvider(providerManager) + .setChannelProvider(providerManager) + .applyToAllUnaryMethods(callSettingsBuilder); + MetricsSettings.Builder metricsBuilder = + MetricsSettings.defaultBuilder() + .setExecutorProvider(providerManager) + .setChannelProvider(providerManager) + .applyToAllUnaryMethods(callSettingsBuilder); + configClient = ConfigClient.create(confBuilder.build()); + loggingClient = LoggingClient.create(logBuilder.build()); + metricsClient = MetricsClient.create(metricsBuilder.build()); } catch (Exception ex) { throw new IOException(ex); } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java similarity index 81% rename from google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java rename to google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java index 74cd8453d761..f832b59806a4 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Client.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigClient.java @@ -47,16 +47,15 @@ * *
  * 
- * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+ * try (ConfigClient configClient = ConfigClient.create()) {
  *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
- *   LogSink response = configServiceV2Client.getSink(sinkName);
+ *   LogSink response = configClient.getSink(sinkName);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the configServiceV2Client object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the configClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's * methods: @@ -78,25 +77,25 @@ * 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. * - *

This class can be customized by passing in a custom instance of ConfigServiceV2Settings to - * create(). For example: + *

This class can be customized by passing in a custom instance of ConfigSettings to create(). + * For example: * *

  * 
  * InstantiatingChannelProvider channelProvider =
- *     ConfigServiceV2Settings.defaultChannelProviderBuilder()
+ *     ConfigSettings.defaultChannelProviderBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * ConfigServiceV2Settings configServiceV2Settings =
- *     ConfigServiceV2Settings.defaultBuilder().setChannelProvider(channelProvider).build();
- * ConfigServiceV2Client configServiceV2Client =
- *     ConfigServiceV2Client.create(configServiceV2Settings);
+ * ConfigSettings configSettings =
+ *     ConfigSettings.defaultBuilder().setChannelProvider(channelProvider).build();
+ * ConfigClient configClient =
+ *     ConfigClient.create(configSettings);
  * 
  * 
*/ @Generated("by GAPIC") -public class ConfigServiceV2Client implements AutoCloseable { - private final ConfigServiceV2Settings settings; +public class ConfigClient implements AutoCloseable { + private final ConfigSettings settings; private final ScheduledExecutorService executor; private final ManagedChannel channel; private final List closeables = new ArrayList<>(); @@ -108,25 +107,24 @@ public class ConfigServiceV2Client implements AutoCloseable { private final UnaryCallable updateSinkCallable; private final UnaryCallable deleteSinkCallable; - /** Constructs an instance of ConfigServiceV2Client with default settings. */ - public static final ConfigServiceV2Client create() throws IOException { - return create(ConfigServiceV2Settings.defaultBuilder().build()); + /** Constructs an instance of ConfigClient with default settings. */ + public static final ConfigClient create() throws IOException { + return create(ConfigSettings.defaultBuilder().build()); } /** - * Constructs an instance of ConfigServiceV2Client, 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 ConfigClient, 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 ConfigServiceV2Client create(ConfigServiceV2Settings settings) - throws IOException { - return new ConfigServiceV2Client(settings); + public static final ConfigClient create(ConfigSettings settings) throws IOException { + return new ConfigClient(settings); } /** - * Constructs an instance of ConfigServiceV2Client, 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 ConfigClient, 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 ConfigServiceV2Client(ConfigServiceV2Settings settings) throws IOException { + protected ConfigClient(ConfigSettings settings) throws IOException { this.settings = settings; ChannelAndExecutor channelAndExecutor = settings.getChannelAndExecutor(); this.executor = channelAndExecutor.getExecutor(); @@ -165,7 +163,7 @@ public void close() throws IOException { } } - public final ConfigServiceV2Settings getSettings() { + public final ConfigSettings getSettings() { return settings; } @@ -176,9 +174,9 @@ public final ConfigServiceV2Settings getSettings() { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
-   *   for (LogSink element : configServiceV2Client.listSinks(parent).iterateAllElements()) {
+   *   for (LogSink element : configClient.listSinks(parent).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -201,12 +199,12 @@ public final ListSinksPagedResponse listSinks(ParentNameOneof parent) {
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListSinksRequest request = ListSinksRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
-   *   for (LogSink element : configServiceV2Client.listSinks(request).iterateAllElements()) {
+   *   for (LogSink element : configClient.listSinks(request).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -226,12 +224,12 @@ public final ListSinksPagedResponse listSinks(ListSinksRequest request) {
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListSinksRequest request = ListSinksRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
-   *   ApiFuture<ListSinksPagedResponse> future = configServiceV2Client.listSinksPagedCallable().futureCall(request);
+   *   ApiFuture<ListSinksPagedResponse> future = configClient.listSinksPagedCallable().futureCall(request);
    *   // Do something
    *   for (LogSink element : future.get().iterateAllElements()) {
    *     // doThingsWith(element);
@@ -250,13 +248,13 @@ public final UnaryCallable listSinksPa
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListSinksRequest request = ListSinksRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
    *   while (true) {
-   *     ListSinksResponse response = configServiceV2Client.listSinksCallable().call(request);
+   *     ListSinksResponse response = configClient.listSinksCallable().call(request);
    *     for (LogSink element : response.getSinksList()) {
    *       // doThingsWith(element);
    *     }
@@ -281,9 +279,9 @@ public final UnaryCallable listSinksCallabl
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
-   *   LogSink response = configServiceV2Client.getSink(sinkName);
+   *   LogSink response = configClient.getSink(sinkName);
    * }
    * 
* @@ -307,12 +305,12 @@ public final LogSink getSink(SinkNameOneof sinkName) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   GetSinkRequest request = GetSinkRequest.newBuilder()
    *     .setSinkNameWithSinkNameOneof(sinkName)
    *     .build();
-   *   LogSink response = configServiceV2Client.getSink(request);
+   *   LogSink response = configClient.getSink(request);
    * }
    * 
* @@ -330,12 +328,12 @@ private final LogSink getSink(GetSinkRequest request) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   GetSinkRequest request = GetSinkRequest.newBuilder()
    *     .setSinkNameWithSinkNameOneof(sinkName)
    *     .build();
-   *   ApiFuture<LogSink> future = configServiceV2Client.getSinkCallable().futureCall(request);
+   *   ApiFuture<LogSink> future = configClient.getSinkCallable().futureCall(request);
    *   // Do something
    *   LogSink response = future.get();
    * }
@@ -355,10 +353,10 @@ public final UnaryCallable getSinkCallable() {
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   LogSink sink = LogSink.newBuilder().build();
-   *   LogSink response = configServiceV2Client.createSink(parent, sink);
+   *   LogSink response = configClient.createSink(parent, sink);
    * }
    * 
* @@ -386,14 +384,14 @@ public final LogSink createSink(ParentNameOneof parent, LogSink sink) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   LogSink sink = LogSink.newBuilder().build();
    *   CreateSinkRequest request = CreateSinkRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .setSink(sink)
    *     .build();
-   *   LogSink response = configServiceV2Client.createSink(request);
+   *   LogSink response = configClient.createSink(request);
    * }
    * 
* @@ -414,14 +412,14 @@ public final LogSink createSink(CreateSinkRequest request) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   LogSink sink = LogSink.newBuilder().build();
    *   CreateSinkRequest request = CreateSinkRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .setSink(sink)
    *     .build();
-   *   ApiFuture<LogSink> future = configServiceV2Client.createSinkCallable().futureCall(request);
+   *   ApiFuture<LogSink> future = configClient.createSinkCallable().futureCall(request);
    *   // Do something
    *   LogSink response = future.get();
    * }
@@ -443,10 +441,10 @@ public final UnaryCallable createSinkCallable() {
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   LogSink sink = LogSink.newBuilder().build();
-   *   LogSink response = configServiceV2Client.updateSink(sinkName, sink);
+   *   LogSink response = configClient.updateSink(sinkName, sink);
    * }
    * 
* @@ -478,14 +476,14 @@ public final LogSink updateSink(SinkNameOneof sinkName, LogSink sink) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   LogSink sink = LogSink.newBuilder().build();
    *   UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
    *     .setSinkNameWithSinkNameOneof(sinkName)
    *     .setSink(sink)
    *     .build();
-   *   LogSink response = configServiceV2Client.updateSink(request);
+   *   LogSink response = configClient.updateSink(request);
    * }
    * 
* @@ -508,14 +506,14 @@ public final LogSink updateSink(UpdateSinkRequest request) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   LogSink sink = LogSink.newBuilder().build();
    *   UpdateSinkRequest request = UpdateSinkRequest.newBuilder()
    *     .setSinkNameWithSinkNameOneof(sinkName)
    *     .setSink(sink)
    *     .build();
-   *   ApiFuture<LogSink> future = configServiceV2Client.updateSinkCallable().futureCall(request);
+   *   ApiFuture<LogSink> future = configClient.updateSinkCallable().futureCall(request);
    *   // Do something
    *   LogSink response = future.get();
    * }
@@ -533,9 +531,9 @@ public final UnaryCallable updateSinkCallable() {
    * 

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
-   *   configServiceV2Client.deleteSink(sinkName);
+   *   configClient.deleteSink(sinkName);
    * }
    * 
* @@ -562,12 +560,12 @@ public final void deleteSink(SinkNameOneof sinkName) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
    *     .setSinkNameWithSinkNameOneof(sinkName)
    *     .build();
-   *   configServiceV2Client.deleteSink(request);
+   *   configClient.deleteSink(request);
    * }
    * 
* @@ -586,12 +584,12 @@ private final void deleteSink(DeleteSinkRequest request) { *

Sample code: * *


-   * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+   * try (ConfigClient configClient = ConfigClient.create()) {
    *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
    *   DeleteSinkRequest request = DeleteSinkRequest.newBuilder()
    *     .setSinkNameWithSinkNameOneof(sinkName)
    *     .build();
-   *   ApiFuture<Void> future = configServiceV2Client.deleteSinkCallable().futureCall(request);
+   *   ApiFuture<Void> future = configClient.deleteSinkCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
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/ConfigSettings.java
similarity index 95%
rename from google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigServiceV2Settings.java
rename to google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/ConfigSettings.java
index a1760304d7f5..af3840601c0d 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/ConfigSettings.java
@@ -53,7 +53,7 @@
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
- * Settings class to configure an instance of {@link ConfigServiceV2Client}.
+ * Settings class to configure an instance of {@link ConfigClient}.
  *
  * 

The default instance has everything set to sensible defaults: * @@ -69,17 +69,17 @@ * *

  * 
- * ConfigServiceV2Settings.Builder configServiceV2SettingsBuilder =
- *     ConfigServiceV2Settings.defaultBuilder();
- * configServiceV2SettingsBuilder.getSinkSettings().getRetrySettingsBuilder()
+ * ConfigSettings.Builder configSettingsBuilder =
+ *     ConfigSettings.defaultBuilder();
+ * configSettingsBuilder.getSinkSettings().getRetrySettingsBuilder()
  *     .setTotalTimeout(Duration.standardSeconds(30));
- * ConfigServiceV2Settings configServiceV2Settings = configServiceV2SettingsBuilder.build();
+ * ConfigSettings configSettings = configSettingsBuilder.build();
  * 
  * 
*/ @Generated("by GAPIC v0.0.5") @ExperimentalApi -public class ConfigServiceV2Settings extends ClientSettings { +public class ConfigSettings extends ClientSettings { /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; @@ -167,7 +167,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder } private static String getGapicVersion() { - String packageVersion = ConfigServiceV2Settings.class.getPackage().getImplementationVersion(); + String packageVersion = ConfigSettings.class.getPackage().getImplementationVersion(); return packageVersion != null ? packageVersion : DEFAULT_GAPIC_VERSION; } @@ -186,7 +186,7 @@ public Builder toBuilder() { return new Builder(this); } - private ConfigServiceV2Settings(Builder settingsBuilder) throws IOException { + private ConfigSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder.getExecutorProvider(), settingsBuilder.getChannelProvider()); listSinksSettings = settingsBuilder.listSinksSettings().build(); @@ -245,7 +245,7 @@ public ListSinksPagedResponse createPagedListResponse( } }; - /** Builder for ConfigServiceV2Settings. */ + /** Builder for ConfigSettings. */ public static class Builder extends ClientSettings.Builder { private final ImmutableList unaryMethodSettingsBuilders; @@ -345,7 +345,7 @@ private static Builder createDefault() { return builder; } - private Builder(ConfigServiceV2Settings settings) { + private Builder(ConfigSettings settings) { super(settings); listSinksSettings = settings.listSinksSettings.toBuilder(); @@ -414,8 +414,8 @@ public SimpleCallSettings.Builder deleteSinkSettings() } @Override - public ConfigServiceV2Settings build() throws IOException { - return new ConfigServiceV2Settings(this); + public ConfigSettings build() throws IOException { + return new ConfigSettings(this); } } } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java similarity index 83% rename from google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java rename to google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java index 3a416c4d8867..502b0e408da5 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Client.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingClient.java @@ -53,16 +53,15 @@ * *
  * 
- * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
  *   LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
- *   loggingServiceV2Client.deleteLog(logName);
+ *   loggingClient.deleteLog(logName);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the loggingServiceV2Client object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the loggingClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's * methods: @@ -84,25 +83,25 @@ * 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. * - *

This class can be customized by passing in a custom instance of LoggingServiceV2Settings to - * create(). For example: + *

This class can be customized by passing in a custom instance of LoggingSettings to create(). + * For example: * *

  * 
  * InstantiatingChannelProvider channelProvider =
- *     LoggingServiceV2Settings.defaultChannelProviderBuilder()
+ *     LoggingSettings.defaultChannelProviderBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * LoggingServiceV2Settings loggingServiceV2Settings =
- *     LoggingServiceV2Settings.defaultBuilder().setChannelProvider(channelProvider).build();
- * LoggingServiceV2Client loggingServiceV2Client =
- *     LoggingServiceV2Client.create(loggingServiceV2Settings);
+ * LoggingSettings loggingSettings =
+ *     LoggingSettings.defaultBuilder().setChannelProvider(channelProvider).build();
+ * LoggingClient loggingClient =
+ *     LoggingClient.create(loggingSettings);
  * 
  * 
*/ @Generated("by GAPIC") -public class LoggingServiceV2Client implements AutoCloseable { - private final LoggingServiceV2Settings settings; +public class LoggingClient implements AutoCloseable { + private final LoggingSettings settings; private final ScheduledExecutorService executor; private final ManagedChannel channel; private final List closeables = new ArrayList<>(); @@ -122,26 +121,24 @@ public class LoggingServiceV2Client implements AutoCloseable { private final UnaryCallable listLogsCallable; private final UnaryCallable listLogsPagedCallable; - /** Constructs an instance of LoggingServiceV2Client with default settings. */ - public static final LoggingServiceV2Client create() throws IOException { - return create(LoggingServiceV2Settings.defaultBuilder().build()); + /** Constructs an instance of LoggingClient with default settings. */ + public static final LoggingClient create() throws IOException { + return create(LoggingSettings.defaultBuilder().build()); } /** - * Constructs an instance of LoggingServiceV2Client, 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 LoggingClient, 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 LoggingServiceV2Client create(LoggingServiceV2Settings settings) - throws IOException { - return new LoggingServiceV2Client(settings); + public static final LoggingClient create(LoggingSettings settings) throws IOException { + return new LoggingClient(settings); } /** - * Constructs an instance of LoggingServiceV2Client, 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 LoggingClient, 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 LoggingServiceV2Client(LoggingServiceV2Settings settings) throws IOException { + protected LoggingClient(LoggingSettings settings) throws IOException { this.settings = settings; ChannelAndExecutor channelAndExecutor = settings.getChannelAndExecutor(); this.executor = channelAndExecutor.getExecutor(); @@ -190,7 +187,7 @@ public void close() throws IOException { } } - public final LoggingServiceV2Settings getSettings() { + public final LoggingSettings getSettings() { return settings; } @@ -201,9 +198,9 @@ public final LoggingServiceV2Settings getSettings() { *

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
-   *   loggingServiceV2Client.deleteLog(logName);
+   *   loggingClient.deleteLog(logName);
    * }
    * 
* @@ -228,12 +225,12 @@ public final void deleteLog(LogNameOneof logName) { *

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
    *   DeleteLogRequest request = DeleteLogRequest.newBuilder()
    *     .setLogNameWithLogNameOneof(logName)
    *     .build();
-   *   loggingServiceV2Client.deleteLog(request);
+   *   loggingClient.deleteLog(request);
    * }
    * 
* @@ -251,12 +248,12 @@ private final void deleteLog(DeleteLogRequest request) { *

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
    *   DeleteLogRequest request = DeleteLogRequest.newBuilder()
    *     .setLogNameWithLogNameOneof(logName)
    *     .build();
-   *   ApiFuture<Void> future = loggingServiceV2Client.deleteLogCallable().futureCall(request);
+   *   ApiFuture<Void> future = loggingClient.deleteLogCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
@@ -273,12 +270,12 @@ public final UnaryCallable deleteLogCallable() {
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
    *   MonitoredResource resource = MonitoredResource.newBuilder().build();
    *   Map<String, String> labels = new HashMap<>();
    *   List<LogEntry> entries = new ArrayList<>();
-   *   WriteLogEntriesResponse response = loggingServiceV2Client.writeLogEntries(logName, resource, labels, entries);
+   *   WriteLogEntriesResponse response = loggingClient.writeLogEntries(logName, resource, labels, entries);
    * }
    * 
* @@ -328,12 +325,12 @@ public final WriteLogEntriesResponse writeLogEntries( *

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   List<LogEntry> entries = new ArrayList<>();
    *   WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder()
    *     .addAllEntries(entries)
    *     .build();
-   *   WriteLogEntriesResponse response = loggingServiceV2Client.writeLogEntries(request);
+   *   WriteLogEntriesResponse response = loggingClient.writeLogEntries(request);
    * }
    * 
* @@ -351,12 +348,12 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ *

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   List<LogEntry> entries = new ArrayList<>();
    *   WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder()
    *     .addAllEntries(entries)
    *     .build();
-   *   ApiFuture<WriteLogEntriesResponse> future = loggingServiceV2Client.writeLogEntriesCallable().futureCall(request);
+   *   ApiFuture<WriteLogEntriesResponse> future = loggingClient.writeLogEntriesCallable().futureCall(request);
    *   // Do something
    *   WriteLogEntriesResponse response = future.get();
    * }
@@ -375,11 +372,11 @@ public final WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest requ
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   List<String> resourceNames = new ArrayList<>();
    *   String filter = "";
    *   String orderBy = "";
-   *   for (LogEntry element : loggingServiceV2Client.listLogEntries(resourceNames, filter, orderBy).iterateAllElements()) {
+   *   for (LogEntry element : loggingClient.listLogEntries(resourceNames, filter, orderBy).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -421,12 +418,12 @@ public final ListLogEntriesPagedResponse listLogEntries(
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   List<String> resourceNames = new ArrayList<>();
    *   ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
    *     .addAllResourceNames(resourceNames)
    *     .build();
-   *   for (LogEntry element : loggingServiceV2Client.listLogEntries(request).iterateAllElements()) {
+   *   for (LogEntry element : loggingClient.listLogEntries(request).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -447,12 +444,12 @@ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest re
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   List<String> resourceNames = new ArrayList<>();
    *   ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
    *     .addAllResourceNames(resourceNames)
    *     .build();
-   *   ApiFuture<ListLogEntriesPagedResponse> future = loggingServiceV2Client.listLogEntriesPagedCallable().futureCall(request);
+   *   ApiFuture<ListLogEntriesPagedResponse> future = loggingClient.listLogEntriesPagedCallable().futureCall(request);
    *   // Do something
    *   for (LogEntry element : future.get().iterateAllElements()) {
    *     // doThingsWith(element);
@@ -473,13 +470,13 @@ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest re
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   List<String> resourceNames = new ArrayList<>();
    *   ListLogEntriesRequest request = ListLogEntriesRequest.newBuilder()
    *     .addAllResourceNames(resourceNames)
    *     .build();
    *   while (true) {
-   *     ListLogEntriesResponse response = loggingServiceV2Client.listLogEntriesCallable().call(request);
+   *     ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request);
    *     for (LogEntry element : response.getEntriesList()) {
    *       // doThingsWith(element);
    *     }
@@ -505,9 +502,9 @@ public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest re
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
-   *   for (MonitoredResourceDescriptor element : loggingServiceV2Client.listMonitoredResourceDescriptors(request).iterateAllElements()) {
+   *   for (MonitoredResourceDescriptor element : loggingClient.listMonitoredResourceDescriptors(request).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -528,9 +525,9 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
-   *   ApiFuture<ListMonitoredResourceDescriptorsPagedResponse> future = loggingServiceV2Client.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
+   *   ApiFuture<ListMonitoredResourceDescriptorsPagedResponse> future = loggingClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
    *   // Do something
    *   for (MonitoredResourceDescriptor element : future.get().iterateAllElements()) {
    *     // doThingsWith(element);
@@ -551,10 +548,10 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder().build();
    *   while (true) {
-   *     ListMonitoredResourceDescriptorsResponse response = loggingServiceV2Client.listMonitoredResourceDescriptorsCallable().call(request);
+   *     ListMonitoredResourceDescriptorsResponse response = loggingClient.listMonitoredResourceDescriptorsCallable().call(request);
    *     for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
    *       // doThingsWith(element);
    *     }
@@ -581,9 +578,9 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
-   *   for (String element : loggingServiceV2Client.listLogs(parent).iterateAllElements()) {
+   *   for (String element : loggingClient.listLogs(parent).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -606,12 +603,12 @@ public final ListLogsPagedResponse listLogs(ParentNameOneof parent) {
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListLogsRequest request = ListLogsRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
-   *   for (String element : loggingServiceV2Client.listLogs(request).iterateAllElements()) {
+   *   for (String element : loggingClient.listLogs(request).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -631,12 +628,12 @@ public final ListLogsPagedResponse listLogs(ListLogsRequest request) {
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListLogsRequest request = ListLogsRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
-   *   ApiFuture<ListLogsPagedResponse> future = loggingServiceV2Client.listLogsPagedCallable().futureCall(request);
+   *   ApiFuture<ListLogsPagedResponse> future = loggingClient.listLogsPagedCallable().futureCall(request);
    *   // Do something
    *   for (String element : future.get().iterateAllElements()) {
    *     // doThingsWith(element);
@@ -655,13 +652,13 @@ public final UnaryCallable listLogsPaged
    * 

Sample code: * *


-   * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListLogsRequest request = ListLogsRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
    *   while (true) {
-   *     ListLogsResponse response = loggingServiceV2Client.listLogsCallable().call(request);
+   *     ListLogsResponse response = loggingClient.listLogsCallable().call(request);
    *     for (String element : response.getLogNamesList()) {
    *       // doThingsWith(element);
    *     }
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/LoggingSettings.java
similarity index 97%
rename from google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingServiceV2Settings.java
rename to google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/LoggingSettings.java
index 08a31bafc375..b4137956db78 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/LoggingSettings.java
@@ -67,7 +67,7 @@
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
- * Settings class to configure an instance of {@link LoggingServiceV2Client}.
+ * Settings class to configure an instance of {@link LoggingClient}.
  *
  * 

The default instance has everything set to sensible defaults: * @@ -83,17 +83,17 @@ * *

  * 
- * LoggingServiceV2Settings.Builder loggingServiceV2SettingsBuilder =
- *     LoggingServiceV2Settings.defaultBuilder();
- * loggingServiceV2SettingsBuilder.deleteLogSettings().getRetrySettingsBuilder()
+ * LoggingSettings.Builder loggingSettingsBuilder =
+ *     LoggingSettings.defaultBuilder();
+ * loggingSettingsBuilder.deleteLogSettings().getRetrySettingsBuilder()
  *     .setTotalTimeout(Duration.standardSeconds(30));
- * LoggingServiceV2Settings loggingServiceV2Settings = loggingServiceV2SettingsBuilder.build();
+ * LoggingSettings loggingSettings = loggingSettingsBuilder.build();
  * 
  * 
*/ @Generated("by GAPIC v0.0.5") @ExperimentalApi -public class LoggingServiceV2Settings extends ClientSettings { +public class LoggingSettings extends ClientSettings { /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; @@ -193,7 +193,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder } private static String getGapicVersion() { - String packageVersion = LoggingServiceV2Settings.class.getPackage().getImplementationVersion(); + String packageVersion = LoggingSettings.class.getPackage().getImplementationVersion(); return packageVersion != null ? packageVersion : DEFAULT_GAPIC_VERSION; } @@ -212,7 +212,7 @@ public Builder toBuilder() { return new Builder(this); } - private LoggingServiceV2Settings(Builder settingsBuilder) throws IOException { + private LoggingSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder.getExecutorProvider(), settingsBuilder.getChannelProvider()); deleteLogSettings = settingsBuilder.deleteLogSettings().build(); @@ -450,7 +450,7 @@ public long countBytes(WriteLogEntriesRequest request) { } }; - /** Builder for LoggingServiceV2Settings. */ + /** Builder for LoggingSettings. */ public static class Builder extends ClientSettings.Builder { private final ImmutableList unaryMethodSettingsBuilders; @@ -586,7 +586,7 @@ private static Builder createDefault() { return builder; } - private Builder(LoggingServiceV2Settings settings) { + private Builder(LoggingSettings settings) { super(settings); deleteLogSettings = settings.deleteLogSettings.toBuilder(); @@ -662,8 +662,8 @@ public SimpleCallSettings.Builder deleteLogSettings() { } @Override - public LoggingServiceV2Settings build() throws IOException { - return new LoggingServiceV2Settings(this); + public LoggingSettings build() throws IOException { + return new LoggingSettings(this); } } } diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsClient.java similarity index 79% rename from google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java rename to google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsClient.java index bf3e14df1039..e76ab3eb110d 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Client.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsClient.java @@ -46,16 +46,15 @@ * *
  * 
- * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
  *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
- *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName);
+ *   LogMetric response = metricsClient.getLogMetric(metricName);
  * }
  * 
  * 
* - *

Note: close() needs to be called on the metricsServiceV2Client object to clean up resources - * such as threads. In the example above, try-with-resources is used, which automatically calls - * close(). + *

Note: close() needs to be called on the metricsClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's * methods: @@ -77,25 +76,25 @@ * 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. * - *

This class can be customized by passing in a custom instance of MetricsServiceV2Settings to - * create(). For example: + *

This class can be customized by passing in a custom instance of MetricsSettings to create(). + * For example: * *

  * 
  * InstantiatingChannelProvider channelProvider =
- *     MetricsServiceV2Settings.defaultChannelProviderBuilder()
+ *     MetricsSettings.defaultChannelProviderBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * MetricsServiceV2Settings metricsServiceV2Settings =
- *     MetricsServiceV2Settings.defaultBuilder().setChannelProvider(channelProvider).build();
- * MetricsServiceV2Client metricsServiceV2Client =
- *     MetricsServiceV2Client.create(metricsServiceV2Settings);
+ * MetricsSettings metricsSettings =
+ *     MetricsSettings.defaultBuilder().setChannelProvider(channelProvider).build();
+ * MetricsClient metricsClient =
+ *     MetricsClient.create(metricsSettings);
  * 
  * 
*/ @Generated("by GAPIC") -public class MetricsServiceV2Client implements AutoCloseable { - private final MetricsServiceV2Settings settings; +public class MetricsClient implements AutoCloseable { + private final MetricsSettings settings; private final ScheduledExecutorService executor; private final ManagedChannel channel; private final List closeables = new ArrayList<>(); @@ -108,26 +107,24 @@ public class MetricsServiceV2Client implements AutoCloseable { private final UnaryCallable updateLogMetricCallable; private final UnaryCallable deleteLogMetricCallable; - /** Constructs an instance of MetricsServiceV2Client with default settings. */ - public static final MetricsServiceV2Client create() throws IOException { - return create(MetricsServiceV2Settings.defaultBuilder().build()); + /** Constructs an instance of MetricsClient with default settings. */ + public static final MetricsClient create() throws IOException { + return create(MetricsSettings.defaultBuilder().build()); } /** - * Constructs an instance of MetricsServiceV2Client, 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 MetricsClient, 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 MetricsServiceV2Client create(MetricsServiceV2Settings settings) - throws IOException { - return new MetricsServiceV2Client(settings); + public static final MetricsClient create(MetricsSettings settings) throws IOException { + return new MetricsClient(settings); } /** - * Constructs an instance of MetricsServiceV2Client, 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 MetricsClient, 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 MetricsServiceV2Client(MetricsServiceV2Settings settings) throws IOException { + protected MetricsClient(MetricsSettings settings) throws IOException { this.settings = settings; ChannelAndExecutor channelAndExecutor = settings.getChannelAndExecutor(); this.executor = channelAndExecutor.getExecutor(); @@ -167,7 +164,7 @@ public void close() throws IOException { } } - public final MetricsServiceV2Settings getSettings() { + public final MetricsSettings getSettings() { return settings; } @@ -178,9 +175,9 @@ public final MetricsServiceV2Settings getSettings() { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
-   *   for (LogMetric element : metricsServiceV2Client.listLogMetrics(parent).iterateAllElements()) {
+   *   for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -203,12 +200,12 @@ public final ListLogMetricsPagedResponse listLogMetrics(ParentNameOneof parent)
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
-   *   for (LogMetric element : metricsServiceV2Client.listLogMetrics(request).iterateAllElements()) {
+   *   for (LogMetric element : metricsClient.listLogMetrics(request).iterateAllElements()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -228,12 +225,12 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
-   *   ApiFuture<ListLogMetricsPagedResponse> future = metricsServiceV2Client.listLogMetricsPagedCallable().futureCall(request);
+   *   ApiFuture<ListLogMetricsPagedResponse> future = metricsClient.listLogMetricsPagedCallable().futureCall(request);
    *   // Do something
    *   for (LogMetric element : future.get().iterateAllElements()) {
    *     // doThingsWith(element);
@@ -253,13 +250,13 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .build();
    *   while (true) {
-   *     ListLogMetricsResponse response = metricsServiceV2Client.listLogMetricsCallable().call(request);
+   *     ListLogMetricsResponse response = metricsClient.listLogMetricsCallable().call(request);
    *     for (LogMetric element : response.getMetricsList()) {
    *       // doThingsWith(element);
    *     }
@@ -285,9 +282,9 @@ public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest re
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
-   *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName);
+   *   LogMetric response = metricsClient.getLogMetric(metricName);
    * }
    * 
* @@ -309,12 +306,12 @@ public final LogMetric getLogMetric(MetricNameOneof metricName) { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   GetLogMetricRequest request = GetLogMetricRequest.newBuilder()
    *     .setMetricNameWithMetricNameOneof(metricName)
    *     .build();
-   *   LogMetric response = metricsServiceV2Client.getLogMetric(request);
+   *   LogMetric response = metricsClient.getLogMetric(request);
    * }
    * 
* @@ -332,12 +329,12 @@ private final LogMetric getLogMetric(GetLogMetricRequest request) { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   GetLogMetricRequest request = GetLogMetricRequest.newBuilder()
    *     .setMetricNameWithMetricNameOneof(metricName)
    *     .build();
-   *   ApiFuture<LogMetric> future = metricsServiceV2Client.getLogMetricCallable().futureCall(request);
+   *   ApiFuture<LogMetric> future = metricsClient.getLogMetricCallable().futureCall(request);
    *   // Do something
    *   LogMetric response = future.get();
    * }
@@ -354,10 +351,10 @@ public final UnaryCallable getLogMetricCallable(
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   LogMetric metric = LogMetric.newBuilder().build();
-   *   LogMetric response = metricsServiceV2Client.createLogMetric(parent, metric);
+   *   LogMetric response = metricsClient.createLogMetric(parent, metric);
    * }
    * 
* @@ -384,14 +381,14 @@ public final LogMetric createLogMetric(ParentNameOneof parent, LogMetric metric) *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   LogMetric metric = LogMetric.newBuilder().build();
    *   CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .setMetric(metric)
    *     .build();
-   *   LogMetric response = metricsServiceV2Client.createLogMetric(request);
+   *   LogMetric response = metricsClient.createLogMetric(request);
    * }
    * 
* @@ -409,14 +406,14 @@ public final LogMetric createLogMetric(CreateLogMetricRequest request) { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   ParentNameOneof parent = ParentNameOneof.from(ProjectName.create("[PROJECT]"));
    *   LogMetric metric = LogMetric.newBuilder().build();
    *   CreateLogMetricRequest request = CreateLogMetricRequest.newBuilder()
    *     .setParentWithParentNameOneof(parent)
    *     .setMetric(metric)
    *     .build();
-   *   ApiFuture<LogMetric> future = metricsServiceV2Client.createLogMetricCallable().futureCall(request);
+   *   ApiFuture<LogMetric> future = metricsClient.createLogMetricCallable().futureCall(request);
    *   // Do something
    *   LogMetric response = future.get();
    * }
@@ -433,10 +430,10 @@ public final UnaryCallable createLogMetricCal
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   LogMetric metric = LogMetric.newBuilder().build();
-   *   LogMetric response = metricsServiceV2Client.updateLogMetric(metricName, metric);
+   *   LogMetric response = metricsClient.updateLogMetric(metricName, metric);
    * }
    * 
* @@ -465,14 +462,14 @@ public final LogMetric updateLogMetric(MetricNameOneof metricName, LogMetric met *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   LogMetric metric = LogMetric.newBuilder().build();
    *   UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
    *     .setMetricNameWithMetricNameOneof(metricName)
    *     .setMetric(metric)
    *     .build();
-   *   LogMetric response = metricsServiceV2Client.updateLogMetric(request);
+   *   LogMetric response = metricsClient.updateLogMetric(request);
    * }
    * 
* @@ -490,14 +487,14 @@ public final LogMetric updateLogMetric(UpdateLogMetricRequest request) { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   LogMetric metric = LogMetric.newBuilder().build();
    *   UpdateLogMetricRequest request = UpdateLogMetricRequest.newBuilder()
    *     .setMetricNameWithMetricNameOneof(metricName)
    *     .setMetric(metric)
    *     .build();
-   *   ApiFuture<LogMetric> future = metricsServiceV2Client.updateLogMetricCallable().futureCall(request);
+   *   ApiFuture<LogMetric> future = metricsClient.updateLogMetricCallable().futureCall(request);
    *   // Do something
    *   LogMetric response = future.get();
    * }
@@ -514,9 +511,9 @@ public final UnaryCallable updateLogMetricCal
    * 

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
-   *   metricsServiceV2Client.deleteLogMetric(metricName);
+   *   metricsClient.deleteLogMetric(metricName);
    * }
    * 
* @@ -538,12 +535,12 @@ public final void deleteLogMetric(MetricNameOneof metricName) { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
    *     .setMetricNameWithMetricNameOneof(metricName)
    *     .build();
-   *   metricsServiceV2Client.deleteLogMetric(request);
+   *   metricsClient.deleteLogMetric(request);
    * }
    * 
* @@ -561,12 +558,12 @@ private final void deleteLogMetric(DeleteLogMetricRequest request) { *

Sample code: * *


-   * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
    *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
    *   DeleteLogMetricRequest request = DeleteLogMetricRequest.newBuilder()
    *     .setMetricNameWithMetricNameOneof(metricName)
    *     .build();
-   *   ApiFuture<Void> future = metricsServiceV2Client.deleteLogMetricCallable().futureCall(request);
+   *   ApiFuture<Void> future = metricsClient.deleteLogMetricCallable().futureCall(request);
    *   // Do something
    *   future.get();
    * }
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/MetricsSettings.java
similarity index 95%
rename from google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsServiceV2Settings.java
rename to google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/MetricsSettings.java
index 34406b928485..b13a1d0091d2 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/MetricsSettings.java
@@ -53,7 +53,7 @@
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
- * Settings class to configure an instance of {@link MetricsServiceV2Client}.
+ * Settings class to configure an instance of {@link MetricsClient}.
  *
  * 

The default instance has everything set to sensible defaults: * @@ -69,17 +69,17 @@ * *

  * 
- * MetricsServiceV2Settings.Builder metricsServiceV2SettingsBuilder =
- *     MetricsServiceV2Settings.defaultBuilder();
- * metricsServiceV2SettingsBuilder.getLogMetricSettings().getRetrySettingsBuilder()
+ * MetricsSettings.Builder metricsSettingsBuilder =
+ *     MetricsSettings.defaultBuilder();
+ * metricsSettingsBuilder.getLogMetricSettings().getRetrySettingsBuilder()
  *     .setTotalTimeout(Duration.standardSeconds(30));
- * MetricsServiceV2Settings metricsServiceV2Settings = metricsServiceV2SettingsBuilder.build();
+ * MetricsSettings metricsSettings = metricsSettingsBuilder.build();
  * 
  * 
*/ @Generated("by GAPIC v0.0.5") @ExperimentalApi -public class MetricsServiceV2Settings extends ClientSettings { +public class MetricsSettings extends ClientSettings { /** The default address of the service. */ private static final String DEFAULT_SERVICE_ADDRESS = "logging.googleapis.com"; @@ -169,7 +169,7 @@ public static InstantiatingChannelProvider.Builder defaultChannelProviderBuilder } private static String getGapicVersion() { - String packageVersion = MetricsServiceV2Settings.class.getPackage().getImplementationVersion(); + String packageVersion = MetricsSettings.class.getPackage().getImplementationVersion(); return packageVersion != null ? packageVersion : DEFAULT_GAPIC_VERSION; } @@ -188,7 +188,7 @@ public Builder toBuilder() { return new Builder(this); } - private MetricsServiceV2Settings(Builder settingsBuilder) throws IOException { + private MetricsSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder.getExecutorProvider(), settingsBuilder.getChannelProvider()); listLogMetricsSettings = settingsBuilder.listLogMetricsSettings().build(); @@ -248,7 +248,7 @@ public ListLogMetricsPagedResponse createPagedListResponse( } }; - /** Builder for MetricsServiceV2Settings. */ + /** Builder for MetricsSettings. */ public static class Builder extends ClientSettings.Builder { private final ImmutableList unaryMethodSettingsBuilders; @@ -354,7 +354,7 @@ private static Builder createDefault() { return builder; } - private Builder(MetricsServiceV2Settings settings) { + private Builder(MetricsSettings settings) { super(settings); listLogMetricsSettings = settings.listLogMetricsSettings.toBuilder(); @@ -424,8 +424,8 @@ public SimpleCallSettings.Builder deleteLogMetric } @Override - public MetricsServiceV2Settings build() throws IOException { - return new MetricsServiceV2Settings(this); + public MetricsSettings build() throws IOException { + return new MetricsSettings(this); } } } 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 bdded777062a..6fff642419ef 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 @@ -19,48 +19,48 @@ * *

The interfaces provided are listed below, along with usage samples. * - *

====================== LoggingServiceV2Client ====================== + *

============= LoggingClient ============= * *

Service Description: Service for ingesting and querying logs. * - *

Sample for LoggingServiceV2Client: + *

Sample for LoggingClient: * *

  * 
- * try (LoggingServiceV2Client loggingServiceV2Client = LoggingServiceV2Client.create()) {
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
  *   LogNameOneof logName = LogNameOneof.from(LogName.create("[PROJECT]", "[LOG]"));
- *   loggingServiceV2Client.deleteLog(logName);
+ *   loggingClient.deleteLog(logName);
  * }
  * 
  * 
* - * ===================== ConfigServiceV2Client ===================== + * ============ ConfigClient ============ * *

Service Description: Service for configuring sinks used to export log entries outside of * Stackdriver Logging. * - *

Sample for ConfigServiceV2Client: + *

Sample for ConfigClient: * *

  * 
- * try (ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.create()) {
+ * try (ConfigClient configClient = ConfigClient.create()) {
  *   SinkNameOneof sinkName = SinkNameOneof.from(SinkName.create("[PROJECT]", "[SINK]"));
- *   LogSink response = configServiceV2Client.getSink(sinkName);
+ *   LogSink response = configClient.getSink(sinkName);
  * }
  * 
  * 
* - * ====================== MetricsServiceV2Client ====================== + * ============= MetricsClient ============= * *

Service Description: Service for configuring logs-based metrics. * - *

Sample for MetricsServiceV2Client: + *

Sample for MetricsClient: * *

  * 
- * try (MetricsServiceV2Client metricsServiceV2Client = MetricsServiceV2Client.create()) {
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
  *   MetricNameOneof metricName = MetricNameOneof.from(MetricName.create("[PROJECT]", "[METRIC]"));
- *   LogMetric response = metricsServiceV2Client.getLogMetric(metricName);
+ *   LogMetric response = metricsClient.getLogMetric(metricName);
  * }
  * 
  * 
diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java similarity index 97% rename from google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java rename to google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java index 040bc2a17af4..f4be97134428 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigServiceV2ClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/ConfigClientTest.java @@ -48,12 +48,12 @@ import org.junit.Test; @javax.annotation.Generated("by GAPIC") -public class ConfigServiceV2ClientTest { +public class ConfigClientTest { private static MockLoggingServiceV2 mockLoggingServiceV2; private static MockConfigServiceV2 mockConfigServiceV2; private static MockMetricsServiceV2 mockMetricsServiceV2; private static MockServiceHelper serviceHelper; - private ConfigServiceV2Client client; + private ConfigClient client; @BeforeClass public static void startStaticServer() { @@ -76,11 +76,11 @@ public static void stopServer() { @Before public void setUp() throws IOException { serviceHelper.reset(); - ConfigServiceV2Settings settings = - ConfigServiceV2Settings.defaultBuilder() + ConfigSettings settings = + ConfigSettings.defaultBuilder() .setChannelProvider(serviceHelper.createChannelProvider()) .build(); - client = ConfigServiceV2Client.create(settings); + client = ConfigClient.create(settings); } @After diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java similarity index 97% rename from google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java rename to google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java index 81f52d9c55ff..0b3cb1201954 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingServiceV2ClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/LoggingClientTest.java @@ -53,12 +53,12 @@ import org.junit.Test; @javax.annotation.Generated("by GAPIC") -public class LoggingServiceV2ClientTest { +public class LoggingClientTest { private static MockLoggingServiceV2 mockLoggingServiceV2; private static MockConfigServiceV2 mockConfigServiceV2; private static MockMetricsServiceV2 mockMetricsServiceV2; private static MockServiceHelper serviceHelper; - private LoggingServiceV2Client client; + private LoggingClient client; @BeforeClass public static void startStaticServer() { @@ -81,11 +81,11 @@ public static void stopServer() { @Before public void setUp() throws IOException { serviceHelper.reset(); - LoggingServiceV2Settings settings = - LoggingServiceV2Settings.defaultBuilder() + LoggingSettings settings = + LoggingSettings.defaultBuilder() .setChannelProvider(serviceHelper.createChannelProvider()) .build(); - client = LoggingServiceV2Client.create(settings); + client = LoggingClient.create(settings); } @After diff --git a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java similarity index 97% rename from google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java rename to google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java index 63c344e70f0a..cba811a96f69 100644 --- a/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsServiceV2ClientTest.java +++ b/google-cloud-logging/src/test/java/com/google/cloud/logging/spi/v2/MetricsClientTest.java @@ -47,12 +47,12 @@ import org.junit.Test; @javax.annotation.Generated("by GAPIC") -public class MetricsServiceV2ClientTest { +public class MetricsClientTest { private static MockLoggingServiceV2 mockLoggingServiceV2; private static MockConfigServiceV2 mockConfigServiceV2; private static MockMetricsServiceV2 mockMetricsServiceV2; private static MockServiceHelper serviceHelper; - private MetricsServiceV2Client client; + private MetricsClient client; @BeforeClass public static void startStaticServer() { @@ -75,11 +75,11 @@ public static void stopServer() { @Before public void setUp() throws IOException { serviceHelper.reset(); - MetricsServiceV2Settings settings = - MetricsServiceV2Settings.defaultBuilder() + MetricsSettings settings = + MetricsSettings.defaultBuilder() .setChannelProvider(serviceHelper.createChannelProvider()) .build(); - client = MetricsServiceV2Client.create(settings); + client = MetricsClient.create(settings); } @After