diff --git a/google-cloud-monitoring/pom.xml b/google-cloud-monitoring/pom.xml
new file mode 100644
index 000000000000..8ff98bf15c44
--- /dev/null
+++ b/google-cloud-monitoring/pom.xml
@@ -0,0 +1,126 @@
+
+
+ 4.0.0
+ google-cloud-monitoring
+ jar
+ Google Cloud Monitoring
+ https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-monitoring
+
+ Java idiomatic client for Stackdriver Monitoring.
+
+
+ com.google.cloud
+ google-cloud-pom
+ 0.3.1-SNAPSHOT
+
+
+ google-cloud-monitoring
+
+
+
+ io.netty
+ netty-tcnative-boringssl-static
+ 1.1.33.Fork17
+
+
+ ${project.groupId}
+ google-cloud-core
+ ${project.version}
+
+
+ com.google.api.grpc
+ grpc-google-monitoring-v3
+ 0.0.7
+
+
+ io.grpc
+ grpc-all
+ 0.15.0
+
+
+ com.google.auto.value
+ auto-value
+ 1.1
+
+
+ ${project.groupId}
+ google-cloud-core
+ ${project.version}
+ test-jar
+ test
+
+
+ junit
+ junit
+ 4.12
+ test
+
+
+ org.easymock
+ easymock
+ 3.4
+ test
+
+
+
+
+ doclint-java8-disable
+
+ [1.8,)
+
+
+
+ -Xdoclint:none
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 1.9.1
+
+
+ generate-sources
+ add-source
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.10.3
+
+
+ attach-javadocs
+
+ jar
+
+
+ ${javadoc.opts}
+
+
+
+
+
+ maven-compiler-plugin
+
+
+
+ 3.1
+
+
+ 1.7
+ UTF-8
+ -Xlint:unchecked
+
+
+
+
+
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
new file mode 100644
index 000000000000..acec003d843f
--- /dev/null
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceApi.java
@@ -0,0 +1,290 @@
+/*
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.cloud.monitoring.spi.v3;
+
+import com.google.api.MonitoredResource;
+import com.google.api.gax.grpc.ApiCallable;
+import com.google.api.gax.protobuf.PathTemplate;
+import com.google.monitoring.v3.CollectdPayload;
+import com.google.monitoring.v3.CreateCollectdTimeSeriesRequest;
+import com.google.protobuf.Empty;
+import io.grpc.ManagedChannel;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+
+// 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.
+ *
+ *
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:
+ *
+ *
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().
+ *
+ *
The surface of this class includes several types of Java methods for each of the API's methods:
+ *
+ *
+ *
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.
+ *
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.
+ *
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.
+ *
+ *
+ *
See the individual methods for example code.
+ *
+ *
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.
+ *
+ *
This class can be customized by passing in a custom instance of AgentTranslationServiceSettings to
+ * create(). For example:
+ *
+ *
+ */
+@javax.annotation.Generated("by GAPIC")
+public class AgentTranslationServiceApi implements AutoCloseable {
+ private final AgentTranslationServiceSettings settings;
+ private final ManagedChannel channel;
+ private final ScheduledExecutorService executor;
+ private final List closeables = new ArrayList<>();
+
+ private final ApiCallable
+ createCollectdTimeSeriesCallable;
+
+ public final AgentTranslationServiceSettings getSettings() {
+ return settings;
+ }
+
+ private static final PathTemplate PROJECT_PATH_TEMPLATE =
+ PathTemplate.createWithoutUrlEncoding("projects/{project}");
+
+ /**
+ * 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.
+ */
+ public static final String parseProjectFromProjectName(String projectName) {
+ return PROJECT_PATH_TEMPLATE.parse(projectName).get("project");
+ }
+
+ /**
+ * 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.
+ */
+ public static final AgentTranslationServiceApi create(AgentTranslationServiceSettings settings)
+ throws IOException {
+ return new AgentTranslationServiceApi(settings);
+ }
+
+ /**
+ * 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 {
+ this.settings = settings;
+ this.executor = settings.getExecutorProvider().getOrBuildExecutor();
+ this.channel = settings.getChannelProvider().getOrBuildChannel(this.executor);
+
+ this.createCollectdTimeSeriesCallable =
+ ApiCallable.create(
+ settings.createCollectdTimeSeriesSettings(), this.channel, this.executor);
+
+ if (settings.getChannelProvider().shouldAutoClose()) {
+ closeables.add(
+ new Closeable() {
+ @Override
+ public void close() throws IOException {
+ channel.shutdown();
+ }
+ });
+ }
+ if (settings.getExecutorProvider().shouldAutoClose()) {
+ closeables.add(
+ new Closeable() {
+ @Override
+ public void close() throws IOException {
+ executor.shutdown();
+ }
+ });
+ }
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * **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]
+ * instead.</aside>
+ *
+ * Sample code:
+ *
+ *
+ * @param name The project in which to create the time series. The format is
+ * `"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`.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final void createCollectdTimeSeries(
+ String name,
+ MonitoredResource resource,
+ String collectdVersion,
+ List collectdPayloads) {
+ PROJECT_PATH_TEMPLATE.validate(name, "createCollectdTimeSeries");
+ CreateCollectdTimeSeriesRequest request =
+ CreateCollectdTimeSeriesRequest.newBuilder()
+ .setName(name)
+ .setResource(resource)
+ .setCollectdVersion(collectdVersion)
+ .addAllCollectdPayloads(collectdPayloads)
+ .build();
+ createCollectdTimeSeries(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * **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]
+ * instead.</aside>
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final void createCollectdTimeSeries(CreateCollectdTimeSeriesRequest request) {
+ createCollectdTimeSeriesCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * **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]
+ * instead.</aside>
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable
+ createCollectdTimeSeriesCallable() {
+ return createCollectdTimeSeriesCallable;
+ }
+
+ /**
+ * Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately
+ * cancelled.
+ */
+ @Override
+ public final void close() throws Exception {
+ for (AutoCloseable closeable : closeables) {
+ closeable.close();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..ae87487fde4c
--- /dev/null
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/AgentTranslationServiceSettings.java
@@ -0,0 +1,299 @@
+/*
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.cloud.monitoring.spi.v3;
+
+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;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.monitoring.v3.AgentTranslationServiceGrpc;
+import com.google.monitoring.v3.CreateCollectdTimeSeriesRequest;
+import com.google.protobuf.Empty;
+import io.grpc.ManagedChannel;
+import io.grpc.Status;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import org.joda.time.Duration;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link AgentTranslationServiceApi}.
+ *
+ *
The default instance has everything set to sensible defaults:
+ *
+ *
+ *
The default service address (monitoring.googleapis.com) and default port (443)
+ * are used.
+ *
Credentials are acquired automatically through Application Default Credentials.
+ *
Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ *
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:
+ *
+ *
+ */
+@javax.annotation.Generated("by GAPIC")
+public class AgentTranslationServiceSettings extends ServiceApiSettings {
+ /**
+ * The default address of the service.
+ */
+ private static final String DEFAULT_SERVICE_ADDRESS = "monitoring.googleapis.com";
+
+ /**
+ * The default port of the service.
+ */
+ private static final int DEFAULT_SERVICE_PORT = 443;
+
+ /**
+ * The default scopes of the service.
+ */
+ private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+ ImmutableList.builder().build();
+
+ /**
+ * The default connection settings of the service.
+ */
+ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS =
+ ConnectionSettings.newBuilder()
+ .setServiceAddress(DEFAULT_SERVICE_ADDRESS)
+ .setPort(DEFAULT_SERVICE_PORT)
+ .provideCredentialsWith(DEFAULT_SERVICE_SCOPES)
+ .build();
+
+ private final SimpleCallSettings
+ createCollectdTimeSeriesSettings;
+
+ /**
+ * Returns the object with the settings used for calls to createCollectdTimeSeries.
+ */
+ public SimpleCallSettings
+ createCollectdTimeSeriesSettings() {
+ return createCollectdTimeSeriesSettings;
+ }
+
+ /**
+ * Returns the default service address.
+ */
+ public static String getDefaultServiceAddress() {
+ return DEFAULT_SERVICE_ADDRESS;
+ }
+
+ /**
+ * Returns the default service port.
+ */
+ public static int getDefaultServicePort() {
+ return DEFAULT_SERVICE_PORT;
+ }
+
+ /**
+ * Returns the default service scopes.
+ */
+ public static ImmutableList getDefaultServiceScopes() {
+ return DEFAULT_SERVICE_SCOPES;
+ }
+
+ /**
+ * Returns a builder for this class with recommended defaults.
+ */
+ public static Builder defaultBuilder() {
+ return Builder.createDefault();
+ }
+
+ /**
+ * 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.
+ */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ private AgentTranslationServiceSettings(Builder settingsBuilder) throws IOException {
+ super(
+ settingsBuilder.getChannelProvider(),
+ settingsBuilder.getExecutorProvider(),
+ settingsBuilder.getGeneratorName(),
+ settingsBuilder.getGeneratorVersion(),
+ settingsBuilder.getClientLibName(),
+ settingsBuilder.getClientLibVersion());
+
+ createCollectdTimeSeriesSettings = settingsBuilder.createCollectdTimeSeriesSettings().build();
+ }
+
+ /**
+ * Builder for AgentTranslationServiceSettings.
+ */
+ public static class Builder extends ServiceApiSettings.Builder {
+ private final ImmutableList methodSettingsBuilders;
+
+ private SimpleCallSettings.Builder
+ createCollectdTimeSeriesSettings;
+
+ private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder> definitions = ImmutableMap.builder();
+ definitions.put(
+ "idempotent",
+ Sets.immutableEnumSet(
+ Lists.newArrayList(
+ Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE)));
+ definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList()));
+ RETRYABLE_CODE_DEFINITIONS = definitions.build();
+ }
+
+ private static final ImmutableMap RETRY_PARAM_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder definitions = ImmutableMap.builder();
+ RetrySettings.Builder settingsBuilder = null;
+ settingsBuilder =
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.millis(100L))
+ .setRetryDelayMultiplier(1.3)
+ .setMaxRetryDelay(Duration.millis(60000L))
+ .setInitialRpcTimeout(Duration.millis(20000L))
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.millis(20000L))
+ .setTotalTimeout(Duration.millis(600000L));
+ definitions.put("default", settingsBuilder);
+ RETRY_PARAM_DEFINITIONS = definitions.build();
+ }
+
+ private Builder() {
+ super(DEFAULT_CONNECTION_SETTINGS);
+
+ createCollectdTimeSeriesSettings =
+ SimpleCallSettings.newBuilder(
+ AgentTranslationServiceGrpc.METHOD_CREATE_COLLECTD_TIME_SERIES);
+
+ methodSettingsBuilders =
+ ImmutableList.of(createCollectdTimeSeriesSettings);
+ }
+
+ private static Builder createDefault() {
+ Builder builder = new Builder();
+
+ builder
+ .createCollectdTimeSeriesSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ return builder;
+ }
+
+ private Builder(AgentTranslationServiceSettings settings) {
+ super(settings);
+
+ createCollectdTimeSeriesSettings = settings.createCollectdTimeSeriesSettings.toBuilder();
+
+ methodSettingsBuilders =
+ ImmutableList.of(createCollectdTimeSeriesSettings);
+ }
+
+ @Override
+ protected ConnectionSettings getDefaultConnectionSettings() {
+ return DEFAULT_CONNECTION_SETTINGS;
+ }
+
+ @Override
+ public Builder provideExecutorWith(ScheduledExecutorService executor, boolean shouldAutoClose) {
+ super.provideExecutorWith(executor, shouldAutoClose);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(ManagedChannel channel, boolean shouldAutoClose) {
+ super.provideChannelWith(channel, shouldAutoClose);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(ConnectionSettings settings) {
+ super.provideChannelWith(settings);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(Credentials credentials) {
+ super.provideChannelWith(credentials);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(List scopes) {
+ super.provideChannelWith(scopes);
+ return this;
+ }
+
+ @Override
+ public Builder setGeneratorHeader(String name, String version) {
+ super.setGeneratorHeader(name, version);
+ return this;
+ }
+
+ @Override
+ public Builder setClientLibHeader(String name, String version) {
+ super.setClientLibHeader(name, version);
+ return this;
+ }
+
+ /**
+ * 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.
+ */
+ public SimpleCallSettings.Builder
+ createCollectdTimeSeriesSettings() {
+ return createCollectdTimeSeriesSettings;
+ }
+
+ @Override
+ public AgentTranslationServiceSettings build() throws IOException {
+ return new AgentTranslationServiceSettings(this);
+ }
+ }
+}
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
new file mode 100644
index 000000000000..b0e44057ca58
--- /dev/null
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceApi.java
@@ -0,0 +1,762 @@
+/*
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.cloud.monitoring.spi.v3;
+
+import com.google.api.MonitoredResource;
+import com.google.api.gax.core.PageAccessor;
+import com.google.api.gax.grpc.ApiCallable;
+import com.google.api.gax.protobuf.PathTemplate;
+import com.google.monitoring.v3.CreateGroupRequest;
+import com.google.monitoring.v3.DeleteGroupRequest;
+import com.google.monitoring.v3.GetGroupRequest;
+import com.google.monitoring.v3.Group;
+import com.google.monitoring.v3.ListGroupMembersRequest;
+import com.google.monitoring.v3.ListGroupMembersResponse;
+import com.google.monitoring.v3.ListGroupsRequest;
+import com.google.monitoring.v3.ListGroupsResponse;
+import com.google.monitoring.v3.TimeInterval;
+import com.google.monitoring.v3.UpdateGroupRequest;
+import com.google.protobuf.Empty;
+import io.grpc.ManagedChannel;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * 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.
+ *
+ *
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:
+ *
+ *
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().
+ *
+ *
The surface of this class includes several types of Java methods for each of the API's methods:
+ *
+ *
+ *
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.
+ *
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.
+ *
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.
+ *
+ *
+ *
See the individual methods for example code.
+ *
+ *
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.
+ *
+ *
This class can be customized by passing in a custom instance of GroupServiceSettings to
+ * create(). For example:
+ *
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listGroups(ListGroupsRequest request) {
+ return listGroupsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists the existing groups. The project ID in the URL path must refer
+ * to a Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable> listGroupsPagedCallable() {
+ return listGroupsPagedCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists the existing groups. The project ID in the URL path must refer
+ * to a Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable listGroupsCallable() {
+ return listGroupsCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param name The group to retrieve. The format is
+ * `"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) {
+ GROUP_PATH_TEMPLATE.validate(name, "getGroup");
+ GetGroupRequest request = GetGroupRequest.newBuilder().setName(name).build();
+ return getGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ private final Group getGroup(GetGroupRequest request) {
+ return getGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable getGroupCallable() {
+ return getGroupCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @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.
+ * @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
+ */
+ public final Group createGroup(String name, Group group, boolean validateOnly) {
+ PROJECT_PATH_TEMPLATE.validate(name, "createGroup");
+ CreateGroupRequest request =
+ CreateGroupRequest.newBuilder()
+ .setName(name)
+ .setGroup(group)
+ .setValidateOnly(validateOnly)
+ .build();
+ return createGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final Group createGroup(CreateGroupRequest request) {
+ return createGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Creates a new group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable createGroupCallable() {
+ return 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.
+ *
+ * Sample code:
+ *
+ *
+ * @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
+ */
+ public final Group updateGroup(Group group, boolean validateOnly) {
+ UpdateGroupRequest request =
+ UpdateGroupRequest.newBuilder().setGroup(group).setValidateOnly(validateOnly).build();
+ return updateGroup(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.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final Group updateGroup(UpdateGroupRequest request) {
+ return updateGroupCallable().call(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.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable updateGroupCallable() {
+ return updateGroupCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param name The group to delete. The format is
+ * `"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) {
+ GROUP_PATH_TEMPLATE.validate(name, "deleteGroup");
+ DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setName(name).build();
+ deleteGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ private final void deleteGroup(DeleteGroupRequest request) {
+ deleteGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group. The project ID in the URL path must refer to a
+ * Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable deleteGroupCallable() {
+ return 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.
+ *
+ * Sample code:
+ *
+ *
+ * @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.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listGroupMembers(
+ String name, String filter, TimeInterval interval) {
+ GROUP_PATH_TEMPLATE.validate(name, "listGroupMembers");
+ ListGroupMembersRequest request =
+ ListGroupMembersRequest.newBuilder()
+ .setName(name)
+ .setFilter(filter)
+ .setInterval(interval)
+ .build();
+ return listGroupMembers(request);
+ }
+
+ // 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.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listGroupMembers(ListGroupMembersRequest request) {
+ return listGroupMembersPagedCallable().call(request);
+ }
+
+ // 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.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable>
+ listGroupMembersPagedCallable() {
+ return listGroupMembersPagedCallable;
+ }
+
+ // 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.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable
+ listGroupMembersCallable() {
+ return listGroupMembersCallable;
+ }
+
+ /**
+ * Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately
+ * cancelled.
+ */
+ @Override
+ public final void close() throws Exception {
+ for (AutoCloseable closeable : closeables) {
+ closeable.close();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..a414f70a079e
--- /dev/null
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/GroupServiceSettings.java
@@ -0,0 +1,509 @@
+/*
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.cloud.monitoring.spi.v3;
+
+import com.google.api.MonitoredResource;
+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.PageStreamingCallSettings;
+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;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.monitoring.v3.CreateGroupRequest;
+import com.google.monitoring.v3.DeleteGroupRequest;
+import com.google.monitoring.v3.GetGroupRequest;
+import com.google.monitoring.v3.Group;
+import com.google.monitoring.v3.GroupServiceGrpc;
+import com.google.monitoring.v3.ListGroupMembersRequest;
+import com.google.monitoring.v3.ListGroupMembersResponse;
+import com.google.monitoring.v3.ListGroupsRequest;
+import com.google.monitoring.v3.ListGroupsResponse;
+import com.google.monitoring.v3.UpdateGroupRequest;
+import com.google.protobuf.Empty;
+import io.grpc.ManagedChannel;
+import io.grpc.Status;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import org.joda.time.Duration;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link GroupServiceApi}.
+ *
+ *
The default instance has everything set to sensible defaults:
+ *
+ *
+ *
The default service address (monitoring.googleapis.com) and default port (443)
+ * are used.
+ *
Credentials are acquired automatically through Application Default Credentials.
+ *
Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ *
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:
+ *
+ *
+ */
+@javax.annotation.Generated("by GAPIC")
+public class GroupServiceSettings extends ServiceApiSettings {
+ /**
+ * The default address of the service.
+ */
+ private static final String DEFAULT_SERVICE_ADDRESS = "monitoring.googleapis.com";
+
+ /**
+ * The default port of the service.
+ */
+ private static final int DEFAULT_SERVICE_PORT = 443;
+
+ /**
+ * The default scopes of the service.
+ */
+ private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+ ImmutableList.builder().build();
+
+ /**
+ * The default connection settings of the service.
+ */
+ public static final ConnectionSettings DEFAULT_CONNECTION_SETTINGS =
+ ConnectionSettings.newBuilder()
+ .setServiceAddress(DEFAULT_SERVICE_ADDRESS)
+ .setPort(DEFAULT_SERVICE_PORT)
+ .provideCredentialsWith(DEFAULT_SERVICE_SCOPES)
+ .build();
+
+ private final PageStreamingCallSettings
+ listGroupsSettings;
+ private final SimpleCallSettings getGroupSettings;
+ private final SimpleCallSettings createGroupSettings;
+ private final SimpleCallSettings updateGroupSettings;
+ private final SimpleCallSettings deleteGroupSettings;
+ private final PageStreamingCallSettings<
+ ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource>
+ listGroupMembersSettings;
+
+ /**
+ * Returns the object with the settings used for calls to listGroups.
+ */
+ public PageStreamingCallSettings
+ listGroupsSettings() {
+ return listGroupsSettings;
+ }
+
+ /**
+ * Returns the object with the settings used for calls to getGroup.
+ */
+ public SimpleCallSettings getGroupSettings() {
+ return getGroupSettings;
+ }
+
+ /**
+ * Returns the object with the settings used for calls to createGroup.
+ */
+ public SimpleCallSettings createGroupSettings() {
+ return createGroupSettings;
+ }
+
+ /**
+ * Returns the object with the settings used for calls to updateGroup.
+ */
+ public SimpleCallSettings updateGroupSettings() {
+ return updateGroupSettings;
+ }
+
+ /**
+ * Returns the object with the settings used for calls to deleteGroup.
+ */
+ public SimpleCallSettings deleteGroupSettings() {
+ return deleteGroupSettings;
+ }
+
+ /**
+ * Returns the object with the settings used for calls to listGroupMembers.
+ */
+ public PageStreamingCallSettings<
+ ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource>
+ listGroupMembersSettings() {
+ return listGroupMembersSettings;
+ }
+
+ /**
+ * Returns the default service address.
+ */
+ public static String getDefaultServiceAddress() {
+ return DEFAULT_SERVICE_ADDRESS;
+ }
+
+ /**
+ * Returns the default service port.
+ */
+ public static int getDefaultServicePort() {
+ return DEFAULT_SERVICE_PORT;
+ }
+
+ /**
+ * Returns the default service scopes.
+ */
+ public static ImmutableList getDefaultServiceScopes() {
+ return DEFAULT_SERVICE_SCOPES;
+ }
+
+ /**
+ * Returns a builder for this class with recommended defaults.
+ */
+ public static Builder defaultBuilder() {
+ return Builder.createDefault();
+ }
+
+ /**
+ * 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.
+ */
+ public Builder toBuilder() {
+ return new Builder(this);
+ }
+
+ private GroupServiceSettings(Builder settingsBuilder) throws IOException {
+ super(
+ settingsBuilder.getChannelProvider(),
+ settingsBuilder.getExecutorProvider(),
+ settingsBuilder.getGeneratorName(),
+ settingsBuilder.getGeneratorVersion(),
+ settingsBuilder.getClientLibName(),
+ settingsBuilder.getClientLibVersion());
+
+ listGroupsSettings = settingsBuilder.listGroupsSettings().build();
+ getGroupSettings = settingsBuilder.getGroupSettings().build();
+ createGroupSettings = settingsBuilder.createGroupSettings().build();
+ updateGroupSettings = settingsBuilder.updateGroupSettings().build();
+ deleteGroupSettings = settingsBuilder.deleteGroupSettings().build();
+ listGroupMembersSettings = settingsBuilder.listGroupMembersSettings().build();
+ }
+
+ private static PageStreamingDescriptor
+ LIST_GROUPS_PAGE_STR_DESC =
+ new PageStreamingDescriptor() {
+ @Override
+ public Object emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListGroupsRequest injectToken(ListGroupsRequest payload, Object token) {
+ return ListGroupsRequest.newBuilder(payload).setPageToken((String) token).build();
+ }
+
+ @Override
+ public Object extractNextToken(ListGroupsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListGroupsResponse payload) {
+ return payload.getGroupList();
+ }
+ };
+
+ private static PageStreamingDescriptor<
+ ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource>
+ LIST_GROUP_MEMBERS_PAGE_STR_DESC =
+ new PageStreamingDescriptor<
+ ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource>() {
+ @Override
+ public Object emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListGroupMembersRequest injectToken(
+ ListGroupMembersRequest payload, Object token) {
+ return ListGroupMembersRequest.newBuilder(payload)
+ .setPageToken((String) token)
+ .build();
+ }
+
+ @Override
+ public Object extractNextToken(ListGroupMembersResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListGroupMembersResponse payload) {
+ return payload.getMembersList();
+ }
+ };
+
+ /**
+ * Builder for GroupServiceSettings.
+ */
+ public static class Builder extends ServiceApiSettings.Builder {
+ private final ImmutableList methodSettingsBuilders;
+
+ private PageStreamingCallSettings.Builder
+ listGroupsSettings;
+ private SimpleCallSettings.Builder getGroupSettings;
+ private SimpleCallSettings.Builder createGroupSettings;
+ private SimpleCallSettings.Builder updateGroupSettings;
+ private SimpleCallSettings.Builder deleteGroupSettings;
+ private PageStreamingCallSettings.Builder<
+ ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource>
+ listGroupMembersSettings;
+
+ private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder> definitions = ImmutableMap.builder();
+ definitions.put(
+ "idempotent",
+ Sets.immutableEnumSet(
+ Lists.newArrayList(
+ Status.Code.DEADLINE_EXCEEDED, Status.Code.UNAVAILABLE)));
+ definitions.put("non_idempotent", Sets.immutableEnumSet(Lists.newArrayList()));
+ RETRYABLE_CODE_DEFINITIONS = definitions.build();
+ }
+
+ private static final ImmutableMap RETRY_PARAM_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder definitions = ImmutableMap.builder();
+ RetrySettings.Builder settingsBuilder = null;
+ settingsBuilder =
+ RetrySettings.newBuilder()
+ .setInitialRetryDelay(Duration.millis(100L))
+ .setRetryDelayMultiplier(1.3)
+ .setMaxRetryDelay(Duration.millis(60000L))
+ .setInitialRpcTimeout(Duration.millis(20000L))
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeout(Duration.millis(20000L))
+ .setTotalTimeout(Duration.millis(600000L));
+ definitions.put("default", settingsBuilder);
+ RETRY_PARAM_DEFINITIONS = definitions.build();
+ }
+
+ private Builder() {
+ super(DEFAULT_CONNECTION_SETTINGS);
+
+ listGroupsSettings =
+ PageStreamingCallSettings.newBuilder(
+ GroupServiceGrpc.METHOD_LIST_GROUPS, LIST_GROUPS_PAGE_STR_DESC);
+
+ getGroupSettings = SimpleCallSettings.newBuilder(GroupServiceGrpc.METHOD_GET_GROUP);
+
+ createGroupSettings = SimpleCallSettings.newBuilder(GroupServiceGrpc.METHOD_CREATE_GROUP);
+
+ updateGroupSettings = SimpleCallSettings.newBuilder(GroupServiceGrpc.METHOD_UPDATE_GROUP);
+
+ deleteGroupSettings = SimpleCallSettings.newBuilder(GroupServiceGrpc.METHOD_DELETE_GROUP);
+
+ listGroupMembersSettings =
+ PageStreamingCallSettings.newBuilder(
+ GroupServiceGrpc.METHOD_LIST_GROUP_MEMBERS, LIST_GROUP_MEMBERS_PAGE_STR_DESC);
+
+ methodSettingsBuilders =
+ ImmutableList.of(
+ listGroupsSettings,
+ getGroupSettings,
+ createGroupSettings,
+ updateGroupSettings,
+ deleteGroupSettings,
+ listGroupMembersSettings);
+ }
+
+ private static Builder createDefault() {
+ Builder builder = new Builder();
+
+ builder
+ .listGroupsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ builder
+ .getGroupSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ builder
+ .createGroupSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ builder
+ .updateGroupSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ builder
+ .deleteGroupSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ builder
+ .listGroupMembersSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+ .setRetrySettingsBuilder(RETRY_PARAM_DEFINITIONS.get("default"));
+
+ return builder;
+ }
+
+ private Builder(GroupServiceSettings settings) {
+ super(settings);
+
+ listGroupsSettings = settings.listGroupsSettings.toBuilder();
+ getGroupSettings = settings.getGroupSettings.toBuilder();
+ createGroupSettings = settings.createGroupSettings.toBuilder();
+ updateGroupSettings = settings.updateGroupSettings.toBuilder();
+ deleteGroupSettings = settings.deleteGroupSettings.toBuilder();
+ listGroupMembersSettings = settings.listGroupMembersSettings.toBuilder();
+
+ methodSettingsBuilders =
+ ImmutableList.of(
+ listGroupsSettings,
+ getGroupSettings,
+ createGroupSettings,
+ updateGroupSettings,
+ deleteGroupSettings,
+ listGroupMembersSettings);
+ }
+
+ @Override
+ protected ConnectionSettings getDefaultConnectionSettings() {
+ return DEFAULT_CONNECTION_SETTINGS;
+ }
+
+ @Override
+ public Builder provideExecutorWith(ScheduledExecutorService executor, boolean shouldAutoClose) {
+ super.provideExecutorWith(executor, shouldAutoClose);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(ManagedChannel channel, boolean shouldAutoClose) {
+ super.provideChannelWith(channel, shouldAutoClose);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(ConnectionSettings settings) {
+ super.provideChannelWith(settings);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(Credentials credentials) {
+ super.provideChannelWith(credentials);
+ return this;
+ }
+
+ @Override
+ public Builder provideChannelWith(List scopes) {
+ super.provideChannelWith(scopes);
+ return this;
+ }
+
+ @Override
+ public Builder setGeneratorHeader(String name, String version) {
+ super.setGeneratorHeader(name, version);
+ return this;
+ }
+
+ @Override
+ public Builder setClientLibHeader(String name, String version) {
+ super.setClientLibHeader(name, version);
+ return this;
+ }
+
+ /**
+ * 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.
+ */
+ public PageStreamingCallSettings.Builder
+ listGroupsSettings() {
+ return listGroupsSettings;
+ }
+
+ /**
+ * Returns the builder for the settings used for calls to getGroup.
+ */
+ public SimpleCallSettings.Builder getGroupSettings() {
+ return getGroupSettings;
+ }
+
+ /**
+ * Returns the builder for the settings used for calls to createGroup.
+ */
+ public SimpleCallSettings.Builder createGroupSettings() {
+ return createGroupSettings;
+ }
+
+ /**
+ * Returns the builder for the settings used for calls to updateGroup.
+ */
+ public SimpleCallSettings.Builder updateGroupSettings() {
+ return updateGroupSettings;
+ }
+
+ /**
+ * Returns the builder for the settings used for calls to deleteGroup.
+ */
+ public SimpleCallSettings.Builder deleteGroupSettings() {
+ return deleteGroupSettings;
+ }
+
+ /**
+ * Returns the builder for the settings used for calls to listGroupMembers.
+ */
+ public PageStreamingCallSettings.Builder<
+ ListGroupMembersRequest, ListGroupMembersResponse, MonitoredResource>
+ listGroupMembersSettings() {
+ return listGroupMembersSettings;
+ }
+
+ @Override
+ public GroupServiceSettings build() throws IOException {
+ return new GroupServiceSettings(this);
+ }
+ }
+}
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
new file mode 100644
index 000000000000..09d5ba3d45f5
--- /dev/null
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceApi.java
@@ -0,0 +1,1037 @@
+/*
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.cloud.monitoring.spi.v3;
+
+import com.google.api.MetricDescriptor;
+import com.google.api.MonitoredResourceDescriptor;
+import com.google.api.gax.core.PageAccessor;
+import com.google.api.gax.grpc.ApiCallable;
+import com.google.api.gax.protobuf.PathTemplate;
+import com.google.monitoring.v3.Aggregation;
+import com.google.monitoring.v3.CreateMetricDescriptorRequest;
+import com.google.monitoring.v3.CreateTimeSeriesRequest;
+import com.google.monitoring.v3.DeleteMetricDescriptorRequest;
+import com.google.monitoring.v3.GetMetricDescriptorRequest;
+import com.google.monitoring.v3.GetMonitoredResourceDescriptorRequest;
+import com.google.monitoring.v3.ListMetricDescriptorsRequest;
+import com.google.monitoring.v3.ListMetricDescriptorsResponse;
+import com.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest;
+import com.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse;
+import com.google.monitoring.v3.ListTimeSeriesRequest;
+import com.google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView;
+import com.google.monitoring.v3.ListTimeSeriesResponse;
+import com.google.monitoring.v3.TimeInterval;
+import com.google.monitoring.v3.TimeSeries;
+import com.google.protobuf.Empty;
+import io.grpc.ManagedChannel;
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+
+// AUTO-GENERATED DOCUMENTATION AND SERVICE
+/**
+ * Service Description: Manages metric descriptors, monitored resource descriptors, and
+ * time series data.
+ *
+ *
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:
+ *
+ *
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().
+ *
+ *
The surface of this class includes several types of Java methods for each of the API's methods:
+ *
+ *
+ *
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.
+ *
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.
+ *
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.
+ *
+ *
+ *
See the individual methods for example code.
+ *
+ *
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.
+ *
+ *
This class can be customized by passing in a custom instance of MetricServiceSettings to
+ * create(). For example:
+ *
+ *
+ *
+ * @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
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listMonitoredResourceDescriptors(
+ String name, String filter) {
+ PROJECT_PATH_TEMPLATE.validate(name, "listMonitoredResourceDescriptors");
+ ListMonitoredResourceDescriptorsRequest request =
+ ListMonitoredResourceDescriptorsRequest.newBuilder()
+ .setName(name)
+ .setFilter(filter)
+ .build();
+ return listMonitoredResourceDescriptors(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listMonitoredResourceDescriptors(
+ ListMonitoredResourceDescriptorsRequest request) {
+ return listMonitoredResourceDescriptorsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @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) {
+ MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.validate(name, "getMonitoredResourceDescriptor");
+ GetMonitoredResourceDescriptorRequest request =
+ GetMonitoredResourceDescriptorRequest.newBuilder().setName(name).build();
+ return getMonitoredResourceDescriptor(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single monitored resource descriptor. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ private final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
+ GetMonitoredResourceDescriptorRequest request) {
+ return getMonitoredResourceDescriptorCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single monitored resource descriptor. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable
+ getMonitoredResourceDescriptorCallable() {
+ return getMonitoredResourceDescriptorCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @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/")
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listMetricDescriptors(String name, String filter) {
+ PROJECT_PATH_TEMPLATE.validate(name, "listMetricDescriptors");
+ ListMetricDescriptorsRequest request =
+ ListMetricDescriptorsRequest.newBuilder().setName(name).setFilter(filter).build();
+ return listMetricDescriptors(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listMetricDescriptors(
+ ListMetricDescriptorsRequest request) {
+ return listMetricDescriptorsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable>
+ listMetricDescriptorsPagedCallable() {
+ return listMetricDescriptorsPagedCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @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"`.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final MetricDescriptor getMetricDescriptor(String name) {
+ METRIC_DESCRIPTOR_PATH_PATH_TEMPLATE.validate(name, "getMetricDescriptor");
+ GetMetricDescriptorRequest request =
+ GetMetricDescriptorRequest.newBuilder().setName(name).build();
+ return getMetricDescriptor(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single metric descriptor. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ private final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest request) {
+ return getMetricDescriptorCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets a single metric descriptor. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @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"`.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final void deleteMetricDescriptor(String name) {
+ METRIC_DESCRIPTOR_PATH_PATH_TEMPLATE.validate(name, "deleteMetricDescriptor");
+ DeleteMetricDescriptorRequest request =
+ DeleteMetricDescriptorRequest.newBuilder().setName(name).build();
+ deleteMetricDescriptor(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a metric descriptor. Only user-created
+ * [custom metrics](/monitoring/custom-metrics) can be deleted.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ private final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request) {
+ deleteMetricDescriptorCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes a metric descriptor. Only user-created
+ * [custom metrics](/monitoring/custom-metrics) can be deleted.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable deleteMetricDescriptorCallable() {
+ return deleteMetricDescriptorCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists time series that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final PageAccessor listTimeSeries(ListTimeSeriesRequest request) {
+ return listTimeSeriesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists time series that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable>
+ listTimeSeriesPagedCallable() {
+ return listTimeSeriesPagedCallable;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists time series that match a filter. This method does not require a Stackdriver account.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable listTimeSeriesCallable() {
+ return listTimeSeriesCallable;
+ }
+
+ // 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.
+ *
+ * Sample code:
+ *
+ *
+ * @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.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final void createTimeSeries(String name, List timeSeries) {
+ PROJECT_PATH_TEMPLATE.validate(name, "createTimeSeries");
+ CreateTimeSeriesRequest request =
+ CreateTimeSeriesRequest.newBuilder().setName(name).addAllTimeSeries(timeSeries).build();
+ createTimeSeries(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.
+ *
+ * Sample code:
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.grpc.ApiException if the remote call fails
+ */
+ public final void createTimeSeries(CreateTimeSeriesRequest request) {
+ createTimeSeriesCallable().call(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.
+ *
+ * Sample code:
+ *
+ */
+ public final ApiCallable createTimeSeriesCallable() {
+ return createTimeSeriesCallable;
+ }
+
+ /**
+ * Initiates an orderly shutdown in which preexisting calls continue but new calls are immediately
+ * cancelled.
+ */
+ @Override
+ public final void close() throws Exception {
+ for (AutoCloseable closeable : closeables) {
+ closeable.close();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..27831a6e861e
--- /dev/null
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/spi/v3/MetricServiceSettings.java
@@ -0,0 +1,645 @@
+/*
+ * Copyright 2016 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.cloud.monitoring.spi.v3;
+
+import com.google.api.MetricDescriptor;
+import com.google.api.MonitoredResourceDescriptor;
+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.PageStreamingCallSettings;
+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;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.monitoring.v3.CreateMetricDescriptorRequest;
+import com.google.monitoring.v3.CreateTimeSeriesRequest;
+import com.google.monitoring.v3.DeleteMetricDescriptorRequest;
+import com.google.monitoring.v3.GetMetricDescriptorRequest;
+import com.google.monitoring.v3.GetMonitoredResourceDescriptorRequest;
+import com.google.monitoring.v3.ListMetricDescriptorsRequest;
+import com.google.monitoring.v3.ListMetricDescriptorsResponse;
+import com.google.monitoring.v3.ListMonitoredResourceDescriptorsRequest;
+import com.google.monitoring.v3.ListMonitoredResourceDescriptorsResponse;
+import com.google.monitoring.v3.ListTimeSeriesRequest;
+import com.google.monitoring.v3.ListTimeSeriesResponse;
+import com.google.monitoring.v3.MetricServiceGrpc;
+import com.google.monitoring.v3.TimeSeries;
+import com.google.protobuf.Empty;
+import io.grpc.ManagedChannel;
+import io.grpc.Status;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ScheduledExecutorService;
+import org.joda.time.Duration;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+/**
+ * Settings class to configure an instance of {@link MetricServiceApi}.
+ *
+ *
The default instance has everything set to sensible defaults:
+ *
+ *
+ *
The default service address (monitoring.googleapis.com) and default port (443)
+ * are used.
+ *
Credentials are acquired automatically through Application Default Credentials.
+ *
Retries are configured for idempotent methods but not for non-idempotent methods.
+ *
+ *
+ *
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:
+ *
+ *
+ *
+ * ==========================
+ * 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.
+ *
+ * Sample for AgentTranslationServiceApi:
+ *