From da7e3b938467c03fa8b65b0f58a57771fbf4e8aa Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 5 Jun 2020 14:56:11 -0700 Subject: [PATCH] feat!: Removing TimeSeriesQueryLanguageCondition as an alert condition type (#161) The condition type is unsupported and unused. It was originally added for the Monitoring Query Language Alpha feature. This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ceea7185-8991-4321-ac64-03d9792fe72a/targets PiperOrigin-RevId: 310060413 Source-Link: https://github.com/googleapis/googleapis/commit/a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727 BREAKING_CHANGE: TimeSeriesQueryLanguageCondition has been removed. --- CONTRIBUTING.md | 11 +- .../clirr-ignored-differences.xml | 35 + .../v3/AlertPolicyServiceClient.java | 224 +-- .../v3/AlertPolicyServiceSettings.java | 26 +- .../monitoring/v3/GroupServiceClient.java | 360 ++-- .../monitoring/v3/GroupServiceSettings.java | 46 +- .../monitoring/v3/MetricServiceClient.java | 61 +- .../v3/NotificationChannelServiceClient.java | 1187 ++++++------ .../NotificationChannelServiceSettings.java | 102 +- .../v3/ServiceMonitoringServiceClient.java | 431 +++-- .../v3/ServiceMonitoringServiceSettings.java | 52 +- .../v3/UptimeCheckServiceClient.java | 303 +-- .../v3/UptimeCheckServiceSettings.java | 30 +- .../cloud/monitoring/v3/package-info.java | 24 +- .../v3/stub/AlertPolicyServiceStub.java | 8 +- .../stub/AlertPolicyServiceStubSettings.java | 54 +- .../monitoring/v3/stub/GroupServiceStub.java | 16 +- .../v3/stub/GroupServiceStubSettings.java | 92 +- .../v3/stub/GrpcAlertPolicyServiceStub.java | 64 +- .../v3/stub/GrpcGroupServiceStub.java | 112 +- .../GrpcNotificationChannelServiceStub.java | 254 +-- .../GrpcServiceMonitoringServiceStub.java | 130 +- .../v3/stub/GrpcUptimeCheckServiceStub.java | 68 +- .../stub/NotificationChannelServiceStub.java | 36 +- ...otificationChannelServiceStubSettings.java | 198 +- .../v3/stub/ServiceMonitoringServiceStub.java | 20 +- .../ServiceMonitoringServiceStubSettings.java | 114 +- .../v3/stub/UptimeCheckServiceStub.java | 8 +- .../stub/UptimeCheckServiceStubSettings.java | 60 +- .../v3/AlertPolicyServiceClientTest.java | 106 +- .../monitoring/v3/GroupServiceClientTest.java | 174 +- .../v3/MetricServiceClientTest.java | 38 +- .../monitoring/v3/MetricServiceSmokeTest.java | 3 +- .../NotificationChannelServiceClientTest.java | 352 ++-- .../ServiceMonitoringServiceClientTest.java | 203 +- .../v3/UptimeCheckServiceClientTest.java | 125 +- pom.xml | 9 - .../clirr-ignored-differences.xml | 21 + .../com/google/monitoring/v3/AlertPolicy.java | 1689 ++--------------- .../google/monitoring/v3/AlertPolicyName.java | 239 ++- .../com/google/monitoring/v3/AlertProto.java | 108 +- .../com/google/monitoring/v3/GroupName.java | 229 ++- .../monitoring/v3/MetricDescriptorName.java | 260 ++- .../v3/MonitoredResourceDescriptorName.java | 275 ++- .../v3/NotificationChannelDescriptorName.java | 266 ++- .../v3/NotificationChannelName.java | 266 ++- .../v3/ServiceLevelObjectiveName.java | 321 +++- .../com/google/monitoring/v3/ServiceName.java | 232 ++- .../monitoring/v3/UptimeCheckConfigName.java | 263 ++- .../proto/google/monitoring/v3/alert.proto | 18 - synth.metadata | 8 +- 51 files changed, 4994 insertions(+), 4337 deletions(-) create mode 100644 google-cloud-monitoring/clirr-ignored-differences.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 085021dd..f2dbdee0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,7 +99,16 @@ mvn -Penable-samples clean verify ``` 2. [Activate](#profile-activation) the profile. -3. Define your samples in a normal Maven project in the `samples/` directory +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` ### Profile Activation diff --git a/google-cloud-monitoring/clirr-ignored-differences.xml b/google-cloud-monitoring/clirr-ignored-differences.xml new file mode 100644 index 00000000..404ca00b --- /dev/null +++ b/google-cloud-monitoring/clirr-ignored-differences.xml @@ -0,0 +1,35 @@ + + + + + + 7005 + com/google/cloud/monitoring/v3/AlertPolicyServiceClient + * *AlertPolic*(com.google.monitoring.v3.ProjectName*) + * *AlertPolic*(com.google.api.resourcenames.ResourceName*) + + + 7005 + com/google/cloud/monitoring/v3/GroupServiceClient + * *Group*(com.google.monitoring.v3.ProjectName*) + * *Group*(com.google.api.resourcenames.ResourceName*) + + + 7005 + com/google/cloud/monitoring/v3/MetricServiceClient + * *(com.google.monitoring.v3.ProjectName*) + * *(com.google.api.resourcenames.ResourceName*) + + + 7005 + com/google/cloud/monitoring/v3/NotificationChannelServiceClient + * *NotificationChannel*(com.google.monitoring.v3.ProjectName*) + * *NotificationChannel*(com.google.api.resourcenames.ResourceName*) + + + 7005 + com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient + * *Service*(com.google.monitoring.v3.ProjectName*) + * *Service*(com.google.api.resourcenames.ResourceName*) + + diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java index b02dfb0f..fed70498 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java @@ -25,6 +25,7 @@ import com.google.api.gax.paging.AbstractPagedListResponse; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.resourcenames.ResourceName; import com.google.cloud.monitoring.v3.stub.AlertPolicyServiceStub; import com.google.cloud.monitoring.v3.stub.AlertPolicyServiceStubSettings; import com.google.common.util.concurrent.MoreExecutors; @@ -35,7 +36,6 @@ import com.google.monitoring.v3.GetAlertPolicyRequest; import com.google.monitoring.v3.ListAlertPoliciesRequest; import com.google.monitoring.v3.ListAlertPoliciesResponse; -import com.google.monitoring.v3.ProjectName; import com.google.monitoring.v3.UpdateAlertPolicyRequest; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; @@ -59,8 +59,8 @@ *
  * 
  * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
+ *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ *   alertPolicyServiceClient.deleteAlertPolicy(name);
  * }
  * 
  * 
@@ -169,6 +169,100 @@ public AlertPolicyServiceStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an alerting policy. + * + *

Sample code: + * + *


+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+   *   alertPolicyServiceClient.deleteAlertPolicy(name);
+   * }
+   * 
+ * + * @param name Required. The alerting policy to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + *

For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAlertPolicy(AlertPolicyName name) { + DeleteAlertPolicyRequest request = + DeleteAlertPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteAlertPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an alerting policy. + * + *

Sample code: + * + *


+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+   *   alertPolicyServiceClient.deleteAlertPolicy(name.toString());
+   * }
+   * 
+ * + * @param name Required. The alerting policy to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + *

For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAlertPolicy(String name) { + DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder().setName(name).build(); + deleteAlertPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an alerting policy. + * + *

Sample code: + * + *


+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+   *   DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   alertPolicyServiceClient.deleteAlertPolicy(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) { + deleteAlertPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an alerting policy. + * + *

Sample code: + * + *


+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+   *   DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteAlertPolicyCallable() { + return stub.deleteAlertPolicyCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists the existing alerting policies for the project. @@ -177,7 +271,7 @@ public AlertPolicyServiceStub getStub() { * *

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -192,7 +286,7 @@ public AlertPolicyServiceStub getStub() {
    *     instead.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final ListAlertPoliciesPagedResponse listAlertPolicies(ProjectName name) {
+  public final ListAlertPoliciesPagedResponse listAlertPolicies(ResourceName name) {
     ListAlertPoliciesRequest request =
         ListAlertPoliciesRequest.newBuilder()
             .setName(name == null ? null : name.toString())
@@ -208,7 +302,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ProjectName name)
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -236,7 +330,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(String name) {
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListAlertPoliciesRequest request = ListAlertPoliciesRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -261,7 +355,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListAlertPoliciesRequest request = ListAlertPoliciesRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -286,7 +380,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListAlertPoliciesRequest request = ListAlertPoliciesRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -318,7 +412,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
    *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
    * }
    * 
@@ -341,7 +435,7 @@ public final AlertPolicy getAlertPolicy(AlertPolicyName name) { * *

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
    *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name.toString());
    * }
    * 
@@ -363,7 +457,7 @@ public final AlertPolicy getAlertPolicy(String name) { * *

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
    *   GetAlertPolicyRequest request = GetAlertPolicyRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -386,7 +480,7 @@ public final AlertPolicy getAlertPolicy(GetAlertPolicyRequest request) {
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+   *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
    *   GetAlertPolicyRequest request = GetAlertPolicyRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -408,7 +502,7 @@ public final UnaryCallable getAlertPolicyCal
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
    *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name, alertPolicy);
    * }
@@ -425,7 +519,7 @@ public final UnaryCallable getAlertPolicyCal
    *     `[ALERT_POLICY_ID]` value.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPolicy) {
+  public final AlertPolicy createAlertPolicy(ResourceName name, AlertPolicy alertPolicy) {
     CreateAlertPolicyRequest request =
         CreateAlertPolicyRequest.newBuilder()
             .setName(name == null ? null : name.toString())
@@ -442,7 +536,7 @@ public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPo
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
    *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name.toString(), alertPolicy);
    * }
@@ -473,7 +567,7 @@ public final AlertPolicy createAlertPolicy(String name, AlertPolicy alertPolicy)
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
    *   CreateAlertPolicyRequest request = CreateAlertPolicyRequest.newBuilder()
    *     .setName(name.toString())
@@ -498,7 +592,7 @@ public final AlertPolicy createAlertPolicy(CreateAlertPolicyRequest request) {
    *
    * 

    * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
    *   CreateAlertPolicyRequest request = CreateAlertPolicyRequest.newBuilder()
    *     .setName(name.toString())
@@ -514,100 +608,6 @@ public final UnaryCallable createAlertPol
     return stub.createAlertPolicyCallable();
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Deletes an alerting policy.
-   *
-   * 

Sample code: - * - *


-   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
-   *   alertPolicyServiceClient.deleteAlertPolicy(name);
-   * }
-   * 
- * - * @param name Required. The alerting policy to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - *

For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteAlertPolicy(AlertPolicyName name) { - DeleteAlertPolicyRequest request = - DeleteAlertPolicyRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteAlertPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an alerting policy. - * - *

Sample code: - * - *


-   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
-   *   alertPolicyServiceClient.deleteAlertPolicy(name.toString());
-   * }
-   * 
- * - * @param name Required. The alerting policy to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] - *

For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteAlertPolicy(String name) { - DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder().setName(name).build(); - deleteAlertPolicy(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an alerting policy. - * - *

Sample code: - * - *


-   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
-   *   DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   alertPolicyServiceClient.deleteAlertPolicy(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) { - deleteAlertPolicyCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an alerting policy. - * - *

Sample code: - * - *


-   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
-   *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
-   *   DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteAlertPolicyCallable() { - return stub.deleteAlertPolicyCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Updates an alerting policy. You can either replace the entire policy with a new one or replace diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java index 193bac9d..fd6a5655 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java @@ -56,16 +56,16 @@ *

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 getAlertPolicy to 30 seconds: + *

For example, to set the total timeout of deleteAlertPolicy to 30 seconds: * *

  * 
  * AlertPolicyServiceSettings.Builder alertPolicyServiceSettingsBuilder =
  *     AlertPolicyServiceSettings.newBuilder();
  * alertPolicyServiceSettingsBuilder
- *     .getAlertPolicySettings()
+ *     .deleteAlertPolicySettings()
  *     .setRetrySettings(
- *         alertPolicyServiceSettingsBuilder.getAlertPolicySettings().getRetrySettings().toBuilder()
+ *         alertPolicyServiceSettingsBuilder.deleteAlertPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AlertPolicyServiceSettings alertPolicyServiceSettings = alertPolicyServiceSettingsBuilder.build();
@@ -74,6 +74,11 @@
  */
 @Generated("by gapic-generator")
 public class AlertPolicyServiceSettings extends ClientSettings {
+  /** Returns the object with the settings used for calls to deleteAlertPolicy. */
+  public UnaryCallSettings deleteAlertPolicySettings() {
+    return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
+  }
+
   /** Returns the object with the settings used for calls to listAlertPolicies. */
   public PagedCallSettings<
           ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -91,11 +96,6 @@ public UnaryCallSettings createAlertPolic
     return ((AlertPolicyServiceStubSettings) getStubSettings()).createAlertPolicySettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteAlertPolicy. */
-  public UnaryCallSettings deleteAlertPolicySettings() {
-    return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
-  }
-
   /** Returns the object with the settings used for calls to updateAlertPolicy. */
   public UnaryCallSettings updateAlertPolicySettings() {
     return ((AlertPolicyServiceStubSettings) getStubSettings()).updateAlertPolicySettings();
@@ -198,6 +198,11 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to deleteAlertPolicy. */
+    public UnaryCallSettings.Builder deleteAlertPolicySettings() {
+      return getStubSettingsBuilder().deleteAlertPolicySettings();
+    }
+
     /** Returns the builder for the settings used for calls to listAlertPolicies. */
     public PagedCallSettings.Builder<
             ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -216,11 +221,6 @@ public UnaryCallSettings.Builder getAlertPol
       return getStubSettingsBuilder().createAlertPolicySettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteAlertPolicy. */
-    public UnaryCallSettings.Builder deleteAlertPolicySettings() {
-      return getStubSettingsBuilder().deleteAlertPolicySettings();
-    }
-
     /** Returns the builder for the settings used for calls to updateAlertPolicy. */
     public UnaryCallSettings.Builder
         updateAlertPolicySettings() {
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java
index 37ceebef..b80b2098 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java
@@ -26,6 +26,7 @@
 import com.google.api.gax.paging.AbstractPagedListResponse;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
 import com.google.cloud.monitoring.v3.stub.GroupServiceStub;
 import com.google.cloud.monitoring.v3.stub.GroupServiceStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -38,7 +39,6 @@
 import com.google.monitoring.v3.ListGroupMembersResponse;
 import com.google.monitoring.v3.ListGroupsRequest;
 import com.google.monitoring.v3.ListGroupsResponse;
-import com.google.monitoring.v3.ProjectName;
 import com.google.monitoring.v3.UpdateGroupRequest;
 import com.google.protobuf.Empty;
 import java.io.IOException;
@@ -64,8 +64,8 @@
  * 
  * 
  * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- *   Group response = groupServiceClient.getGroup(name);
+ *   Group group = Group.newBuilder().build();
+ *   Group response = groupServiceClient.updateGroup(group);
  * }
  * 
  * 
@@ -172,6 +172,163 @@ public GroupServiceStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing group. You can change any group attributes except `name`. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   Group group = Group.newBuilder().build();
+   *   Group response = groupServiceClient.updateGroup(group);
+   * }
+   * 
+ * + * @param group Required. The new definition of the group. All fields of the existing group, + * excepting `name`, are replaced with the corresponding fields of this group. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Group updateGroup(Group group) { + UpdateGroupRequest request = UpdateGroupRequest.newBuilder().setGroup(group).build(); + return updateGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates an existing group. You can change any group attributes except `name`. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   Group group = Group.newBuilder().build();
+   *   UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
+   *     .setGroup(group)
+   *     .build();
+   *   Group response = groupServiceClient.updateGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.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`. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   Group group = Group.newBuilder().build();
+   *   UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
+   *     .setGroup(group)
+   *     .build();
+   *   ApiFuture<Group> future = groupServiceClient.updateGroupCallable().futureCall(request);
+   *   // Do something
+   *   Group response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateGroupCallable() { + return stub.updateGroupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing group. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+   *   groupServiceClient.deleteGroup(name);
+   * }
+   * 
+ * + * @param name Required. The group to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteGroup(GroupName name) { + DeleteGroupRequest request = + DeleteGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing group. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+   *   groupServiceClient.deleteGroup(name.toString());
+   * }
+   * 
+ * + * @param name Required. The group to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteGroup(String name) { + DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setName(name).build(); + deleteGroup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing group. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+   *   DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   groupServiceClient.deleteGroup(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteGroup(DeleteGroupRequest request) { + deleteGroupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing group. + * + *

Sample code: + * + *


+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+   *   DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = groupServiceClient.deleteGroupCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteGroupCallable() { + return stub.deleteGroupCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists the existing groups. @@ -180,7 +337,7 @@ public GroupServiceStub getStub() { * *

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (Group element : groupServiceClient.listGroups(name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -191,7 +348,7 @@ public GroupServiceStub getStub() {
    *     

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListGroupsPagedResponse listGroups(ProjectName name) { + public final ListGroupsPagedResponse listGroups(ResourceName name) { ListGroupsRequest request = ListGroupsRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return listGroups(request); @@ -205,7 +362,7 @@ public final ListGroupsPagedResponse listGroups(ProjectName name) { * *


    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (Group element : groupServiceClient.listGroups(name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -229,7 +386,7 @@ public final ListGroupsPagedResponse listGroups(String name) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListGroupsRequest request = ListGroupsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -254,7 +411,7 @@ public final ListGroupsPagedResponse listGroups(ListGroupsRequest request) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListGroupsRequest request = ListGroupsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -278,7 +435,7 @@ public final UnaryCallable listGroup
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListGroupsRequest request = ListGroupsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -309,7 +466,7 @@ public final UnaryCallable listGroupsCall
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   Group response = groupServiceClient.getGroup(name);
    * }
    * 
@@ -332,7 +489,7 @@ public final Group getGroup(GroupName name) { * *

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   Group response = groupServiceClient.getGroup(name.toString());
    * }
    * 
@@ -354,7 +511,7 @@ public final Group getGroup(String name) { * *

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   GetGroupRequest request = GetGroupRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -377,7 +534,7 @@ public final Group getGroup(GetGroupRequest request) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   GetGroupRequest request = GetGroupRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -399,7 +556,7 @@ public final UnaryCallable getGroupCallable() {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   Group group = Group.newBuilder().build();
    *   Group response = groupServiceClient.createGroup(name, group);
    * }
@@ -411,7 +568,7 @@ public final UnaryCallable getGroupCallable() {
    *     the system assigns the name.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final Group createGroup(ProjectName name, Group group) {
+  public final Group createGroup(ResourceName name, Group group) {
     CreateGroupRequest request =
         CreateGroupRequest.newBuilder()
             .setName(name == null ? null : name.toString())
@@ -428,7 +585,7 @@ public final Group createGroup(ProjectName name, Group group) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   Group group = Group.newBuilder().build();
    *   Group response = groupServiceClient.createGroup(name.toString(), group);
    * }
@@ -454,7 +611,7 @@ public final Group createGroup(String name, Group group) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   Group group = Group.newBuilder().build();
    *   CreateGroupRequest request = CreateGroupRequest.newBuilder()
    *     .setName(name.toString())
@@ -479,7 +636,7 @@ public final Group createGroup(CreateGroupRequest request) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   Group group = Group.newBuilder().build();
    *   CreateGroupRequest request = CreateGroupRequest.newBuilder()
    *     .setName(name.toString())
@@ -495,163 +652,6 @@ public final UnaryCallable createGroupCallable() {
     return stub.createGroupCallable();
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Updates an existing group. You can change any group attributes except `name`.
-   *
-   * 

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   Group group = Group.newBuilder().build();
-   *   Group response = groupServiceClient.updateGroup(group);
-   * }
-   * 
- * - * @param group Required. The new definition of the group. All fields of the existing group, - * excepting `name`, are replaced with the corresponding fields of this group. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final Group updateGroup(Group group) { - UpdateGroupRequest request = UpdateGroupRequest.newBuilder().setGroup(group).build(); - return updateGroup(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Updates an existing group. You can change any group attributes except `name`. - * - *

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   Group group = Group.newBuilder().build();
-   *   UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
-   *     .setGroup(group)
-   *     .build();
-   *   Group response = groupServiceClient.updateGroup(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.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`. - * - *

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   Group group = Group.newBuilder().build();
-   *   UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
-   *     .setGroup(group)
-   *     .build();
-   *   ApiFuture<Group> future = groupServiceClient.updateGroupCallable().futureCall(request);
-   *   // Do something
-   *   Group response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable updateGroupCallable() { - return stub.updateGroupCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an existing group. - * - *

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
-   *   groupServiceClient.deleteGroup(name);
-   * }
-   * 
- * - * @param name Required. The group to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteGroup(GroupName name) { - DeleteGroupRequest request = - DeleteGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteGroup(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an existing group. - * - *

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
-   *   groupServiceClient.deleteGroup(name.toString());
-   * }
-   * 
- * - * @param name Required. The group to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteGroup(String name) { - DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setName(name).build(); - deleteGroup(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an existing group. - * - *

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
-   *   DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   groupServiceClient.deleteGroup(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteGroup(DeleteGroupRequest request) { - deleteGroupCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an existing group. - * - *

Sample code: - * - *


-   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
-   *   DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = groupServiceClient.deleteGroupCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteGroupCallable() { - return stub.deleteGroupCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists the monitored resources that are members of a group. @@ -660,7 +660,7 @@ public final UnaryCallable deleteGroupCallable() { * *

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   for (MonitoredResource element : groupServiceClient.listGroupMembers(name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -685,7 +685,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(GroupName name) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   for (MonitoredResource element : groupServiceClient.listGroupMembers(name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -709,7 +709,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(String name) {
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   ListGroupMembersRequest request = ListGroupMembersRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -734,7 +734,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(ListGroupMembersRequ
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   ListGroupMembersRequest request = ListGroupMembersRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -759,7 +759,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(ListGroupMembersRequ
    *
    * 

    * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
-   *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
    *   ListGroupMembersRequest request = ListGroupMembersRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java
index 790fb8be..e121343c 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java
@@ -59,16 +59,16 @@
  * 

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: + *

For example, to set the total timeout of updateGroup to 30 seconds: * *

  * 
  * GroupServiceSettings.Builder groupServiceSettingsBuilder =
  *     GroupServiceSettings.newBuilder();
  * groupServiceSettingsBuilder
- *     .getGroupSettings()
+ *     .updateGroupSettings()
  *     .setRetrySettings(
- *         groupServiceSettingsBuilder.getGroupSettings().getRetrySettings().toBuilder()
+ *         groupServiceSettingsBuilder.updateGroupSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * GroupServiceSettings groupServiceSettings = groupServiceSettingsBuilder.build();
@@ -77,6 +77,16 @@
  */
 @Generated("by gapic-generator")
 public class GroupServiceSettings extends ClientSettings {
+  /** Returns the object with the settings used for calls to updateGroup. */
+  public UnaryCallSettings updateGroupSettings() {
+    return ((GroupServiceStubSettings) getStubSettings()).updateGroupSettings();
+  }
+
+  /** Returns the object with the settings used for calls to deleteGroup. */
+  public UnaryCallSettings deleteGroupSettings() {
+    return ((GroupServiceStubSettings) getStubSettings()).deleteGroupSettings();
+  }
+
   /** Returns the object with the settings used for calls to listGroups. */
   public PagedCallSettings
       listGroupsSettings() {
@@ -93,16 +103,6 @@ public UnaryCallSettings createGroupSettings() {
     return ((GroupServiceStubSettings) getStubSettings()).createGroupSettings();
   }
 
-  /** Returns the object with the settings used for calls to updateGroup. */
-  public UnaryCallSettings updateGroupSettings() {
-    return ((GroupServiceStubSettings) getStubSettings()).updateGroupSettings();
-  }
-
-  /** Returns the object with the settings used for calls to deleteGroup. */
-  public UnaryCallSettings deleteGroupSettings() {
-    return ((GroupServiceStubSettings) getStubSettings()).deleteGroupSettings();
-  }
-
   /** Returns the object with the settings used for calls to listGroupMembers. */
   public PagedCallSettings<
           ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
@@ -207,6 +207,16 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to updateGroup. */
+    public UnaryCallSettings.Builder updateGroupSettings() {
+      return getStubSettingsBuilder().updateGroupSettings();
+    }
+
+    /** Returns the builder for the settings used for calls to deleteGroup. */
+    public UnaryCallSettings.Builder deleteGroupSettings() {
+      return getStubSettingsBuilder().deleteGroupSettings();
+    }
+
     /** Returns the builder for the settings used for calls to listGroups. */
     public PagedCallSettings.Builder
         listGroupsSettings() {
@@ -223,16 +233,6 @@ public UnaryCallSettings.Builder createGroupSettings(
       return getStubSettingsBuilder().createGroupSettings();
     }
 
-    /** Returns the builder for the settings used for calls to updateGroup. */
-    public UnaryCallSettings.Builder updateGroupSettings() {
-      return getStubSettingsBuilder().updateGroupSettings();
-    }
-
-    /** Returns the builder for the settings used for calls to deleteGroup. */
-    public UnaryCallSettings.Builder deleteGroupSettings() {
-      return getStubSettingsBuilder().deleteGroupSettings();
-    }
-
     /** Returns the builder for the settings used for calls to listGroupMembers. */
     public PagedCallSettings.Builder<
             ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java
index aebda72b..1c98fc62 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java
@@ -27,6 +27,7 @@
 import com.google.api.gax.paging.AbstractPagedListResponse;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
 import com.google.cloud.monitoring.v3.stub.MetricServiceStub;
 import com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -63,7 +64,7 @@
  * 
  * 
  * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
  *   MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name);
  * }
  * 
@@ -181,7 +182,7 @@ public MetricServiceStub getStub() {
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (MonitoredResourceDescriptor element : metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -193,7 +194,7 @@ public MetricServiceStub getStub() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(
-      ProjectName name) {
+      ResourceName name) {
     ListMonitoredResourceDescriptorsRequest request =
         ListMonitoredResourceDescriptorsRequest.newBuilder()
             .setName(name == null ? null : name.toString())
@@ -210,7 +211,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (MonitoredResourceDescriptor element : metricServiceClient.listMonitoredResourceDescriptors(name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -237,7 +238,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -264,7 +265,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -291,7 +292,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -324,7 +325,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
    *   MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name);
    * }
    * 
@@ -351,7 +352,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor( * *

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
    *   MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name.toString());
    * }
    * 
@@ -375,7 +376,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String n * *

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
    *   GetMonitoredResourceDescriptorRequest request = GetMonitoredResourceDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -399,7 +400,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+   *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
    *   GetMonitoredResourceDescriptorRequest request = GetMonitoredResourceDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -422,7 +423,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (MetricDescriptor element : metricServiceClient.listMetricDescriptors(name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -433,7 +434,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
    *     

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectName name) { + public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ResourceName name) { ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder() .setName(name == null ? null : name.toString()) @@ -449,7 +450,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectNam * *


    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   for (MetricDescriptor element : metricServiceClient.listMetricDescriptors(name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -474,7 +475,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(String nam
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -500,7 +501,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -525,7 +526,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -557,7 +558,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   MetricDescriptor response = metricServiceClient.getMetricDescriptor(name);
    * }
    * 
@@ -584,7 +585,7 @@ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) { * *

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   MetricDescriptor response = metricServiceClient.getMetricDescriptor(name.toString());
    * }
    * 
@@ -609,7 +610,7 @@ public final MetricDescriptor getMetricDescriptor(String name) { * *

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -632,7 +633,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -656,7 +657,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
    *   MetricDescriptor response = metricServiceClient.createMetricDescriptor(name, metricDescriptor);
    * }
@@ -669,7 +670,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   public final MetricDescriptor createMetricDescriptor(
-      ProjectName name, MetricDescriptor metricDescriptor) {
+      ResourceName name, MetricDescriptor metricDescriptor) {
     CreateMetricDescriptorRequest request =
         CreateMetricDescriptorRequest.newBuilder()
             .setName(name == null ? null : name.toString())
@@ -687,7 +688,7 @@ public final MetricDescriptor createMetricDescriptor(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
    *   MetricDescriptor response = metricServiceClient.createMetricDescriptor(name.toString(), metricDescriptor);
    * }
@@ -718,7 +719,7 @@ public final MetricDescriptor createMetricDescriptor(
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
    *   CreateMetricDescriptorRequest request = CreateMetricDescriptorRequest.newBuilder()
    *     .setName(name.toString())
@@ -744,7 +745,7 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   ResourceName name = ProjectName.of("[PROJECT]");
    *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
    *   CreateMetricDescriptorRequest request = CreateMetricDescriptorRequest.newBuilder()
    *     .setName(name.toString())
@@ -770,7 +771,7 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   metricServiceClient.deleteMetricDescriptor(name);
    * }
    * 
@@ -797,7 +798,7 @@ public final void deleteMetricDescriptor(MetricDescriptorName name) { * *

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   metricServiceClient.deleteMetricDescriptor(name.toString());
    * }
    * 
@@ -822,7 +823,7 @@ public final void deleteMetricDescriptor(String name) { * *

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   DeleteMetricDescriptorRequest request = DeleteMetricDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -846,7 +847,7 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request)
    *
    * 

    * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
-   *   MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
    *   DeleteMetricDescriptorRequest request = DeleteMetricDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
index 90ba9f67..304c64ac 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
@@ -25,6 +25,7 @@
 import com.google.api.gax.paging.AbstractPagedListResponse;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
 import com.google.cloud.monitoring.v3.stub.NotificationChannelServiceStub;
 import com.google.cloud.monitoring.v3.stub.NotificationChannelServiceStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -42,7 +43,6 @@
 import com.google.monitoring.v3.NotificationChannelDescriptor;
 import com.google.monitoring.v3.NotificationChannelDescriptorName;
 import com.google.monitoring.v3.NotificationChannelName;
-import com.google.monitoring.v3.ProjectName;
 import com.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest;
 import com.google.monitoring.v3.UpdateNotificationChannelRequest;
 import com.google.monitoring.v3.VerifyNotificationChannelRequest;
@@ -64,8 +64,9 @@
  * 
  * 
  * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+ *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ *   boolean force = false;
+ *   notificationChannelServiceClient.deleteNotificationChannel(name, force);
  * }
  * 
  * 
@@ -178,332 +179,468 @@ public NotificationChannelServiceStub getStub() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the descriptors for supported channel types. The use of descriptors makes it possible for - * new channel types to be dynamically added. + * Deletes a notification channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   boolean force = false;
+   *   notificationChannelServiceClient.deleteNotificationChannel(name, force);
    * }
    * 
* - * @param name Required. The REST resource name of the parent from which to retrieve the - * notification channel descriptors. The expected syntax is: - *

projects/[PROJECT_ID_OR_NUMBER] - *

Note that this names the parent container in which to look for the descriptors; to - * retrieve a single descriptor by name, use the - * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] - * operation, instead. + * @param name Required. The channel for which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param force If true, the notification channel will be deleted regardless of its use in alert + * policies (the policies will be updated to remove the channel). If false, channels that are + * still referenced by an existing alerting policy will fail to be deleted in a delete + * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors( - ProjectName name) { - ListNotificationChannelDescriptorsRequest request = - ListNotificationChannelDescriptorsRequest.newBuilder() + public final void deleteNotificationChannel(NotificationChannelName name, boolean force) { + DeleteNotificationChannelRequest request = + DeleteNotificationChannelRequest.newBuilder() .setName(name == null ? null : name.toString()) + .setForce(force) .build(); - return listNotificationChannelDescriptors(request); + deleteNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the descriptors for supported channel types. The use of descriptors makes it possible for - * new channel types to be dynamically added. + * Deletes a notification channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   boolean force = false;
+   *   notificationChannelServiceClient.deleteNotificationChannel(name.toString(), force);
    * }
    * 
* - * @param name Required. The REST resource name of the parent from which to retrieve the - * notification channel descriptors. The expected syntax is: - *

projects/[PROJECT_ID_OR_NUMBER] - *

Note that this names the parent container in which to look for the descriptors; to - * retrieve a single descriptor by name, use the - * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] - * operation, instead. + * @param name Required. The channel for which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param force If true, the notification channel will be deleted regardless of its use in alert + * policies (the policies will be updated to remove the channel). If false, channels that are + * still referenced by an existing alerting policy will fail to be deleted in a delete + * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors( - String name) { - ListNotificationChannelDescriptorsRequest request = - ListNotificationChannelDescriptorsRequest.newBuilder().setName(name).build(); - return listNotificationChannelDescriptors(request); + public final void deleteNotificationChannel(String name, boolean force) { + DeleteNotificationChannelRequest request = + DeleteNotificationChannelRequest.newBuilder().setName(name).setForce(force).build(); + deleteNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the descriptors for supported channel types. The use of descriptors makes it possible for - * new channel types to be dynamically added. + * Deletes a notification channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   notificationChannelServiceClient.deleteNotificationChannel(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors( - ListNotificationChannelDescriptorsRequest request) { - return listNotificationChannelDescriptorsPagedCallable().call(request); + public final void deleteNotificationChannel(DeleteNotificationChannelRequest request) { + deleteNotificationChannelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the descriptors for supported channel types. The use of descriptors makes it possible for - * new channel types to be dynamically added. + * Deletes a notification channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<ListNotificationChannelDescriptorsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelDescriptorsPagedCallable().futureCall(request);
+   *   ApiFuture<Void> future = notificationChannelServiceClient.deleteNotificationChannelCallable().futureCall(request);
    *   // Do something
-   *   for (NotificationChannelDescriptor element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable< - ListNotificationChannelDescriptorsRequest, - ListNotificationChannelDescriptorsPagedResponse> - listNotificationChannelDescriptorsPagedCallable() { - return stub.listNotificationChannelDescriptorsPagedCallable(); + public final UnaryCallable + deleteNotificationChannelCallable() { + return stub.deleteNotificationChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the descriptors for supported channel types. The use of descriptors makes it possible for - * new channel types to be dynamically added. + * Requests a verification code for an already verified channel that can then be used in a call to + * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or + * in a different project. This makes it possible to copy a channel between projects without + * requiring manual reverification of the channel. If the channel is not in the verified state, + * this method will fail (in other words, this may only be used if the + * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been + * used to put the given channel into the verified state). + * + *

There is no guarantee that the verification codes returned by this method will be of a + * similar structure or form as the ones that are delivered to the channel via + * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both + * the codes delivered via SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes + * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter + * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return + * a much longer, websafe base 64 encoded string that has a longer expiration time. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name);
+   * }
+   * 
+ * + * @param name Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if the specified channel + * is not verified, the request will fail. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetNotificationChannelVerificationCodeResponse + getNotificationChannelVerificationCode(NotificationChannelName name) { + GetNotificationChannelVerificationCodeRequest request = + GetNotificationChannelVerificationCodeRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getNotificationChannelVerificationCode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Requests a verification code for an already verified channel that can then be used in a call to + * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or + * in a different project. This makes it possible to copy a channel between projects without + * requiring manual reverification of the channel. If the channel is not in the verified state, + * this method will fail (in other words, this may only be used if the + * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been + * used to put the given channel into the verified state). + * + *

There is no guarantee that the verification codes returned by this method will be of a + * similar structure or form as the ones that are delivered to the channel via + * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both + * the codes delivered via SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes + * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter + * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return + * a much longer, websafe base 64 encoded string that has a longer expiration time. + * + *

Sample code: + * + *


+   * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name.toString());
+   * }
+   * 
+ * + * @param name Required. The notification channel for which a verification code is to be generated + * and retrieved. This must name a channel that is already verified; if the specified channel + * is not verified, the request will fail. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetNotificationChannelVerificationCodeResponse + getNotificationChannelVerificationCode(String name) { + GetNotificationChannelVerificationCodeRequest request = + GetNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build(); + return getNotificationChannelVerificationCode(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Requests a verification code for an already verified channel that can then be used in a call to + * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or + * in a different project. This makes it possible to copy a channel between projects without + * requiring manual reverification of the channel. If the channel is not in the verified state, + * this method will fail (in other words, this may only be used if the + * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been + * used to put the given channel into the verified state). + * + *

There is no guarantee that the verification codes returned by this method will be of a + * similar structure or form as the ones that are delivered to the channel via + * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both + * the codes delivered via SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes + * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter + * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return + * a much longer, websafe base 64 encoded string that has a longer expiration time. + * + *

Sample code: + * + *


+   * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   while (true) {
-   *     ListNotificationChannelDescriptorsResponse response = notificationChannelServiceClient.listNotificationChannelDescriptorsCallable().call(request);
-   *     for (NotificationChannelDescriptor element : response.getChannelDescriptorsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GetNotificationChannelVerificationCodeResponse + getNotificationChannelVerificationCode( + GetNotificationChannelVerificationCodeRequest request) { + return getNotificationChannelVerificationCodeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Requests a verification code for an already verified channel that can then be used in a call to + * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or + * in a different project. This makes it possible to copy a channel between projects without + * requiring manual reverification of the channel. If the channel is not in the verified state, + * this method will fail (in other words, this may only be used if the + * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been + * used to put the given channel into the verified state). + * + *

There is no guarantee that the verification codes returned by this method will be of a + * similar structure or form as the ones that are delivered to the channel via + * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both + * the codes delivered via SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes + * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter + * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return + * a much longer, websafe base 64 encoded string that has a longer expiration time. + * + *

Sample code: + * + *


+   * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<GetNotificationChannelVerificationCodeResponse> future = notificationChannelServiceClient.getNotificationChannelVerificationCodeCallable().futureCall(request);
+   *   // Do something
+   *   GetNotificationChannelVerificationCodeResponse response = future.get();
    * }
    * 
*/ public final UnaryCallable< - ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse> - listNotificationChannelDescriptorsCallable() { - return stub.listNotificationChannelDescriptorsCallable(); + GetNotificationChannelVerificationCodeRequest, + GetNotificationChannelVerificationCodeResponse> + getNotificationChannelVerificationCodeCallable() { + return stub.getNotificationChannelVerificationCodeCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single channel descriptor. The descriptor indicates which fields are expected / - * permitted for a notification channel of the given type. + * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a + * result of calling `SendNotificationChannelVerificationCode`. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
-   *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   String code = "";
+   *   NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name, code);
    * }
    * 
* - * @param name Required. The channel type for which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * @param name Required. The notification channel to verify. + * @param code Required. The verification code that was delivered to the channel as a result of + * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved + * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one + * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that + * the code is valid UTF-8; one should not make any assumptions regarding the structure or + * format of the code). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannelDescriptor getNotificationChannelDescriptor( - NotificationChannelDescriptorName name) { - GetNotificationChannelDescriptorRequest request = - GetNotificationChannelDescriptorRequest.newBuilder() + public final NotificationChannel verifyNotificationChannel( + NotificationChannelName name, String code) { + VerifyNotificationChannelRequest request = + VerifyNotificationChannelRequest.newBuilder() .setName(name == null ? null : name.toString()) + .setCode(code) .build(); - return getNotificationChannelDescriptor(request); + return verifyNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single channel descriptor. The descriptor indicates which fields are expected / - * permitted for a notification channel of the given type. + * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a + * result of calling `SendNotificationChannelVerificationCode`. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
-   *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name.toString());
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   String code = "";
+   *   NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name.toString(), code);
    * }
    * 
* - * @param name Required. The channel type for which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] + * @param name Required. The notification channel to verify. + * @param code Required. The verification code that was delivered to the channel as a result of + * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved + * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one + * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that + * the code is valid UTF-8; one should not make any assumptions regarding the structure or + * format of the code). * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannelDescriptor getNotificationChannelDescriptor(String name) { - GetNotificationChannelDescriptorRequest request = - GetNotificationChannelDescriptorRequest.newBuilder().setName(name).build(); - return getNotificationChannelDescriptor(request); + public final NotificationChannel verifyNotificationChannel(String name, String code) { + VerifyNotificationChannelRequest request = + VerifyNotificationChannelRequest.newBuilder().setName(name).setCode(code).build(); + return verifyNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single channel descriptor. The descriptor indicates which fields are expected / - * permitted for a notification channel of the given type. + * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a + * result of calling `SendNotificationChannelVerificationCode`. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
-   *   GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   String code = "";
+   *   VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setCode(code)
    *     .build();
-   *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(request);
+   *   NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannelDescriptor getNotificationChannelDescriptor( - GetNotificationChannelDescriptorRequest request) { - return getNotificationChannelDescriptorCallable().call(request); + public final NotificationChannel verifyNotificationChannel( + VerifyNotificationChannelRequest request) { + return verifyNotificationChannelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single channel descriptor. The descriptor indicates which fields are expected / - * permitted for a notification channel of the given type. + * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a + * result of calling `SendNotificationChannelVerificationCode`. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
-   *   GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   String code = "";
+   *   VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setCode(code)
    *     .build();
-   *   ApiFuture<NotificationChannelDescriptor> future = notificationChannelServiceClient.getNotificationChannelDescriptorCallable().futureCall(request);
+   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.verifyNotificationChannelCallable().futureCall(request);
    *   // Do something
-   *   NotificationChannelDescriptor response = future.get();
+   *   NotificationChannel response = future.get();
    * }
    * 
*/ - public final UnaryCallable - getNotificationChannelDescriptorCallable() { - return stub.getNotificationChannelDescriptorCallable(); + public final UnaryCallable + verifyNotificationChannelCallable() { + return stub.verifyNotificationChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the notification channels that have been created for the project. + * Lists the descriptors for supported channel types. The use of descriptors makes it possible for + * new channel types to be dynamically added. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name).iterateAll()) {
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param name Required. The project on which to execute the request. The format is: + * @param name Required. The REST resource name of the parent from which to retrieve the + * notification channel descriptors. The expected syntax is: *

projects/[PROJECT_ID_OR_NUMBER] - *

This names the container in which to look for the notification channels; it does not - * name a specific channel. To query a specific channel by REST resource name, use the - * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] - * operation. + *

Note that this names the parent container in which to look for the descriptors; to + * retrieve a single descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListNotificationChannelsPagedResponse listNotificationChannels(ProjectName name) { - ListNotificationChannelsRequest request = - ListNotificationChannelsRequest.newBuilder() + public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors( + ResourceName name) { + ListNotificationChannelDescriptorsRequest request = + ListNotificationChannelDescriptorsRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); - return listNotificationChannels(request); + return listNotificationChannelDescriptors(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the notification channels that have been created for the project. + * Lists the descriptors for supported channel types. The use of descriptors makes it possible for + * new channel types to be dynamically added. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name.toString()).iterateAll()) {
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
* - * @param name Required. The project on which to execute the request. The format is: + * @param name Required. The REST resource name of the parent from which to retrieve the + * notification channel descriptors. The expected syntax is: *

projects/[PROJECT_ID_OR_NUMBER] - *

This names the container in which to look for the notification channels; it does not - * name a specific channel. To query a specific channel by REST resource name, use the - * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] - * operation. + *

Note that this names the parent container in which to look for the descriptors; to + * retrieve a single descriptor by name, use the + * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor] + * operation, instead. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListNotificationChannelsPagedResponse listNotificationChannels(String name) { - ListNotificationChannelsRequest request = - ListNotificationChannelsRequest.newBuilder().setName(name).build(); - return listNotificationChannels(request); + public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors( + String name) { + ListNotificationChannelDescriptorsRequest request = + ListNotificationChannelDescriptorsRequest.newBuilder().setName(name).build(); + return listNotificationChannelDescriptors(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the notification channels that have been created for the project. + * Lists the descriptors for supported channel types. The use of descriptors makes it possible for + * new channel types to be dynamically added. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(request).iterateAll()) {
+   *   for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -512,51 +649,55 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Stri
    * @param request The request object containing all of the parameters for the API call.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final ListNotificationChannelsPagedResponse listNotificationChannels(
-      ListNotificationChannelsRequest request) {
-    return listNotificationChannelsPagedCallable().call(request);
+  public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
+      ListNotificationChannelDescriptorsRequest request) {
+    return listNotificationChannelDescriptorsPagedCallable().call(request);
   }
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD
   /**
-   * Lists the notification channels that have been created for the project.
+   * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
+   * new channel types to be dynamically added.
    *
    * 

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<ListNotificationChannelsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelsPagedCallable().futureCall(request);
+   *   ApiFuture<ListNotificationChannelDescriptorsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelDescriptorsPagedCallable().futureCall(request);
    *   // Do something
-   *   for (NotificationChannel element : future.get().iterateAll()) {
+   *   for (NotificationChannelDescriptor element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * 
*/ - public final UnaryCallable - listNotificationChannelsPagedCallable() { - return stub.listNotificationChannelsPagedCallable(); + public final UnaryCallable< + ListNotificationChannelDescriptorsRequest, + ListNotificationChannelDescriptorsPagedResponse> + listNotificationChannelDescriptorsPagedCallable() { + return stub.listNotificationChannelDescriptorsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Lists the notification channels that have been created for the project. + * Lists the descriptors for supported channel types. The use of descriptors makes it possible for + * new channel types to be dynamically added. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
    *   while (true) {
-   *     ListNotificationChannelsResponse response = notificationChannelServiceClient.listNotificationChannelsCallable().call(request);
-   *     for (NotificationChannel element : response.getNotificationChannelsList()) {
+   *     ListNotificationChannelDescriptorsResponse response = notificationChannelServiceClient.listNotificationChannelDescriptorsCallable().call(request);
+   *     for (NotificationChannelDescriptor element : response.getChannelDescriptorsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -569,794 +710,654 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(
    * }
    * 
*/ - public final UnaryCallable - listNotificationChannelsCallable() { - return stub.listNotificationChannelsCallable(); + public final UnaryCallable< + ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse> + listNotificationChannelDescriptorsCallable() { + return stub.listNotificationChannelDescriptorsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single notification channel. The channel includes the relevant configuration details - * with which the channel was created. However, the response may truncate or omit passwords, API - * keys, or other private key matter and thus the response may not be 100% identical to the - * information that was supplied in the call to the create method. + * Gets a single channel descriptor. The descriptor indicates which fields are expected / + * permitted for a notification channel of the given type. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name);
+   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+   *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
    * }
    * 
* - * @param name Required. The channel for which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param name Required. The channel type for which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel getNotificationChannel(NotificationChannelName name) { - GetNotificationChannelRequest request = - GetNotificationChannelRequest.newBuilder() + public final NotificationChannelDescriptor getNotificationChannelDescriptor( + NotificationChannelDescriptorName name) { + GetNotificationChannelDescriptorRequest request = + GetNotificationChannelDescriptorRequest.newBuilder() .setName(name == null ? null : name.toString()) .build(); - return getNotificationChannel(request); + return getNotificationChannelDescriptor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single notification channel. The channel includes the relevant configuration details - * with which the channel was created. However, the response may truncate or omit passwords, API - * keys, or other private key matter and thus the response may not be 100% identical to the - * information that was supplied in the call to the create method. + * Gets a single channel descriptor. The descriptor indicates which fields are expected / + * permitted for a notification channel of the given type. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name.toString());
+   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+   *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name.toString());
    * }
    * 
* - * @param name Required. The channel for which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] + * @param name Required. The channel type for which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE] * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel getNotificationChannel(String name) { - GetNotificationChannelRequest request = - GetNotificationChannelRequest.newBuilder().setName(name).build(); - return getNotificationChannel(request); + public final NotificationChannelDescriptor getNotificationChannelDescriptor(String name) { + GetNotificationChannelDescriptorRequest request = + GetNotificationChannelDescriptorRequest.newBuilder().setName(name).build(); + return getNotificationChannelDescriptor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single notification channel. The channel includes the relevant configuration details - * with which the channel was created. However, the response may truncate or omit passwords, API - * keys, or other private key matter and thus the response may not be 100% identical to the - * information that was supplied in the call to the create method. + * Gets a single channel descriptor. The descriptor indicates which fields are expected / + * permitted for a notification channel of the given type. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
+   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+   *   GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(request);
+   *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel getNotificationChannel(GetNotificationChannelRequest request) { - return getNotificationChannelCallable().call(request); + public final NotificationChannelDescriptor getNotificationChannelDescriptor( + GetNotificationChannelDescriptorRequest request) { + return getNotificationChannelDescriptorCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Gets a single notification channel. The channel includes the relevant configuration details - * with which the channel was created. However, the response may truncate or omit passwords, API - * keys, or other private key matter and thus the response may not be 100% identical to the - * information that was supplied in the call to the create method. + * Gets a single channel descriptor. The descriptor indicates which fields are expected / + * permitted for a notification channel of the given type. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
+   *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+   *   GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.getNotificationChannelCallable().futureCall(request);
+   *   ApiFuture<NotificationChannelDescriptor> future = notificationChannelServiceClient.getNotificationChannelDescriptorCallable().futureCall(request);
    *   // Do something
-   *   NotificationChannel response = future.get();
-   * }
-   * 
- */ - public final UnaryCallable - getNotificationChannelCallable() { - return stub.getNotificationChannelCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates a new notification channel, representing a single notification endpoint such as an - * email address, SMS number, or PagerDuty service. - * - *

Sample code: - * - *


-   * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
+   *   NotificationChannelDescriptor response = future.get();
    * }
    * 
- * - * @param name Required. The project on which to execute the request. The format is: - *

projects/[PROJECT_ID_OR_NUMBER] - *

This names the container into which the channel will be written, this does not name the - * newly created channel. The resulting channel's name will have a normalized version of this - * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the - * channel. - * @param notificationChannel Required. The definition of the `NotificationChannel` to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel createNotificationChannel( - ProjectName name, NotificationChannel notificationChannel) { - CreateNotificationChannelRequest request = - CreateNotificationChannelRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setNotificationChannel(notificationChannel) - .build(); - return createNotificationChannel(request); + public final UnaryCallable + getNotificationChannelDescriptorCallable() { + return stub.getNotificationChannelDescriptorCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new notification channel, representing a single notification endpoint such as an - * email address, SMS number, or PagerDuty service. + * Lists the notification channels that have been created for the project. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name.toString(), notificationChannel);
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] - *

This names the container into which the channel will be written, this does not name the - * newly created channel. The resulting channel's name will have a normalized version of this - * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the - * channel. - * @param notificationChannel Required. The definition of the `NotificationChannel` to create. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final NotificationChannel createNotificationChannel( - String name, NotificationChannel notificationChannel) { - CreateNotificationChannelRequest request = - CreateNotificationChannelRequest.newBuilder() - .setName(name) - .setNotificationChannel(notificationChannel) - .build(); - return createNotificationChannel(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Creates a new notification channel, representing a single notification endpoint such as an - * email address, SMS number, or PagerDuty service. - * - *

Sample code: - * - *


-   * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setNotificationChannel(notificationChannel)
-   *     .build();
-   *   NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. + *

This names the container in which to look for the notification channels; it does not + * name a specific channel. To query a specific channel by REST resource name, use the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel createNotificationChannel( - CreateNotificationChannelRequest request) { - return createNotificationChannelCallable().call(request); + public final ListNotificationChannelsPagedResponse listNotificationChannels(ResourceName name) { + ListNotificationChannelsRequest request = + ListNotificationChannelsRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return listNotificationChannels(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Creates a new notification channel, representing a single notification endpoint such as an - * email address, SMS number, or PagerDuty service. + * Lists the notification channels that have been created for the project. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   ProjectName name = ProjectName.of("[PROJECT]");
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .setNotificationChannel(notificationChannel)
-   *     .build();
-   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.createNotificationChannelCallable().futureCall(request);
-   *   // Do something
-   *   NotificationChannel response = future.get();
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
+ * + * @param name Required. The project on which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER] + *

This names the container in which to look for the notification channels; it does not + * name a specific channel. To query a specific channel by REST resource name, use the + * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] + * operation. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable - createNotificationChannelCallable() { - return stub.createNotificationChannelCallable(); + public final ListNotificationChannelsPagedResponse listNotificationChannels(String name) { + ListNotificationChannelsRequest request = + ListNotificationChannelsRequest.newBuilder().setName(name).build(); + return listNotificationChannels(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a notification channel. Fields not specified in the field mask remain unchanged. + * Lists the notification channels that have been created for the project. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(updateMask, notificationChannel);
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
* - * @param updateMask The fields to update. - * @param notificationChannel Required. A description of the changes to be applied to the - * specified notification channel. The description must provide a definition for fields to be - * updated; the names of these fields should also be included in the `update_mask`. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel updateNotificationChannel( - FieldMask updateMask, NotificationChannel notificationChannel) { - UpdateNotificationChannelRequest request = - UpdateNotificationChannelRequest.newBuilder() - .setUpdateMask(updateMask) - .setNotificationChannel(notificationChannel) - .build(); - return updateNotificationChannel(request); + public final ListNotificationChannelsPagedResponse listNotificationChannels( + ListNotificationChannelsRequest request) { + return listNotificationChannelsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a notification channel. Fields not specified in the field mask remain unchanged. + * Lists the notification channels that have been created for the project. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
-   *     .setNotificationChannel(notificationChannel)
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(request);
+   *   ApiFuture<ListNotificationChannelsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (NotificationChannel element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel updateNotificationChannel( - UpdateNotificationChannelRequest request) { - return updateNotificationChannelCallable().call(request); + public final UnaryCallable + listNotificationChannelsPagedCallable() { + return stub.listNotificationChannelsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Updates a notification channel. Fields not specified in the field mask remain unchanged. + * Lists the notification channels that have been created for the project. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
-   *   UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
-   *     .setNotificationChannel(notificationChannel)
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+   *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.updateNotificationChannelCallable().futureCall(request);
-   *   // Do something
-   *   NotificationChannel response = future.get();
+   *   while (true) {
+   *     ListNotificationChannelsResponse response = notificationChannelServiceClient.listNotificationChannelsCallable().call(request);
+   *     for (NotificationChannel element : response.getNotificationChannelsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
    * }
    * 
*/ - public final UnaryCallable - updateNotificationChannelCallable() { - return stub.updateNotificationChannelCallable(); + public final UnaryCallable + listNotificationChannelsCallable() { + return stub.listNotificationChannelsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a notification channel. + * Gets a single notification channel. The channel includes the relevant configuration details + * with which the channel was created. However, the response may truncate or omit passwords, API + * keys, or other private key matter and thus the response may not be 100% identical to the + * information that was supplied in the call to the create method. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   boolean force = false;
-   *   notificationChannelServiceClient.deleteNotificationChannel(name, force);
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name);
    * }
    * 
* * @param name Required. The channel for which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @param force If true, the notification channel will be deleted regardless of its use in alert - * policies (the policies will be updated to remove the channel). If false, channels that are - * still referenced by an existing alerting policy will fail to be deleted in a delete - * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteNotificationChannel(NotificationChannelName name, boolean force) { - DeleteNotificationChannelRequest request = - DeleteNotificationChannelRequest.newBuilder() + public final NotificationChannel getNotificationChannel(NotificationChannelName name) { + GetNotificationChannelRequest request = + GetNotificationChannelRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setForce(force) .build(); - deleteNotificationChannel(request); + return getNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a notification channel. + * Gets a single notification channel. The channel includes the relevant configuration details + * with which the channel was created. However, the response may truncate or omit passwords, API + * keys, or other private key matter and thus the response may not be 100% identical to the + * information that was supplied in the call to the create method. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   boolean force = false;
-   *   notificationChannelServiceClient.deleteNotificationChannel(name.toString(), force);
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name.toString());
    * }
    * 
* * @param name Required. The channel for which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] - * @param force If true, the notification channel will be deleted regardless of its use in alert - * policies (the policies will be updated to remove the channel). If false, channels that are - * still referenced by an existing alerting policy will fail to be deleted in a delete - * operation. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteNotificationChannel(String name, boolean force) { - DeleteNotificationChannelRequest request = - DeleteNotificationChannelRequest.newBuilder().setName(name).setForce(force).build(); - deleteNotificationChannel(request); + public final NotificationChannel getNotificationChannel(String name) { + GetNotificationChannelRequest request = + GetNotificationChannelRequest.newBuilder().setName(name).build(); + return getNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a notification channel. + * Gets a single notification channel. The channel includes the relevant configuration details + * with which the channel was created. However, the response may truncate or omit passwords, API + * keys, or other private key matter and thus the response may not be 100% identical to the + * information that was supplied in the call to the create method. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   notificationChannelServiceClient.deleteNotificationChannel(request);
+   *   NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteNotificationChannel(DeleteNotificationChannelRequest request) { - deleteNotificationChannelCallable().call(request); + public final NotificationChannel getNotificationChannel(GetNotificationChannelRequest request) { + return getNotificationChannelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Deletes a notification channel. + * Gets a single notification channel. The channel includes the relevant configuration details + * with which the channel was created. However, the response may truncate or omit passwords, API + * keys, or other private key matter and thus the response may not be 100% identical to the + * information that was supplied in the call to the create method. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
-   *   ApiFuture<Void> future = notificationChannelServiceClient.deleteNotificationChannelCallable().futureCall(request);
+   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.getNotificationChannelCallable().futureCall(request);
    *   // Do something
-   *   future.get();
+   *   NotificationChannel response = future.get();
    * }
    * 
*/ - public final UnaryCallable - deleteNotificationChannelCallable() { - return stub.deleteNotificationChannelCallable(); + public final UnaryCallable + getNotificationChannelCallable() { + return stub.getNotificationChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Causes a verification code to be delivered to the channel. The code can then be supplied in - * `VerifyNotificationChannel` to verify the channel. + * Creates a new notification channel, representing a single notification endpoint such as an + * email address, SMS number, or PagerDuty service. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(name);
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
    * }
    * 
* - * @param name Required. The notification channel to which to send a verification code. + * @param name Required. The project on which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER] + *

This names the container into which the channel will be written, this does not name the + * newly created channel. The resulting channel's name will have a normalized version of this + * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the + * channel. + * @param notificationChannel Required. The definition of the `NotificationChannel` to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void sendNotificationChannelVerificationCode(NotificationChannelName name) { - SendNotificationChannelVerificationCodeRequest request = - SendNotificationChannelVerificationCodeRequest.newBuilder() + public final NotificationChannel createNotificationChannel( + ResourceName name, NotificationChannel notificationChannel) { + CreateNotificationChannelRequest request = + CreateNotificationChannelRequest.newBuilder() .setName(name == null ? null : name.toString()) + .setNotificationChannel(notificationChannel) .build(); - sendNotificationChannelVerificationCode(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Causes a verification code to be delivered to the channel. The code can then be supplied in - * `VerifyNotificationChannel` to verify the channel. - * - *

Sample code: - * - *


-   * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(name.toString());
-   * }
-   * 
- * - * @param name Required. The notification channel to which to send a verification code. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void sendNotificationChannelVerificationCode(String name) { - SendNotificationChannelVerificationCodeRequest request = - SendNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build(); - sendNotificationChannelVerificationCode(request); + return createNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Causes a verification code to be delivered to the channel. The code can then be supplied in - * `VerifyNotificationChannel` to verify the channel. + * Creates a new notification channel, representing a single notification endpoint such as an + * email address, SMS number, or PagerDuty service. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(request);
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name.toString(), notificationChannel);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param name Required. The project on which to execute the request. The format is: + *

projects/[PROJECT_ID_OR_NUMBER] + *

This names the container into which the channel will be written, this does not name the + * newly created channel. The resulting channel's name will have a normalized version of this + * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the + * channel. + * @param notificationChannel Required. The definition of the `NotificationChannel` to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void sendNotificationChannelVerificationCode( - SendNotificationChannelVerificationCodeRequest request) { - sendNotificationChannelVerificationCodeCallable().call(request); + public final NotificationChannel createNotificationChannel( + String name, NotificationChannel notificationChannel) { + CreateNotificationChannelRequest request = + CreateNotificationChannelRequest.newBuilder() + .setName(name) + .setNotificationChannel(notificationChannel) + .build(); + return createNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Causes a verification code to be delivered to the channel. The code can then be supplied in - * `VerifyNotificationChannel` to verify the channel. + * Creates a new notification channel, representing a single notification endpoint such as an + * email address, SMS number, or PagerDuty service. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
    *     .setName(name.toString())
+   *     .setNotificationChannel(notificationChannel)
    *     .build();
-   *   ApiFuture<Void> future = notificationChannelServiceClient.sendNotificationChannelVerificationCodeCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
+   *   NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(request);
    * }
    * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final UnaryCallable - sendNotificationChannelVerificationCodeCallable() { - return stub.sendNotificationChannelVerificationCodeCallable(); + public final NotificationChannel createNotificationChannel( + CreateNotificationChannelRequest request) { + return createNotificationChannelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Requests a verification code for an already verified channel that can then be used in a call to - * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or - * in a different project. This makes it possible to copy a channel between projects without - * requiring manual reverification of the channel. If the channel is not in the verified state, - * this method will fail (in other words, this may only be used if the - * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been - * used to put the given channel into the verified state). - * - *

There is no guarantee that the verification codes returned by this method will be of a - * similar structure or form as the ones that are delivered to the channel via - * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both - * the codes delivered via SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes - * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter - * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return - * a much longer, websafe base 64 encoded string that has a longer expiration time. + * Creates a new notification channel, representing a single notification endpoint such as an + * email address, SMS number, or PagerDuty service. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name);
+   *   ResourceName name = ProjectName.of("[PROJECT]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setNotificationChannel(notificationChannel)
+   *     .build();
+   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.createNotificationChannelCallable().futureCall(request);
+   *   // Do something
+   *   NotificationChannel response = future.get();
    * }
    * 
- * - * @param name Required. The notification channel for which a verification code is to be generated - * and retrieved. This must name a channel that is already verified; if the specified channel - * is not verified, the request will fail. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final GetNotificationChannelVerificationCodeResponse - getNotificationChannelVerificationCode(NotificationChannelName name) { - GetNotificationChannelVerificationCodeRequest request = - GetNotificationChannelVerificationCodeRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - return getNotificationChannelVerificationCode(request); + public final UnaryCallable + createNotificationChannelCallable() { + return stub.createNotificationChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Requests a verification code for an already verified channel that can then be used in a call to - * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or - * in a different project. This makes it possible to copy a channel between projects without - * requiring manual reverification of the channel. If the channel is not in the verified state, - * this method will fail (in other words, this may only be used if the - * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been - * used to put the given channel into the verified state). - * - *

There is no guarantee that the verification codes returned by this method will be of a - * similar structure or form as the ones that are delivered to the channel via - * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both - * the codes delivered via SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes - * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter - * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return - * a much longer, websafe base 64 encoded string that has a longer expiration time. + * Updates a notification channel. Fields not specified in the field mask remain unchanged. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name.toString());
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(updateMask, notificationChannel);
    * }
    * 
* - * @param name Required. The notification channel for which a verification code is to be generated - * and retrieved. This must name a channel that is already verified; if the specified channel - * is not verified, the request will fail. + * @param updateMask The fields to update. + * @param notificationChannel Required. A description of the changes to be applied to the + * specified notification channel. The description must provide a definition for fields to be + * updated; the names of these fields should also be included in the `update_mask`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final GetNotificationChannelVerificationCodeResponse - getNotificationChannelVerificationCode(String name) { - GetNotificationChannelVerificationCodeRequest request = - GetNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build(); - return getNotificationChannelVerificationCode(request); + public final NotificationChannel updateNotificationChannel( + FieldMask updateMask, NotificationChannel notificationChannel) { + UpdateNotificationChannelRequest request = + UpdateNotificationChannelRequest.newBuilder() + .setUpdateMask(updateMask) + .setNotificationChannel(notificationChannel) + .build(); + return updateNotificationChannel(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Requests a verification code for an already verified channel that can then be used in a call to - * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or - * in a different project. This makes it possible to copy a channel between projects without - * requiring manual reverification of the channel. If the channel is not in the verified state, - * this method will fail (in other words, this may only be used if the - * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been - * used to put the given channel into the verified state). - * - *

There is no guarantee that the verification codes returned by this method will be of a - * similar structure or form as the ones that are delivered to the channel via - * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both - * the codes delivered via SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes - * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter - * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return - * a much longer, websafe base 64 encoded string that has a longer expiration time. + * Updates a notification channel. Fields not specified in the field mask remain unchanged. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
-   *     .setName(name.toString())
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
+   *     .setNotificationChannel(notificationChannel)
    *     .build();
-   *   GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(request);
+   *   NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final GetNotificationChannelVerificationCodeResponse - getNotificationChannelVerificationCode( - GetNotificationChannelVerificationCodeRequest request) { - return getNotificationChannelVerificationCodeCallable().call(request); + public final NotificationChannel updateNotificationChannel( + UpdateNotificationChannelRequest request) { + return updateNotificationChannelCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Requests a verification code for an already verified channel that can then be used in a call to - * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or - * in a different project. This makes it possible to copy a channel between projects without - * requiring manual reverification of the channel. If the channel is not in the verified state, - * this method will fail (in other words, this may only be used if the - * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been - * used to put the given channel into the verified state). - * - *

There is no guarantee that the verification codes returned by this method will be of a - * similar structure or form as the ones that are delivered to the channel via - * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both - * the codes delivered via SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes - * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter - * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return - * a much longer, websafe base 64 encoded string that has a longer expiration time. + * Updates a notification channel. Fields not specified in the field mask remain unchanged. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
-   *     .setName(name.toString())
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
+   *     .setNotificationChannel(notificationChannel)
    *     .build();
-   *   ApiFuture<GetNotificationChannelVerificationCodeResponse> future = notificationChannelServiceClient.getNotificationChannelVerificationCodeCallable().futureCall(request);
+   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.updateNotificationChannelCallable().futureCall(request);
    *   // Do something
-   *   GetNotificationChannelVerificationCodeResponse response = future.get();
+   *   NotificationChannel response = future.get();
    * }
    * 
*/ - public final UnaryCallable< - GetNotificationChannelVerificationCodeRequest, - GetNotificationChannelVerificationCodeResponse> - getNotificationChannelVerificationCodeCallable() { - return stub.getNotificationChannelVerificationCodeCallable(); + public final UnaryCallable + updateNotificationChannelCallable() { + return stub.updateNotificationChannelCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a - * result of calling `SendNotificationChannelVerificationCode`. + * Causes a verification code to be delivered to the channel. The code can then be supplied in + * `VerifyNotificationChannel` to verify the channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   String code = "";
-   *   NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name, code);
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(name);
    * }
    * 
* - * @param name Required. The notification channel to verify. - * @param code Required. The verification code that was delivered to the channel as a result of - * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved - * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one - * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that - * the code is valid UTF-8; one should not make any assumptions regarding the structure or - * format of the code). + * @param name Required. The notification channel to which to send a verification code. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel verifyNotificationChannel( - NotificationChannelName name, String code) { - VerifyNotificationChannelRequest request = - VerifyNotificationChannelRequest.newBuilder() + public final void sendNotificationChannelVerificationCode(NotificationChannelName name) { + SendNotificationChannelVerificationCodeRequest request = + SendNotificationChannelVerificationCodeRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setCode(code) .build(); - return verifyNotificationChannel(request); + sendNotificationChannelVerificationCode(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a - * result of calling `SendNotificationChannelVerificationCode`. + * Causes a verification code to be delivered to the channel. The code can then be supplied in + * `VerifyNotificationChannel` to verify the channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   String code = "";
-   *   NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name.toString(), code);
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(name.toString());
    * }
    * 
* - * @param name Required. The notification channel to verify. - * @param code Required. The verification code that was delivered to the channel as a result of - * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved - * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one - * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that - * the code is valid UTF-8; one should not make any assumptions regarding the structure or - * format of the code). + * @param name Required. The notification channel to which to send a verification code. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel verifyNotificationChannel(String name, String code) { - VerifyNotificationChannelRequest request = - VerifyNotificationChannelRequest.newBuilder().setName(name).setCode(code).build(); - return verifyNotificationChannel(request); + public final void sendNotificationChannelVerificationCode(String name) { + SendNotificationChannelVerificationCodeRequest request = + SendNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build(); + sendNotificationChannelVerificationCode(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a - * result of calling `SendNotificationChannelVerificationCode`. + * Causes a verification code to be delivered to the channel. The code can then be supplied in + * `VerifyNotificationChannel` to verify the channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   String code = "";
-   *   VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setCode(code)
    *     .build();
-   *   NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(request);
+   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(request);
    * }
    * 
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final NotificationChannel verifyNotificationChannel( - VerifyNotificationChannelRequest request) { - return verifyNotificationChannelCallable().call(request); + public final void sendNotificationChannelVerificationCode( + SendNotificationChannelVerificationCodeRequest request) { + sendNotificationChannelVerificationCodeCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD /** - * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a - * result of calling `SendNotificationChannelVerificationCode`. + * Causes a verification code to be delivered to the channel. The code can then be supplied in + * `VerifyNotificationChannel` to verify the channel. * *

Sample code: * *


    * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
-   *   NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-   *   String code = "";
-   *   VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
+   *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
    *     .setName(name.toString())
-   *     .setCode(code)
    *     .build();
-   *   ApiFuture<NotificationChannel> future = notificationChannelServiceClient.verifyNotificationChannelCallable().futureCall(request);
+   *   ApiFuture<Void> future = notificationChannelServiceClient.sendNotificationChannelVerificationCodeCallable().futureCall(request);
    *   // Do something
-   *   NotificationChannel response = future.get();
+   *   future.get();
    * }
    * 
*/ - public final UnaryCallable - verifyNotificationChannelCallable() { - return stub.verifyNotificationChannelCallable(); + public final UnaryCallable + sendNotificationChannelVerificationCodeCallable() { + return stub.sendNotificationChannelVerificationCodeCallable(); } @Override diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java index 27781e95..5e93ad36 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java @@ -65,16 +65,16 @@ *

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 getNotificationChannelDescriptor to 30 seconds: + *

For example, to set the total timeout of deleteNotificationChannel to 30 seconds: * *

  * 
  * NotificationChannelServiceSettings.Builder notificationChannelServiceSettingsBuilder =
  *     NotificationChannelServiceSettings.newBuilder();
  * notificationChannelServiceSettingsBuilder
- *     .getNotificationChannelDescriptorSettings()
+ *     .deleteNotificationChannelSettings()
  *     .setRetrySettings(
- *         notificationChannelServiceSettingsBuilder.getNotificationChannelDescriptorSettings().getRetrySettings().toBuilder()
+ *         notificationChannelServiceSettingsBuilder.deleteNotificationChannelSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * NotificationChannelServiceSettings notificationChannelServiceSettings = notificationChannelServiceSettingsBuilder.build();
@@ -84,6 +84,31 @@
 @Generated("by gapic-generator")
 public class NotificationChannelServiceSettings
     extends ClientSettings {
+  /** Returns the object with the settings used for calls to deleteNotificationChannel. */
+  public UnaryCallSettings
+      deleteNotificationChannelSettings() {
+    return ((NotificationChannelServiceStubSettings) getStubSettings())
+        .deleteNotificationChannelSettings();
+  }
+
+  /**
+   * Returns the object with the settings used for calls to getNotificationChannelVerificationCode.
+   */
+  public UnaryCallSettings<
+          GetNotificationChannelVerificationCodeRequest,
+          GetNotificationChannelVerificationCodeResponse>
+      getNotificationChannelVerificationCodeSettings() {
+    return ((NotificationChannelServiceStubSettings) getStubSettings())
+        .getNotificationChannelVerificationCodeSettings();
+  }
+
+  /** Returns the object with the settings used for calls to verifyNotificationChannel. */
+  public UnaryCallSettings
+      verifyNotificationChannelSettings() {
+    return ((NotificationChannelServiceStubSettings) getStubSettings())
+        .verifyNotificationChannelSettings();
+  }
+
   /** Returns the object with the settings used for calls to listNotificationChannelDescriptors. */
   public PagedCallSettings<
           ListNotificationChannelDescriptorsRequest,
@@ -132,13 +157,6 @@ public class NotificationChannelServiceSettings
         .updateNotificationChannelSettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteNotificationChannel. */
-  public UnaryCallSettings
-      deleteNotificationChannelSettings() {
-    return ((NotificationChannelServiceStubSettings) getStubSettings())
-        .deleteNotificationChannelSettings();
-  }
-
   /**
    * Returns the object with the settings used for calls to sendNotificationChannelVerificationCode.
    */
@@ -148,24 +166,6 @@ public class NotificationChannelServiceSettings
         .sendNotificationChannelVerificationCodeSettings();
   }
 
-  /**
-   * Returns the object with the settings used for calls to getNotificationChannelVerificationCode.
-   */
-  public UnaryCallSettings<
-          GetNotificationChannelVerificationCodeRequest,
-          GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeSettings() {
-    return ((NotificationChannelServiceStubSettings) getStubSettings())
-        .getNotificationChannelVerificationCodeSettings();
-  }
-
-  /** Returns the object with the settings used for calls to verifyNotificationChannel. */
-  public UnaryCallSettings
-      verifyNotificationChannelSettings() {
-    return ((NotificationChannelServiceStubSettings) getStubSettings())
-        .verifyNotificationChannelSettings();
-  }
-
   public static final NotificationChannelServiceSettings create(
       NotificationChannelServiceStubSettings stub) throws IOException {
     return new NotificationChannelServiceSettings.Builder(stub.toBuilder()).build();
@@ -264,6 +264,29 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to deleteNotificationChannel. */
+    public UnaryCallSettings.Builder
+        deleteNotificationChannelSettings() {
+      return getStubSettingsBuilder().deleteNotificationChannelSettings();
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to
+     * getNotificationChannelVerificationCode.
+     */
+    public UnaryCallSettings.Builder<
+            GetNotificationChannelVerificationCodeRequest,
+            GetNotificationChannelVerificationCodeResponse>
+        getNotificationChannelVerificationCodeSettings() {
+      return getStubSettingsBuilder().getNotificationChannelVerificationCodeSettings();
+    }
+
+    /** Returns the builder for the settings used for calls to verifyNotificationChannel. */
+    public UnaryCallSettings.Builder
+        verifyNotificationChannelSettings() {
+      return getStubSettingsBuilder().verifyNotificationChannelSettings();
+    }
+
     /**
      * Returns the builder for the settings used for calls to listNotificationChannelDescriptors.
      */
@@ -309,12 +332,6 @@ public Builder applyToAllUnaryMethods(
       return getStubSettingsBuilder().updateNotificationChannelSettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteNotificationChannel. */
-    public UnaryCallSettings.Builder
-        deleteNotificationChannelSettings() {
-      return getStubSettingsBuilder().deleteNotificationChannelSettings();
-    }
-
     /**
      * Returns the builder for the settings used for calls to
      * sendNotificationChannelVerificationCode.
@@ -324,23 +341,6 @@ public Builder applyToAllUnaryMethods(
       return getStubSettingsBuilder().sendNotificationChannelVerificationCodeSettings();
     }
 
-    /**
-     * Returns the builder for the settings used for calls to
-     * getNotificationChannelVerificationCode.
-     */
-    public UnaryCallSettings.Builder<
-            GetNotificationChannelVerificationCodeRequest,
-            GetNotificationChannelVerificationCodeResponse>
-        getNotificationChannelVerificationCodeSettings() {
-      return getStubSettingsBuilder().getNotificationChannelVerificationCodeSettings();
-    }
-
-    /** Returns the builder for the settings used for calls to verifyNotificationChannel. */
-    public UnaryCallSettings.Builder
-        verifyNotificationChannelSettings() {
-      return getStubSettingsBuilder().verifyNotificationChannelSettings();
-    }
-
     @Override
     public NotificationChannelServiceSettings build() throws IOException {
       return new NotificationChannelServiceSettings(this);
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java
index 1822f954..af70cea0 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java
@@ -25,6 +25,7 @@
 import com.google.api.gax.paging.AbstractPagedListResponse;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
 import com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStub;
 import com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -38,7 +39,6 @@
 import com.google.monitoring.v3.ListServiceLevelObjectivesResponse;
 import com.google.monitoring.v3.ListServicesRequest;
 import com.google.monitoring.v3.ListServicesResponse;
-import com.google.monitoring.v3.ProjectName;
 import com.google.monitoring.v3.Service;
 import com.google.monitoring.v3.ServiceLevelObjective;
 import com.google.monitoring.v3.ServiceLevelObjectiveName;
@@ -63,9 +63,8 @@
  * 
  * 
  * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- *   ProjectName parent = ProjectName.of("[PROJECT]");
- *   Service service = Service.newBuilder().build();
- *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+ *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ *   serviceMonitoringServiceClient.deleteService(name);
  * }
  * 
  * 
@@ -176,6 +175,190 @@ public ServiceMonitoringServiceStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+   *   serviceMonitoringServiceClient.deleteService(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the `Service` to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(ServiceName name) { + DeleteServiceRequest request = + DeleteServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+   *   serviceMonitoringServiceClient.deleteService(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the `Service` to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(String name) { + DeleteServiceRequest request = DeleteServiceRequest.newBuilder().setName(name).build(); + deleteService(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   serviceMonitoringServiceClient.deleteService(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteService(DeleteServiceRequest request) { + deleteServiceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Soft delete this `Service`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteServiceCallable() { + return stub.deleteServiceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
+   * }
+   * 
+ * + * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name) { + DeleteServiceLevelObjectiveRequest request = + DeleteServiceLevelObjectiveRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(name.toString());
+   * }
+   * 
+ * + * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServiceLevelObjective(String name) { + DeleteServiceLevelObjectiveRequest request = + DeleteServiceLevelObjectiveRequest.newBuilder().setName(name).build(); + deleteServiceLevelObjective(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) { + deleteServiceLevelObjectiveCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Delete the given `ServiceLevelObjective`. + * + *

Sample code: + * + *


+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteServiceLevelObjectiveCallable() { + return stub.deleteServiceLevelObjectiveCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Create a `Service`. @@ -184,7 +367,7 @@ public ServiceMonitoringServiceStub getStub() { * *

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   Service service = Service.newBuilder().build();
    *   Service response = serviceMonitoringServiceClient.createService(parent, service);
    * }
@@ -195,7 +378,7 @@ public ServiceMonitoringServiceStub getStub() {
    * @param service Required. The `Service` to create.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final Service createService(ProjectName parent, Service service) {
+  public final Service createService(ResourceName parent, Service service) {
     CreateServiceRequest request =
         CreateServiceRequest.newBuilder()
             .setParent(parent == null ? null : parent.toString())
@@ -212,7 +395,7 @@ public final Service createService(ProjectName parent, Service service) {
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   Service service = Service.newBuilder().build();
    *   Service response = serviceMonitoringServiceClient.createService(parent.toString(), service);
    * }
@@ -237,7 +420,7 @@ public final Service createService(String parent, Service service) {
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   Service service = Service.newBuilder().build();
    *   CreateServiceRequest request = CreateServiceRequest.newBuilder()
    *     .setParent(parent.toString())
@@ -262,7 +445,7 @@ public final Service createService(CreateServiceRequest request) {
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   Service service = Service.newBuilder().build();
    *   CreateServiceRequest request = CreateServiceRequest.newBuilder()
    *     .setParent(parent.toString())
@@ -286,7 +469,7 @@ public final UnaryCallable createServiceCallable(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   Service response = serviceMonitoringServiceClient.getService(name);
    * }
    * 
@@ -309,7 +492,7 @@ public final Service getService(ServiceName name) { * *

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   Service response = serviceMonitoringServiceClient.getService(name.toString());
    * }
    * 
@@ -331,7 +514,7 @@ public final Service getService(String name) { * *

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   GetServiceRequest request = GetServiceRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -354,7 +537,7 @@ public final Service getService(GetServiceRequest request) {
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   GetServiceRequest request = GetServiceRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -376,7 +559,7 @@ public final UnaryCallable getServiceCallable() {
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -388,7 +571,7 @@ public final UnaryCallable getServiceCallable() {
    *     

projects/[PROJECT_ID_OR_NUMBER] workspaces/[HOST_PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final ListServicesPagedResponse listServices(ProjectName parent) { + public final ListServicesPagedResponse listServices(ResourceName parent) { ListServicesRequest request = ListServicesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) @@ -404,7 +587,7 @@ public final ListServicesPagedResponse listServices(ProjectName parent) { * *


    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   for (Service element : serviceMonitoringServiceClient.listServices(parent.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -429,7 +612,7 @@ public final ListServicesPagedResponse listServices(String parent) {
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   ListServicesRequest request = ListServicesRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
@@ -454,7 +637,7 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request)
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   ListServicesRequest request = ListServicesRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
@@ -479,7 +662,7 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request)
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   ListServicesRequest request = ListServicesRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
@@ -569,96 +752,6 @@ public final UnaryCallable updateServiceCallable(
     return stub.updateServiceCallable();
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Soft delete this `Service`.
-   *
-   * 

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
-   *   serviceMonitoringServiceClient.deleteService(name);
-   * }
-   * 
- * - * @param name Required. Resource name of the `Service` to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteService(ServiceName name) { - DeleteServiceRequest request = - DeleteServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteService(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Soft delete this `Service`. - * - *

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
-   *   serviceMonitoringServiceClient.deleteService(name.toString());
-   * }
-   * 
- * - * @param name Required. Resource name of the `Service` to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteService(String name) { - DeleteServiceRequest request = DeleteServiceRequest.newBuilder().setName(name).build(); - deleteService(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Soft delete this `Service`. - * - *

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
-   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   serviceMonitoringServiceClient.deleteService(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteService(DeleteServiceRequest request) { - deleteServiceCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Soft delete this `Service`. - * - *

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
-   *   DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable deleteServiceCallable() { - return stub.deleteServiceCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Create a `ServiceLevelObjective` for the given `Service`. @@ -667,7 +760,7 @@ public final UnaryCallable deleteServiceCallable() * *

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
    *   ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
    * }
@@ -697,7 +790,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
    *   ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(parent.toString(), serviceLevelObjective);
    * }
@@ -727,7 +820,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
    *   CreateServiceLevelObjectiveRequest request = CreateServiceLevelObjectiveRequest.newBuilder()
    *     .setParent(parent.toString())
@@ -753,7 +846,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
    *   CreateServiceLevelObjectiveRequest request = CreateServiceLevelObjectiveRequest.newBuilder()
    *     .setParent(parent.toString())
@@ -778,7 +871,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
    *   ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(name);
    * }
    * 
@@ -803,7 +896,7 @@ public final ServiceLevelObjective getServiceLevelObjective(ServiceLevelObjectiv * *

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
    *   ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(name.toString());
    * }
    * 
@@ -826,7 +919,7 @@ public final ServiceLevelObjective getServiceLevelObjective(String name) { * *

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
    *   GetServiceLevelObjectiveRequest request = GetServiceLevelObjectiveRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -850,7 +943,7 @@ public final ServiceLevelObjective getServiceLevelObjective(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
    *   GetServiceLevelObjectiveRequest request = GetServiceLevelObjectiveRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -873,7 +966,7 @@ public final ServiceLevelObjective getServiceLevelObjective(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -903,7 +996,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(parent.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
@@ -930,7 +1023,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
@@ -956,7 +1049,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
@@ -982,7 +1075,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
    *
    * 

    * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
    *   ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
    *     .setParent(parent.toString())
    *     .build();
@@ -1079,100 +1172,6 @@ public final ServiceLevelObjective updateServiceLevelObjective(
     return stub.updateServiceLevelObjectiveCallable();
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Delete the given `ServiceLevelObjective`.
-   *
-   * 

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
-   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
-   * }
-   * 
- * - * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name) { - DeleteServiceLevelObjectiveRequest request = - DeleteServiceLevelObjectiveRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteServiceLevelObjective(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Delete the given `ServiceLevelObjective`. - * - *

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
-   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(name.toString());
-   * }
-   * 
- * - * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteServiceLevelObjective(String name) { - DeleteServiceLevelObjectiveRequest request = - DeleteServiceLevelObjectiveRequest.newBuilder().setName(name).build(); - deleteServiceLevelObjective(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Delete the given `ServiceLevelObjective`. - * - *

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
-   *   DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   serviceMonitoringServiceClient.deleteServiceLevelObjective(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) { - deleteServiceLevelObjectiveCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Delete the given `ServiceLevelObjective`. - * - *

Sample code: - * - *


-   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
-   *   ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
-   *   DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable - deleteServiceLevelObjectiveCallable() { - return stub.deleteServiceLevelObjectiveCallable(); - } - @Override public final void close() { stub.close(); diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java index 1d7f696d..91cdfb87 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java @@ -64,16 +64,16 @@ *

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 createService to 30 seconds: + *

For example, to set the total timeout of deleteService to 30 seconds: * *

  * 
  * ServiceMonitoringServiceSettings.Builder serviceMonitoringServiceSettingsBuilder =
  *     ServiceMonitoringServiceSettings.newBuilder();
  * serviceMonitoringServiceSettingsBuilder
- *     .createServiceSettings()
+ *     .deleteServiceSettings()
  *     .setRetrySettings(
- *         serviceMonitoringServiceSettingsBuilder.createServiceSettings().getRetrySettings().toBuilder()
+ *         serviceMonitoringServiceSettingsBuilder.deleteServiceSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ServiceMonitoringServiceSettings serviceMonitoringServiceSettings = serviceMonitoringServiceSettingsBuilder.build();
@@ -83,6 +83,18 @@
 @Generated("by gapic-generator")
 public class ServiceMonitoringServiceSettings
     extends ClientSettings {
+  /** Returns the object with the settings used for calls to deleteService. */
+  public UnaryCallSettings deleteServiceSettings() {
+    return ((ServiceMonitoringServiceStubSettings) getStubSettings()).deleteServiceSettings();
+  }
+
+  /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */
+  public UnaryCallSettings
+      deleteServiceLevelObjectiveSettings() {
+    return ((ServiceMonitoringServiceStubSettings) getStubSettings())
+        .deleteServiceLevelObjectiveSettings();
+  }
+
   /** Returns the object with the settings used for calls to createService. */
   public UnaryCallSettings createServiceSettings() {
     return ((ServiceMonitoringServiceStubSettings) getStubSettings()).createServiceSettings();
@@ -104,11 +116,6 @@ public UnaryCallSettings updateServiceSettings()
     return ((ServiceMonitoringServiceStubSettings) getStubSettings()).updateServiceSettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteService. */
-  public UnaryCallSettings deleteServiceSettings() {
-    return ((ServiceMonitoringServiceStubSettings) getStubSettings()).deleteServiceSettings();
-  }
-
   /** Returns the object with the settings used for calls to createServiceLevelObjective. */
   public UnaryCallSettings
       createServiceLevelObjectiveSettings() {
@@ -140,13 +147,6 @@ public UnaryCallSettings deleteServiceSettings() {
         .updateServiceLevelObjectiveSettings();
   }
 
-  /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */
-  public UnaryCallSettings
-      deleteServiceLevelObjectiveSettings() {
-    return ((ServiceMonitoringServiceStubSettings) getStubSettings())
-        .deleteServiceLevelObjectiveSettings();
-  }
-
   public static final ServiceMonitoringServiceSettings create(
       ServiceMonitoringServiceStubSettings stub) throws IOException {
     return new ServiceMonitoringServiceSettings.Builder(stub.toBuilder()).build();
@@ -245,6 +245,17 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to deleteService. */
+    public UnaryCallSettings.Builder deleteServiceSettings() {
+      return getStubSettingsBuilder().deleteServiceSettings();
+    }
+
+    /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */
+    public UnaryCallSettings.Builder
+        deleteServiceLevelObjectiveSettings() {
+      return getStubSettingsBuilder().deleteServiceLevelObjectiveSettings();
+    }
+
     /** Returns the builder for the settings used for calls to createService. */
     public UnaryCallSettings.Builder createServiceSettings() {
       return getStubSettingsBuilder().createServiceSettings();
@@ -267,11 +278,6 @@ public UnaryCallSettings.Builder updateServiceSet
       return getStubSettingsBuilder().updateServiceSettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteService. */
-    public UnaryCallSettings.Builder deleteServiceSettings() {
-      return getStubSettingsBuilder().deleteServiceSettings();
-    }
-
     /** Returns the builder for the settings used for calls to createServiceLevelObjective. */
     public UnaryCallSettings.Builder
         createServiceLevelObjectiveSettings() {
@@ -299,12 +305,6 @@ public UnaryCallSettings.Builder deleteServiceSetti
       return getStubSettingsBuilder().updateServiceLevelObjectiveSettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */
-    public UnaryCallSettings.Builder
-        deleteServiceLevelObjectiveSettings() {
-      return getStubSettingsBuilder().deleteServiceLevelObjectiveSettings();
-    }
-
     @Override
     public ServiceMonitoringServiceSettings build() throws IOException {
       return new ServiceMonitoringServiceSettings(this);
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java
index 8bdf8ee1..6a187978 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java
@@ -25,6 +25,7 @@
 import com.google.api.gax.paging.AbstractPagedListResponse;
 import com.google.api.gax.rpc.PageContext;
 import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
 import com.google.cloud.monitoring.v3.stub.UptimeCheckServiceStub;
 import com.google.cloud.monitoring.v3.stub.UptimeCheckServiceStubSettings;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -60,8 +61,8 @@
  * 
  * 
  * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
- *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
+ *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
  * }
  * 
  * 
@@ -170,6 +171,137 @@ public UptimeCheckServiceStub getStub() { return stub; } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check + * configuration is referenced by an alert policy or other dependent configs that would be + * rendered invalid by the deletion. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
+   * }
+   * 
+ * + * @param name Required. The Uptime check configuration to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUptimeCheckConfig(UptimeCheckConfigName name) { + DeleteUptimeCheckConfigRequest request = + DeleteUptimeCheckConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteUptimeCheckConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check + * configuration is referenced by an alert policy or other dependent configs that would be + * rendered invalid by the deletion. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name.toString());
+   * }
+   * 
+ * + * @param name Required. The Uptime check configuration to delete. The format is: + *

projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUptimeCheckConfig(String name) { + DeleteUptimeCheckConfigRequest request = + DeleteUptimeCheckConfigRequest.newBuilder().setName(name).build(); + deleteUptimeCheckConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check + * configuration is referenced by an alert policy or other dependent configs that would be + * rendered invalid by the deletion. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request) { + deleteUptimeCheckConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check + * configuration is referenced by an alert policy or other dependent configs that would be + * rendered invalid by the deletion. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = uptimeCheckServiceClient.deleteUptimeCheckConfigCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + deleteUptimeCheckConfigCallable() { + return stub.deleteUptimeCheckConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the existing valid Uptime check configurations for the project (leaving out any invalid + * configurations). + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
+   *   for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The project whose Uptime check configurations are listed. The format + * is: + *

projects/[PROJECT_ID_OR_NUMBER] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(ResourceName parent) { + ListUptimeCheckConfigsRequest request = + ListUptimeCheckConfigsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listUptimeCheckConfigs(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Lists the existing valid Uptime check configurations for the project (leaving out any invalid @@ -179,8 +311,8 @@ public UptimeCheckServiceStub getStub() { * *


    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
-   *   for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(formattedParent).iterateAll()) {
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
+   *   for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(parent.toString()).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -206,9 +338,9 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(String p
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   ListUptimeCheckConfigsRequest request = ListUptimeCheckConfigsRequest.newBuilder()
-   *     .setParent(formattedParent)
+   *     .setParent(parent.toString())
    *     .build();
    *   for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(request).iterateAll()) {
    *     // doThingsWith(element);
@@ -233,9 +365,9 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   ListUptimeCheckConfigsRequest request = ListUptimeCheckConfigsRequest.newBuilder()
-   *     .setParent(formattedParent)
+   *     .setParent(parent.toString())
    *     .build();
    *   ApiFuture<ListUptimeCheckConfigsPagedResponse> future = uptimeCheckServiceClient.listUptimeCheckConfigsPagedCallable().futureCall(request);
    *   // Do something
@@ -259,9 +391,9 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   ListUptimeCheckConfigsRequest request = ListUptimeCheckConfigsRequest.newBuilder()
-   *     .setParent(formattedParent)
+   *     .setParent(parent.toString())
    *     .build();
    *   while (true) {
    *     ListUptimeCheckConfigsResponse response = uptimeCheckServiceClient.listUptimeCheckConfigsCallable().call(request);
@@ -291,7 +423,7 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
    * }
    * 
@@ -316,7 +448,7 @@ public final UptimeCheckConfig getUptimeCheckConfig(UptimeCheckConfigName name) * *

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name.toString());
    * }
    * 
@@ -339,7 +471,7 @@ public final UptimeCheckConfig getUptimeCheckConfig(String name) { * *

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -362,7 +494,7 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -385,9 +517,38 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
-   *   UptimeCheckConfig response = uptimeCheckServiceClient.createUptimeCheckConfig(formattedParent, uptimeCheckConfig);
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.createUptimeCheckConfig(parent, uptimeCheckConfig);
+   * }
+   * 
+ * + * @param parent Required. The project in which to create the Uptime check. The format is: + *

projects/[PROJECT_ID_OR_NUMBER] + * @param uptimeCheckConfig Required. The new Uptime check configuration. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final UptimeCheckConfig createUptimeCheckConfig( + ResourceName parent, UptimeCheckConfig uptimeCheckConfig) { + CreateUptimeCheckConfigRequest request = + CreateUptimeCheckConfigRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setUptimeCheckConfig(uptimeCheckConfig) + .build(); + return createUptimeCheckConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new Uptime check configuration. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
+   *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.createUptimeCheckConfig(parent.toString(), uptimeCheckConfig);
    * }
    * 
* @@ -414,10 +575,10 @@ public final UptimeCheckConfig createUptimeCheckConfig( * *

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
    *   CreateUptimeCheckConfigRequest request = CreateUptimeCheckConfigRequest.newBuilder()
-   *     .setParent(formattedParent)
+   *     .setParent(parent.toString())
    *     .setUptimeCheckConfig(uptimeCheckConfig)
    *     .build();
    *   UptimeCheckConfig response = uptimeCheckServiceClient.createUptimeCheckConfig(request);
@@ -439,10 +600,10 @@ public final UptimeCheckConfig createUptimeCheckConfig(CreateUptimeCheckConfigRe
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedParent = ProjectName.format("[PROJECT]");
+   *   ResourceName parent = ProjectName.of("[PROJECT]");
    *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
    *   CreateUptimeCheckConfigRequest request = CreateUptimeCheckConfigRequest.newBuilder()
-   *     .setParent(formattedParent)
+   *     .setParent(parent.toString())
    *     .setUptimeCheckConfig(uptimeCheckConfig)
    *     .build();
    *   ApiFuture<UptimeCheckConfig> future = uptimeCheckServiceClient.createUptimeCheckConfigCallable().futureCall(request);
@@ -537,108 +698,6 @@ public final UptimeCheckConfig updateUptimeCheckConfig(UpdateUptimeCheckConfigRe
     return stub.updateUptimeCheckConfigCallable();
   }
 
-  // AUTO-GENERATED DOCUMENTATION AND METHOD
-  /**
-   * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check
-   * configuration is referenced by an alert policy or other dependent configs that would be
-   * rendered invalid by the deletion.
-   *
-   * 

Sample code: - * - *


-   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
-   * }
-   * 
- * - * @param name Required. The Uptime check configuration to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUptimeCheckConfig(UptimeCheckConfigName name) { - DeleteUptimeCheckConfigRequest request = - DeleteUptimeCheckConfigRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteUptimeCheckConfig(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check - * configuration is referenced by an alert policy or other dependent configs that would be - * rendered invalid by the deletion. - * - *

Sample code: - * - *


-   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name.toString());
-   * }
-   * 
- * - * @param name Required. The Uptime check configuration to delete. The format is: - *

projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUptimeCheckConfig(String name) { - DeleteUptimeCheckConfigRequest request = - DeleteUptimeCheckConfigRequest.newBuilder().setName(name).build(); - deleteUptimeCheckConfig(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check - * configuration is referenced by an alert policy or other dependent configs that would be - * rendered invalid by the deletion. - * - *

Sample code: - * - *


-   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-   *   DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(request);
-   * }
-   * 
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request) { - deleteUptimeCheckConfigCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD - /** - * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check - * configuration is referenced by an alert policy or other dependent configs that would be - * rendered invalid by the deletion. - * - *

Sample code: - * - *


-   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-   *   DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = uptimeCheckServiceClient.deleteUptimeCheckConfigCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
- */ - public final UnaryCallable - deleteUptimeCheckConfigCallable() { - return stub.deleteUptimeCheckConfigCallable(); - } - // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Returns the list of IP addresses that checkers run from diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceSettings.java index e0adbb59..f250407d 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceSettings.java @@ -59,16 +59,16 @@ *

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 getUptimeCheckConfig to 30 seconds: + *

For example, to set the total timeout of deleteUptimeCheckConfig to 30 seconds: * *

  * 
  * UptimeCheckServiceSettings.Builder uptimeCheckServiceSettingsBuilder =
  *     UptimeCheckServiceSettings.newBuilder();
  * uptimeCheckServiceSettingsBuilder
- *     .getUptimeCheckConfigSettings()
+ *     .deleteUptimeCheckConfigSettings()
  *     .setRetrySettings(
- *         uptimeCheckServiceSettingsBuilder.getUptimeCheckConfigSettings().getRetrySettings().toBuilder()
+ *         uptimeCheckServiceSettingsBuilder.deleteUptimeCheckConfigSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * UptimeCheckServiceSettings uptimeCheckServiceSettings = uptimeCheckServiceSettingsBuilder.build();
@@ -77,6 +77,12 @@
  */
 @Generated("by gapic-generator")
 public class UptimeCheckServiceSettings extends ClientSettings {
+  /** Returns the object with the settings used for calls to deleteUptimeCheckConfig. */
+  public UnaryCallSettings
+      deleteUptimeCheckConfigSettings() {
+    return ((UptimeCheckServiceStubSettings) getStubSettings()).deleteUptimeCheckConfigSettings();
+  }
+
   /** Returns the object with the settings used for calls to listUptimeCheckConfigs. */
   public PagedCallSettings<
           ListUptimeCheckConfigsRequest,
@@ -104,12 +110,6 @@ public class UptimeCheckServiceSettings extends ClientSettings
-      deleteUptimeCheckConfigSettings() {
-    return ((UptimeCheckServiceStubSettings) getStubSettings()).deleteUptimeCheckConfigSettings();
-  }
-
   /** Returns the object with the settings used for calls to listUptimeCheckIps. */
   public PagedCallSettings<
           ListUptimeCheckIpsRequest, ListUptimeCheckIpsResponse, ListUptimeCheckIpsPagedResponse>
@@ -214,6 +214,12 @@ public Builder applyToAllUnaryMethods(
       return this;
     }
 
+    /** Returns the builder for the settings used for calls to deleteUptimeCheckConfig. */
+    public UnaryCallSettings.Builder
+        deleteUptimeCheckConfigSettings() {
+      return getStubSettingsBuilder().deleteUptimeCheckConfigSettings();
+    }
+
     /** Returns the builder for the settings used for calls to listUptimeCheckConfigs. */
     public PagedCallSettings.Builder<
             ListUptimeCheckConfigsRequest,
@@ -241,12 +247,6 @@ public Builder applyToAllUnaryMethods(
       return getStubSettingsBuilder().updateUptimeCheckConfigSettings();
     }
 
-    /** Returns the builder for the settings used for calls to deleteUptimeCheckConfig. */
-    public UnaryCallSettings.Builder
-        deleteUptimeCheckConfigSettings() {
-      return getStubSettingsBuilder().deleteUptimeCheckConfigSettings();
-    }
-
     /** Returns the builder for the settings used for calls to listUptimeCheckIps. */
     public PagedCallSettings.Builder<
             ListUptimeCheckIpsRequest, ListUptimeCheckIpsResponse, ListUptimeCheckIpsPagedResponse>
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java
index 9973605d..60f28e53 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java
@@ -33,8 +33,8 @@
  * 
  * 
  * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- *   AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
+ *   AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ *   alertPolicyServiceClient.deleteAlertPolicy(name);
  * }
  * 
  * 
@@ -56,8 +56,8 @@ *
  * 
  * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- *   GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- *   Group response = groupServiceClient.getGroup(name);
+ *   Group group = Group.newBuilder().build();
+ *   Group response = groupServiceClient.updateGroup(group);
  * }
  * 
  * 
@@ -72,7 +72,7 @@ *
  * 
  * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ *   MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
  *   MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name);
  * }
  * 
@@ -89,8 +89,9 @@
  * 
  * 
  * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- *   NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- *   NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+ *   NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ *   boolean force = false;
+ *   notificationChannelServiceClient.deleteNotificationChannel(name, force);
  * }
  * 
  * 
@@ -106,9 +107,8 @@ *
  * 
  * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- *   ProjectName parent = ProjectName.of("[PROJECT]");
- *   Service service = Service.newBuilder().build();
- *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+ *   ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ *   serviceMonitoringServiceClient.deleteService(name);
  * }
  * 
  * 
@@ -127,8 +127,8 @@ *
  * 
  * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
- *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
+ *   UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
  * }
  * 
  * 
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStub.java index 9bdd015c..330f4683 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStub.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStub.java @@ -40,6 +40,10 @@ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AlertPolicyServiceStub implements BackgroundResource { + public UnaryCallable deleteAlertPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteAlertPolicyCallable()"); + } + public UnaryCallable listAlertPoliciesPagedCallable() { throw new UnsupportedOperationException("Not implemented: listAlertPoliciesPagedCallable()"); @@ -58,10 +62,6 @@ public UnaryCallable createAlertPolicyCal throw new UnsupportedOperationException("Not implemented: createAlertPolicyCallable()"); } - public UnaryCallable deleteAlertPolicyCallable() { - throw new UnsupportedOperationException("Not implemented: deleteAlertPolicyCallable()"); - } - public UnaryCallable updateAlertPolicyCallable() { throw new UnsupportedOperationException("Not implemented: updateAlertPolicyCallable()"); } diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStubSettings.java index 94c60360..b6591ce1 100644 --- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStubSettings.java +++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/AlertPolicyServiceStubSettings.java @@ -71,16 +71,16 @@ *

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 getAlertPolicy to 30 seconds: + *

For example, to set the total timeout of deleteAlertPolicy to 30 seconds: * *

  * 
  * AlertPolicyServiceStubSettings.Builder alertPolicyServiceSettingsBuilder =
  *     AlertPolicyServiceStubSettings.newBuilder();
  * alertPolicyServiceSettingsBuilder
- *     .getAlertPolicySettings()
+ *     .deleteAlertPolicySettings()
  *     .setRetrySettings(
- *         alertPolicyServiceSettingsBuilder.getAlertPolicySettings().getRetrySettings().toBuilder()
+ *         alertPolicyServiceSettingsBuilder.deleteAlertPolicySettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AlertPolicyServiceStubSettings alertPolicyServiceSettings = alertPolicyServiceSettingsBuilder.build();
@@ -98,14 +98,19 @@ public class AlertPolicyServiceStubSettings extends StubSettings deleteAlertPolicySettings;
   private final PagedCallSettings<
           ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
       listAlertPoliciesSettings;
   private final UnaryCallSettings getAlertPolicySettings;
   private final UnaryCallSettings createAlertPolicySettings;
-  private final UnaryCallSettings deleteAlertPolicySettings;
   private final UnaryCallSettings updateAlertPolicySettings;
 
+  /** Returns the object with the settings used for calls to deleteAlertPolicy. */
+  public UnaryCallSettings deleteAlertPolicySettings() {
+    return deleteAlertPolicySettings;
+  }
+
   /** Returns the object with the settings used for calls to listAlertPolicies. */
   public PagedCallSettings<
           ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -123,11 +128,6 @@ public UnaryCallSettings createAlertPolic
     return createAlertPolicySettings;
   }
 
-  /** Returns the object with the settings used for calls to deleteAlertPolicy. */
-  public UnaryCallSettings deleteAlertPolicySettings() {
-    return deleteAlertPolicySettings;
-  }
-
   /** Returns the object with the settings used for calls to updateAlertPolicy. */
   public UnaryCallSettings updateAlertPolicySettings() {
     return updateAlertPolicySettings;
@@ -202,10 +202,10 @@ public Builder toBuilder() {
   protected AlertPolicyServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    deleteAlertPolicySettings = settingsBuilder.deleteAlertPolicySettings().build();
     listAlertPoliciesSettings = settingsBuilder.listAlertPoliciesSettings().build();
     getAlertPolicySettings = settingsBuilder.getAlertPolicySettings().build();
     createAlertPolicySettings = settingsBuilder.createAlertPolicySettings().build();
-    deleteAlertPolicySettings = settingsBuilder.deleteAlertPolicySettings().build();
     updateAlertPolicySettings = settingsBuilder.updateAlertPolicySettings().build();
   }
 
@@ -275,6 +275,8 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        deleteAlertPolicySettings;
     private final PagedCallSettings.Builder<
             ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
         listAlertPoliciesSettings;
@@ -282,8 +284,6 @@ public static class Builder
         getAlertPolicySettings;
     private final UnaryCallSettings.Builder
         createAlertPolicySettings;
-    private final UnaryCallSettings.Builder
-        deleteAlertPolicySettings;
     private final UnaryCallSettings.Builder
         updateAlertPolicySettings;
 
@@ -328,22 +328,22 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      deleteAlertPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       listAlertPoliciesSettings = PagedCallSettings.newBuilder(LIST_ALERT_POLICIES_PAGE_STR_FACT);
 
       getAlertPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       createAlertPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteAlertPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       updateAlertPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteAlertPolicySettings,
               listAlertPoliciesSettings,
               getAlertPolicySettings,
               createAlertPolicySettings,
-              deleteAlertPolicySettings,
               updateAlertPolicySettings);
 
       initDefaults(this);
@@ -360,6 +360,11 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .deleteAlertPolicySettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .listAlertPoliciesSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
@@ -375,11 +380,6 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .deleteAlertPolicySettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .updateAlertPolicySettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
@@ -391,18 +391,18 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(AlertPolicyServiceStubSettings settings) {
       super(settings);
 
+      deleteAlertPolicySettings = settings.deleteAlertPolicySettings.toBuilder();
       listAlertPoliciesSettings = settings.listAlertPoliciesSettings.toBuilder();
       getAlertPolicySettings = settings.getAlertPolicySettings.toBuilder();
       createAlertPolicySettings = settings.createAlertPolicySettings.toBuilder();
-      deleteAlertPolicySettings = settings.deleteAlertPolicySettings.toBuilder();
       updateAlertPolicySettings = settings.updateAlertPolicySettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteAlertPolicySettings,
               listAlertPoliciesSettings,
               getAlertPolicySettings,
               createAlertPolicySettings,
-              deleteAlertPolicySettings,
               updateAlertPolicySettings);
     }
 
@@ -422,6 +422,11 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to deleteAlertPolicy. */
+    public UnaryCallSettings.Builder deleteAlertPolicySettings() {
+      return deleteAlertPolicySettings;
+    }
+
     /** Returns the builder for the settings used for calls to listAlertPolicies. */
     public PagedCallSettings.Builder<
             ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -440,11 +445,6 @@ public UnaryCallSettings.Builder getAlertPol
       return createAlertPolicySettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteAlertPolicy. */
-    public UnaryCallSettings.Builder deleteAlertPolicySettings() {
-      return deleteAlertPolicySettings;
-    }
-
     /** Returns the builder for the settings used for calls to updateAlertPolicy. */
     public UnaryCallSettings.Builder
         updateAlertPolicySettings() {
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStub.java
index 3f6d0d94..e8d73ceb 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStub.java
@@ -43,6 +43,14 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public abstract class GroupServiceStub implements BackgroundResource {
 
+  public UnaryCallable updateGroupCallable() {
+    throw new UnsupportedOperationException("Not implemented: updateGroupCallable()");
+  }
+
+  public UnaryCallable deleteGroupCallable() {
+    throw new UnsupportedOperationException("Not implemented: deleteGroupCallable()");
+  }
+
   public UnaryCallable listGroupsPagedCallable() {
     throw new UnsupportedOperationException("Not implemented: listGroupsPagedCallable()");
   }
@@ -59,14 +67,6 @@ public UnaryCallable createGroupCallable() {
     throw new UnsupportedOperationException("Not implemented: createGroupCallable()");
   }
 
-  public UnaryCallable updateGroupCallable() {
-    throw new UnsupportedOperationException("Not implemented: updateGroupCallable()");
-  }
-
-  public UnaryCallable deleteGroupCallable() {
-    throw new UnsupportedOperationException("Not implemented: deleteGroupCallable()");
-  }
-
   public UnaryCallable
       listGroupMembersPagedCallable() {
     throw new UnsupportedOperationException("Not implemented: listGroupMembersPagedCallable()");
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStubSettings.java
index c23f581c..2e89710e 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStubSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GroupServiceStubSettings.java
@@ -75,16 +75,16 @@
  * 

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: + *

For example, to set the total timeout of updateGroup to 30 seconds: * *

  * 
  * GroupServiceStubSettings.Builder groupServiceSettingsBuilder =
  *     GroupServiceStubSettings.newBuilder();
  * groupServiceSettingsBuilder
- *     .getGroupSettings()
+ *     .updateGroupSettings()
  *     .setRetrySettings(
- *         groupServiceSettingsBuilder.getGroupSettings().getRetrySettings().toBuilder()
+ *         groupServiceSettingsBuilder.updateGroupSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * GroupServiceStubSettings groupServiceSettings = groupServiceSettingsBuilder.build();
@@ -102,16 +102,26 @@ public class GroupServiceStubSettings extends StubSettings updateGroupSettings;
+  private final UnaryCallSettings deleteGroupSettings;
   private final PagedCallSettings
       listGroupsSettings;
   private final UnaryCallSettings getGroupSettings;
   private final UnaryCallSettings createGroupSettings;
-  private final UnaryCallSettings updateGroupSettings;
-  private final UnaryCallSettings deleteGroupSettings;
   private final PagedCallSettings<
           ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
       listGroupMembersSettings;
 
+  /** Returns the object with the settings used for calls to updateGroup. */
+  public UnaryCallSettings updateGroupSettings() {
+    return updateGroupSettings;
+  }
+
+  /** Returns the object with the settings used for calls to deleteGroup. */
+  public UnaryCallSettings deleteGroupSettings() {
+    return deleteGroupSettings;
+  }
+
   /** Returns the object with the settings used for calls to listGroups. */
   public PagedCallSettings
       listGroupsSettings() {
@@ -128,16 +138,6 @@ public UnaryCallSettings createGroupSettings() {
     return createGroupSettings;
   }
 
-  /** Returns the object with the settings used for calls to updateGroup. */
-  public UnaryCallSettings updateGroupSettings() {
-    return updateGroupSettings;
-  }
-
-  /** Returns the object with the settings used for calls to deleteGroup. */
-  public UnaryCallSettings deleteGroupSettings() {
-    return deleteGroupSettings;
-  }
-
   /** Returns the object with the settings used for calls to listGroupMembers. */
   public PagedCallSettings<
           ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
@@ -214,11 +214,11 @@ public Builder toBuilder() {
   protected GroupServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    updateGroupSettings = settingsBuilder.updateGroupSettings().build();
+    deleteGroupSettings = settingsBuilder.deleteGroupSettings().build();
     listGroupsSettings = settingsBuilder.listGroupsSettings().build();
     getGroupSettings = settingsBuilder.getGroupSettings().build();
     createGroupSettings = settingsBuilder.createGroupSettings().build();
-    updateGroupSettings = settingsBuilder.updateGroupSettings().build();
-    deleteGroupSettings = settingsBuilder.deleteGroupSettings().build();
     listGroupMembersSettings = settingsBuilder.listGroupMembersSettings().build();
   }
 
@@ -338,13 +338,13 @@ public ApiFuture getFuturePagedResponse(
   public static class Builder extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder updateGroupSettings;
+    private final UnaryCallSettings.Builder deleteGroupSettings;
     private final PagedCallSettings.Builder<
             ListGroupsRequest, ListGroupsResponse, ListGroupsPagedResponse>
         listGroupsSettings;
     private final UnaryCallSettings.Builder getGroupSettings;
     private final UnaryCallSettings.Builder createGroupSettings;
-    private final UnaryCallSettings.Builder updateGroupSettings;
-    private final UnaryCallSettings.Builder deleteGroupSettings;
     private final PagedCallSettings.Builder<
             ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
         listGroupMembersSettings;
@@ -390,25 +390,25 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      updateGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      deleteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       listGroupsSettings = PagedCallSettings.newBuilder(LIST_GROUPS_PAGE_STR_FACT);
 
       getGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       createGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      updateGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
-      deleteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       listGroupMembersSettings = PagedCallSettings.newBuilder(LIST_GROUP_MEMBERS_PAGE_STR_FACT);
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              updateGroupSettings,
+              deleteGroupSettings,
               listGroupsSettings,
               getGroupSettings,
               createGroupSettings,
-              updateGroupSettings,
-              deleteGroupSettings,
               listGroupMembersSettings);
 
       initDefaults(this);
@@ -426,28 +426,28 @@ private static Builder createDefault() {
     private static Builder initDefaults(Builder builder) {
 
       builder
-          .listGroupsSettings()
+          .updateGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .getGroupSettings()
+          .deleteGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .createGroupSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .listGroupsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .updateGroupSettings()
+          .getGroupSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .deleteGroupSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .createGroupSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
@@ -461,20 +461,20 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(GroupServiceStubSettings settings) {
       super(settings);
 
+      updateGroupSettings = settings.updateGroupSettings.toBuilder();
+      deleteGroupSettings = settings.deleteGroupSettings.toBuilder();
       listGroupsSettings = settings.listGroupsSettings.toBuilder();
       getGroupSettings = settings.getGroupSettings.toBuilder();
       createGroupSettings = settings.createGroupSettings.toBuilder();
-      updateGroupSettings = settings.updateGroupSettings.toBuilder();
-      deleteGroupSettings = settings.deleteGroupSettings.toBuilder();
       listGroupMembersSettings = settings.listGroupMembersSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              updateGroupSettings,
+              deleteGroupSettings,
               listGroupsSettings,
               getGroupSettings,
               createGroupSettings,
-              updateGroupSettings,
-              deleteGroupSettings,
               listGroupMembersSettings);
     }
 
@@ -494,6 +494,16 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to updateGroup. */
+    public UnaryCallSettings.Builder updateGroupSettings() {
+      return updateGroupSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to deleteGroup. */
+    public UnaryCallSettings.Builder deleteGroupSettings() {
+      return deleteGroupSettings;
+    }
+
     /** Returns the builder for the settings used for calls to listGroups. */
     public PagedCallSettings.Builder
         listGroupsSettings() {
@@ -510,16 +520,6 @@ public UnaryCallSettings.Builder createGroupSettings(
       return createGroupSettings;
     }
 
-    /** Returns the builder for the settings used for calls to updateGroup. */
-    public UnaryCallSettings.Builder updateGroupSettings() {
-      return updateGroupSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to deleteGroup. */
-    public UnaryCallSettings.Builder deleteGroupSettings() {
-      return deleteGroupSettings;
-    }
-
     /** Returns the builder for the settings used for calls to listGroupMembers. */
     public PagedCallSettings.Builder<
             ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcAlertPolicyServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcAlertPolicyServiceStub.java
index 2ebcffa8..a58ab291 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcAlertPolicyServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcAlertPolicyServiceStub.java
@@ -51,6 +51,15 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcAlertPolicyServiceStub extends AlertPolicyServiceStub {
 
+  private static final MethodDescriptor
+      deleteAlertPolicyMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName("google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(DeleteAlertPolicyRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor
       listAlertPoliciesMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -79,15 +88,6 @@ public class GrpcAlertPolicyServiceStub extends AlertPolicyServiceStub {
                   ProtoUtils.marshaller(CreateAlertPolicyRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(AlertPolicy.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor
-      deleteAlertPolicyMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName("google.monitoring.v3.AlertPolicyService/DeleteAlertPolicy")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(DeleteAlertPolicyRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-              .build();
   private static final MethodDescriptor
       updateAlertPolicyMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -100,13 +100,13 @@ public class GrpcAlertPolicyServiceStub extends AlertPolicyServiceStub {
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable deleteAlertPolicyCallable;
   private final UnaryCallable
       listAlertPoliciesCallable;
   private final UnaryCallable
       listAlertPoliciesPagedCallable;
   private final UnaryCallable getAlertPolicyCallable;
   private final UnaryCallable createAlertPolicyCallable;
-  private final UnaryCallable deleteAlertPolicyCallable;
   private final UnaryCallable updateAlertPolicyCallable;
 
   private final GrpcStubCallableFactory callableFactory;
@@ -150,6 +150,19 @@ protected GrpcAlertPolicyServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    GrpcCallSettings deleteAlertPolicyTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(deleteAlertPolicyMethodDescriptor)
+            .setParamsExtractor(
+                new RequestParamsExtractor() {
+                  @Override
+                  public Map extract(DeleteAlertPolicyRequest request) {
+                    ImmutableMap.Builder params = ImmutableMap.builder();
+                    params.put("name", String.valueOf(request.getName()));
+                    return params.build();
+                  }
+                })
+            .build();
     GrpcCallSettings
         listAlertPoliciesTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -190,19 +203,6 @@ public Map extract(CreateAlertPolicyRequest request) {
                   }
                 })
             .build();
-    GrpcCallSettings deleteAlertPolicyTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(deleteAlertPolicyMethodDescriptor)
-            .setParamsExtractor(
-                new RequestParamsExtractor() {
-                  @Override
-                  public Map extract(DeleteAlertPolicyRequest request) {
-                    ImmutableMap.Builder params = ImmutableMap.builder();
-                    params.put("name", String.valueOf(request.getName()));
-                    return params.build();
-                  }
-                })
-            .build();
     GrpcCallSettings updateAlertPolicyTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(updateAlertPolicyMethodDescriptor)
@@ -218,6 +218,11 @@ public Map extract(UpdateAlertPolicyRequest request) {
                 })
             .build();
 
+    this.deleteAlertPolicyCallable =
+        callableFactory.createUnaryCallable(
+            deleteAlertPolicyTransportSettings,
+            settings.deleteAlertPolicySettings(),
+            clientContext);
     this.listAlertPoliciesCallable =
         callableFactory.createUnaryCallable(
             listAlertPoliciesTransportSettings,
@@ -236,11 +241,6 @@ public Map extract(UpdateAlertPolicyRequest request) {
             createAlertPolicyTransportSettings,
             settings.createAlertPolicySettings(),
             clientContext);
-    this.deleteAlertPolicyCallable =
-        callableFactory.createUnaryCallable(
-            deleteAlertPolicyTransportSettings,
-            settings.deleteAlertPolicySettings(),
-            clientContext);
     this.updateAlertPolicyCallable =
         callableFactory.createUnaryCallable(
             updateAlertPolicyTransportSettings,
@@ -250,6 +250,10 @@ public Map extract(UpdateAlertPolicyRequest request) {
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  public UnaryCallable deleteAlertPolicyCallable() {
+    return deleteAlertPolicyCallable;
+  }
+
   public UnaryCallable
       listAlertPoliciesPagedCallable() {
     return listAlertPoliciesPagedCallable;
@@ -268,10 +272,6 @@ public UnaryCallable createAlertPolicyCal
     return createAlertPolicyCallable;
   }
 
-  public UnaryCallable deleteAlertPolicyCallable() {
-    return deleteAlertPolicyCallable;
-  }
-
   public UnaryCallable updateAlertPolicyCallable() {
     return updateAlertPolicyCallable;
   }
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcGroupServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcGroupServiceStub.java
index b49fb87f..0455d442 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcGroupServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcGroupServiceStub.java
@@ -54,6 +54,20 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcGroupServiceStub extends GroupServiceStub {
 
+  private static final MethodDescriptor updateGroupMethodDescriptor =
+      MethodDescriptor.newBuilder()
+          .setType(MethodDescriptor.MethodType.UNARY)
+          .setFullMethodName("google.monitoring.v3.GroupService/UpdateGroup")
+          .setRequestMarshaller(ProtoUtils.marshaller(UpdateGroupRequest.getDefaultInstance()))
+          .setResponseMarshaller(ProtoUtils.marshaller(Group.getDefaultInstance()))
+          .build();
+  private static final MethodDescriptor deleteGroupMethodDescriptor =
+      MethodDescriptor.newBuilder()
+          .setType(MethodDescriptor.MethodType.UNARY)
+          .setFullMethodName("google.monitoring.v3.GroupService/DeleteGroup")
+          .setRequestMarshaller(ProtoUtils.marshaller(DeleteGroupRequest.getDefaultInstance()))
+          .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+          .build();
   private static final MethodDescriptor
       listGroupsMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -76,20 +90,6 @@ public class GrpcGroupServiceStub extends GroupServiceStub {
           .setRequestMarshaller(ProtoUtils.marshaller(CreateGroupRequest.getDefaultInstance()))
           .setResponseMarshaller(ProtoUtils.marshaller(Group.getDefaultInstance()))
           .build();
-  private static final MethodDescriptor updateGroupMethodDescriptor =
-      MethodDescriptor.newBuilder()
-          .setType(MethodDescriptor.MethodType.UNARY)
-          .setFullMethodName("google.monitoring.v3.GroupService/UpdateGroup")
-          .setRequestMarshaller(ProtoUtils.marshaller(UpdateGroupRequest.getDefaultInstance()))
-          .setResponseMarshaller(ProtoUtils.marshaller(Group.getDefaultInstance()))
-          .build();
-  private static final MethodDescriptor deleteGroupMethodDescriptor =
-      MethodDescriptor.newBuilder()
-          .setType(MethodDescriptor.MethodType.UNARY)
-          .setFullMethodName("google.monitoring.v3.GroupService/DeleteGroup")
-          .setRequestMarshaller(ProtoUtils.marshaller(DeleteGroupRequest.getDefaultInstance()))
-          .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-          .build();
   private static final MethodDescriptor
       listGroupMembersMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -103,12 +103,12 @@ public class GrpcGroupServiceStub extends GroupServiceStub {
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable updateGroupCallable;
+  private final UnaryCallable deleteGroupCallable;
   private final UnaryCallable listGroupsCallable;
   private final UnaryCallable listGroupsPagedCallable;
   private final UnaryCallable getGroupCallable;
   private final UnaryCallable createGroupCallable;
-  private final UnaryCallable updateGroupCallable;
-  private final UnaryCallable deleteGroupCallable;
   private final UnaryCallable
       listGroupMembersCallable;
   private final UnaryCallable
@@ -153,6 +153,32 @@ protected GrpcGroupServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    GrpcCallSettings updateGroupTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(updateGroupMethodDescriptor)
+            .setParamsExtractor(
+                new RequestParamsExtractor() {
+                  @Override
+                  public Map extract(UpdateGroupRequest request) {
+                    ImmutableMap.Builder params = ImmutableMap.builder();
+                    params.put("group.name", String.valueOf(request.getGroup().getName()));
+                    return params.build();
+                  }
+                })
+            .build();
+    GrpcCallSettings deleteGroupTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(deleteGroupMethodDescriptor)
+            .setParamsExtractor(
+                new RequestParamsExtractor() {
+                  @Override
+                  public Map extract(DeleteGroupRequest request) {
+                    ImmutableMap.Builder params = ImmutableMap.builder();
+                    params.put("name", String.valueOf(request.getName()));
+                    return params.build();
+                  }
+                })
+            .build();
     GrpcCallSettings listGroupsTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(listGroupsMethodDescriptor)
@@ -192,32 +218,6 @@ public Map extract(CreateGroupRequest request) {
                   }
                 })
             .build();
-    GrpcCallSettings updateGroupTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(updateGroupMethodDescriptor)
-            .setParamsExtractor(
-                new RequestParamsExtractor() {
-                  @Override
-                  public Map extract(UpdateGroupRequest request) {
-                    ImmutableMap.Builder params = ImmutableMap.builder();
-                    params.put("group.name", String.valueOf(request.getGroup().getName()));
-                    return params.build();
-                  }
-                })
-            .build();
-    GrpcCallSettings deleteGroupTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(deleteGroupMethodDescriptor)
-            .setParamsExtractor(
-                new RequestParamsExtractor() {
-                  @Override
-                  public Map extract(DeleteGroupRequest request) {
-                    ImmutableMap.Builder params = ImmutableMap.builder();
-                    params.put("name", String.valueOf(request.getName()));
-                    return params.build();
-                  }
-                })
-            .build();
     GrpcCallSettings
         listGroupMembersTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -233,6 +233,12 @@ public Map extract(ListGroupMembersRequest request) {
                     })
                 .build();
 
+    this.updateGroupCallable =
+        callableFactory.createUnaryCallable(
+            updateGroupTransportSettings, settings.updateGroupSettings(), clientContext);
+    this.deleteGroupCallable =
+        callableFactory.createUnaryCallable(
+            deleteGroupTransportSettings, settings.deleteGroupSettings(), clientContext);
     this.listGroupsCallable =
         callableFactory.createUnaryCallable(
             listGroupsTransportSettings, settings.listGroupsSettings(), clientContext);
@@ -245,12 +251,6 @@ public Map extract(ListGroupMembersRequest request) {
     this.createGroupCallable =
         callableFactory.createUnaryCallable(
             createGroupTransportSettings, settings.createGroupSettings(), clientContext);
-    this.updateGroupCallable =
-        callableFactory.createUnaryCallable(
-            updateGroupTransportSettings, settings.updateGroupSettings(), clientContext);
-    this.deleteGroupCallable =
-        callableFactory.createUnaryCallable(
-            deleteGroupTransportSettings, settings.deleteGroupSettings(), clientContext);
     this.listGroupMembersCallable =
         callableFactory.createUnaryCallable(
             listGroupMembersTransportSettings, settings.listGroupMembersSettings(), clientContext);
@@ -261,6 +261,14 @@ public Map extract(ListGroupMembersRequest request) {
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  public UnaryCallable updateGroupCallable() {
+    return updateGroupCallable;
+  }
+
+  public UnaryCallable deleteGroupCallable() {
+    return deleteGroupCallable;
+  }
+
   public UnaryCallable listGroupsPagedCallable() {
     return listGroupsPagedCallable;
   }
@@ -277,14 +285,6 @@ public UnaryCallable createGroupCallable() {
     return createGroupCallable;
   }
 
-  public UnaryCallable updateGroupCallable() {
-    return updateGroupCallable;
-  }
-
-  public UnaryCallable deleteGroupCallable() {
-    return deleteGroupCallable;
-  }
-
   public UnaryCallable
       listGroupMembersPagedCallable() {
     return listGroupMembersPagedCallable;
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcNotificationChannelServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcNotificationChannelServiceStub.java
index 05634628..1b367432 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcNotificationChannelServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcNotificationChannelServiceStub.java
@@ -60,6 +60,45 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcNotificationChannelServiceStub extends NotificationChannelServiceStub {
 
+  private static final MethodDescriptor
+      deleteNotificationChannelMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(DeleteNotificationChannelRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+              .build();
+  private static final MethodDescriptor<
+          GetNotificationChannelVerificationCodeRequest,
+          GetNotificationChannelVerificationCodeResponse>
+      getNotificationChannelVerificationCodeMethodDescriptor =
+          MethodDescriptor
+              .
+                  newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(
+                      GetNotificationChannelVerificationCodeRequest.getDefaultInstance()))
+              .setResponseMarshaller(
+                  ProtoUtils.marshaller(
+                      GetNotificationChannelVerificationCodeResponse.getDefaultInstance()))
+              .build();
+  private static final MethodDescriptor
+      verifyNotificationChannelMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(VerifyNotificationChannelRequest.getDefaultInstance()))
+              .setResponseMarshaller(
+                  ProtoUtils.marshaller(NotificationChannel.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor<
           ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse>
       listNotificationChannelDescriptorsMethodDescriptor =
@@ -137,16 +176,6 @@ public class GrpcNotificationChannelServiceStub extends NotificationChannelServi
               .setResponseMarshaller(
                   ProtoUtils.marshaller(NotificationChannel.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor
-      deleteNotificationChannelMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.monitoring.v3.NotificationChannelService/DeleteNotificationChannel")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(DeleteNotificationChannelRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-              .build();
   private static final MethodDescriptor
       sendNotificationChannelVerificationCodeMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -158,38 +187,17 @@ public class GrpcNotificationChannelServiceStub extends NotificationChannelServi
                       SendNotificationChannelVerificationCodeRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor<
-          GetNotificationChannelVerificationCodeRequest,
-          GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeMethodDescriptor =
-          MethodDescriptor
-              .
-                  newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.monitoring.v3.NotificationChannelService/GetNotificationChannelVerificationCode")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(
-                      GetNotificationChannelVerificationCodeRequest.getDefaultInstance()))
-              .setResponseMarshaller(
-                  ProtoUtils.marshaller(
-                      GetNotificationChannelVerificationCodeResponse.getDefaultInstance()))
-              .build();
-  private static final MethodDescriptor
-      verifyNotificationChannelMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.monitoring.v3.NotificationChannelService/VerifyNotificationChannel")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(VerifyNotificationChannelRequest.getDefaultInstance()))
-              .setResponseMarshaller(
-                  ProtoUtils.marshaller(NotificationChannel.getDefaultInstance()))
-              .build();
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable
+      deleteNotificationChannelCallable;
+  private final UnaryCallable<
+          GetNotificationChannelVerificationCodeRequest,
+          GetNotificationChannelVerificationCodeResponse>
+      getNotificationChannelVerificationCodeCallable;
+  private final UnaryCallable
+      verifyNotificationChannelCallable;
   private final UnaryCallable<
           ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse>
       listNotificationChannelDescriptorsCallable;
@@ -211,16 +219,8 @@ public class GrpcNotificationChannelServiceStub extends NotificationChannelServi
       createNotificationChannelCallable;
   private final UnaryCallable
       updateNotificationChannelCallable;
-  private final UnaryCallable
-      deleteNotificationChannelCallable;
   private final UnaryCallable
       sendNotificationChannelVerificationCodeCallable;
-  private final UnaryCallable<
-          GetNotificationChannelVerificationCodeRequest,
-          GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeCallable;
-  private final UnaryCallable
-      verifyNotificationChannelCallable;
 
   private final GrpcStubCallableFactory callableFactory;
 
@@ -266,6 +266,54 @@ protected GrpcNotificationChannelServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    GrpcCallSettings
+        deleteNotificationChannelTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(deleteNotificationChannelMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(DeleteNotificationChannelRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("name", String.valueOf(request.getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
+    GrpcCallSettings<
+            GetNotificationChannelVerificationCodeRequest,
+            GetNotificationChannelVerificationCodeResponse>
+        getNotificationChannelVerificationCodeTransportSettings =
+            GrpcCallSettings
+                .
+                    newBuilder()
+                .setMethodDescriptor(getNotificationChannelVerificationCodeMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(
+                          GetNotificationChannelVerificationCodeRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("name", String.valueOf(request.getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
+    GrpcCallSettings
+        verifyNotificationChannelTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(verifyNotificationChannelMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(VerifyNotificationChannelRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("name", String.valueOf(request.getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
     GrpcCallSettings<
             ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse>
         listNotificationChannelDescriptorsTransportSettings =
@@ -361,20 +409,6 @@ public Map extract(UpdateNotificationChannelRequest request) {
                       }
                     })
                 .build();
-    GrpcCallSettings
-        deleteNotificationChannelTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(deleteNotificationChannelMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(DeleteNotificationChannelRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("name", String.valueOf(request.getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
     GrpcCallSettings
         sendNotificationChannelVerificationCodeTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -390,41 +424,22 @@ public Map extract(
                       }
                     })
                 .build();
-    GrpcCallSettings<
-            GetNotificationChannelVerificationCodeRequest,
-            GetNotificationChannelVerificationCodeResponse>
-        getNotificationChannelVerificationCodeTransportSettings =
-            GrpcCallSettings
-                .
-                    newBuilder()
-                .setMethodDescriptor(getNotificationChannelVerificationCodeMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(
-                          GetNotificationChannelVerificationCodeRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("name", String.valueOf(request.getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
-    GrpcCallSettings
-        verifyNotificationChannelTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(verifyNotificationChannelMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(VerifyNotificationChannelRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("name", String.valueOf(request.getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
 
+    this.deleteNotificationChannelCallable =
+        callableFactory.createUnaryCallable(
+            deleteNotificationChannelTransportSettings,
+            settings.deleteNotificationChannelSettings(),
+            clientContext);
+    this.getNotificationChannelVerificationCodeCallable =
+        callableFactory.createUnaryCallable(
+            getNotificationChannelVerificationCodeTransportSettings,
+            settings.getNotificationChannelVerificationCodeSettings(),
+            clientContext);
+    this.verifyNotificationChannelCallable =
+        callableFactory.createUnaryCallable(
+            verifyNotificationChannelTransportSettings,
+            settings.verifyNotificationChannelSettings(),
+            clientContext);
     this.listNotificationChannelDescriptorsCallable =
         callableFactory.createUnaryCallable(
             listNotificationChannelDescriptorsTransportSettings,
@@ -465,30 +480,32 @@ public Map extract(VerifyNotificationChannelRequest request) {
             updateNotificationChannelTransportSettings,
             settings.updateNotificationChannelSettings(),
             clientContext);
-    this.deleteNotificationChannelCallable =
-        callableFactory.createUnaryCallable(
-            deleteNotificationChannelTransportSettings,
-            settings.deleteNotificationChannelSettings(),
-            clientContext);
     this.sendNotificationChannelVerificationCodeCallable =
         callableFactory.createUnaryCallable(
             sendNotificationChannelVerificationCodeTransportSettings,
             settings.sendNotificationChannelVerificationCodeSettings(),
             clientContext);
-    this.getNotificationChannelVerificationCodeCallable =
-        callableFactory.createUnaryCallable(
-            getNotificationChannelVerificationCodeTransportSettings,
-            settings.getNotificationChannelVerificationCodeSettings(),
-            clientContext);
-    this.verifyNotificationChannelCallable =
-        callableFactory.createUnaryCallable(
-            verifyNotificationChannelTransportSettings,
-            settings.verifyNotificationChannelSettings(),
-            clientContext);
 
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  public UnaryCallable
+      deleteNotificationChannelCallable() {
+    return deleteNotificationChannelCallable;
+  }
+
+  public UnaryCallable<
+          GetNotificationChannelVerificationCodeRequest,
+          GetNotificationChannelVerificationCodeResponse>
+      getNotificationChannelVerificationCodeCallable() {
+    return getNotificationChannelVerificationCodeCallable;
+  }
+
+  public UnaryCallable
+      verifyNotificationChannelCallable() {
+    return verifyNotificationChannelCallable;
+  }
+
   public UnaryCallable<
           ListNotificationChannelDescriptorsRequest,
           ListNotificationChannelDescriptorsPagedResponse>
@@ -532,28 +549,11 @@ public Map extract(VerifyNotificationChannelRequest request) {
     return updateNotificationChannelCallable;
   }
 
-  public UnaryCallable
-      deleteNotificationChannelCallable() {
-    return deleteNotificationChannelCallable;
-  }
-
   public UnaryCallable
       sendNotificationChannelVerificationCodeCallable() {
     return sendNotificationChannelVerificationCodeCallable;
   }
 
-  public UnaryCallable<
-          GetNotificationChannelVerificationCodeRequest,
-          GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeCallable() {
-    return getNotificationChannelVerificationCodeCallable;
-  }
-
-  public UnaryCallable
-      verifyNotificationChannelCallable() {
-    return verifyNotificationChannelCallable;
-  }
-
   @Override
   public final void close() {
     shutdown();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java
index aa5b0f88..be3cdc9b 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcServiceMonitoringServiceStub.java
@@ -59,6 +59,23 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcServiceMonitoringServiceStub extends ServiceMonitoringServiceStub {
 
+  private static final MethodDescriptor deleteServiceMethodDescriptor =
+      MethodDescriptor.newBuilder()
+          .setType(MethodDescriptor.MethodType.UNARY)
+          .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/DeleteService")
+          .setRequestMarshaller(ProtoUtils.marshaller(DeleteServiceRequest.getDefaultInstance()))
+          .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+          .build();
+  private static final MethodDescriptor
+      deleteServiceLevelObjectiveMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(
+                  "google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(DeleteServiceLevelObjectiveRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor
       createServiceMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -93,13 +110,6 @@ public class GrpcServiceMonitoringServiceStub extends ServiceMonitoringServiceSt
                   ProtoUtils.marshaller(UpdateServiceRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(Service.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor deleteServiceMethodDescriptor =
-      MethodDescriptor.newBuilder()
-          .setType(MethodDescriptor.MethodType.UNARY)
-          .setFullMethodName("google.monitoring.v3.ServiceMonitoringService/DeleteService")
-          .setRequestMarshaller(ProtoUtils.marshaller(DeleteServiceRequest.getDefaultInstance()))
-          .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-          .build();
   private static final MethodDescriptor
       createServiceLevelObjectiveMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -146,26 +156,18 @@ public class GrpcServiceMonitoringServiceStub extends ServiceMonitoringServiceSt
               .setResponseMarshaller(
                   ProtoUtils.marshaller(ServiceLevelObjective.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor
-      deleteServiceLevelObjectiveMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName(
-                  "google.monitoring.v3.ServiceMonitoringService/DeleteServiceLevelObjective")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(DeleteServiceLevelObjectiveRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-              .build();
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable deleteServiceCallable;
+  private final UnaryCallable
+      deleteServiceLevelObjectiveCallable;
   private final UnaryCallable createServiceCallable;
   private final UnaryCallable getServiceCallable;
   private final UnaryCallable listServicesCallable;
   private final UnaryCallable
       listServicesPagedCallable;
   private final UnaryCallable updateServiceCallable;
-  private final UnaryCallable deleteServiceCallable;
   private final UnaryCallable
       createServiceLevelObjectiveCallable;
   private final UnaryCallable
@@ -177,8 +179,6 @@ public class GrpcServiceMonitoringServiceStub extends ServiceMonitoringServiceSt
       listServiceLevelObjectivesPagedCallable;
   private final UnaryCallable
       updateServiceLevelObjectiveCallable;
-  private final UnaryCallable
-      deleteServiceLevelObjectiveCallable;
 
   private final GrpcStubCallableFactory callableFactory;
 
@@ -222,6 +222,34 @@ protected GrpcServiceMonitoringServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    GrpcCallSettings deleteServiceTransportSettings =
+        GrpcCallSettings.newBuilder()
+            .setMethodDescriptor(deleteServiceMethodDescriptor)
+            .setParamsExtractor(
+                new RequestParamsExtractor() {
+                  @Override
+                  public Map extract(DeleteServiceRequest request) {
+                    ImmutableMap.Builder params = ImmutableMap.builder();
+                    params.put("name", String.valueOf(request.getName()));
+                    return params.build();
+                  }
+                })
+            .build();
+    GrpcCallSettings
+        deleteServiceLevelObjectiveTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(deleteServiceLevelObjectiveMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(
+                          DeleteServiceLevelObjectiveRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("name", String.valueOf(request.getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
     GrpcCallSettings createServiceTransportSettings =
         GrpcCallSettings.newBuilder()
             .setMethodDescriptor(createServiceMethodDescriptor)
@@ -274,19 +302,6 @@ public Map extract(UpdateServiceRequest request) {
                   }
                 })
             .build();
-    GrpcCallSettings deleteServiceTransportSettings =
-        GrpcCallSettings.newBuilder()
-            .setMethodDescriptor(deleteServiceMethodDescriptor)
-            .setParamsExtractor(
-                new RequestParamsExtractor() {
-                  @Override
-                  public Map extract(DeleteServiceRequest request) {
-                    ImmutableMap.Builder params = ImmutableMap.builder();
-                    params.put("name", String.valueOf(request.getName()));
-                    return params.build();
-                  }
-                })
-            .build();
     GrpcCallSettings
         createServiceLevelObjectiveTransportSettings =
             GrpcCallSettings.newBuilder()
@@ -349,22 +364,15 @@ public Map extract(
                       }
                     })
                 .build();
-    GrpcCallSettings
-        deleteServiceLevelObjectiveTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(deleteServiceLevelObjectiveMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(
-                          DeleteServiceLevelObjectiveRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("name", String.valueOf(request.getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
 
+    this.deleteServiceCallable =
+        callableFactory.createUnaryCallable(
+            deleteServiceTransportSettings, settings.deleteServiceSettings(), clientContext);
+    this.deleteServiceLevelObjectiveCallable =
+        callableFactory.createUnaryCallable(
+            deleteServiceLevelObjectiveTransportSettings,
+            settings.deleteServiceLevelObjectiveSettings(),
+            clientContext);
     this.createServiceCallable =
         callableFactory.createUnaryCallable(
             createServiceTransportSettings, settings.createServiceSettings(), clientContext);
@@ -380,9 +388,6 @@ public Map extract(
     this.updateServiceCallable =
         callableFactory.createUnaryCallable(
             updateServiceTransportSettings, settings.updateServiceSettings(), clientContext);
-    this.deleteServiceCallable =
-        callableFactory.createUnaryCallable(
-            deleteServiceTransportSettings, settings.deleteServiceSettings(), clientContext);
     this.createServiceLevelObjectiveCallable =
         callableFactory.createUnaryCallable(
             createServiceLevelObjectiveTransportSettings,
@@ -408,15 +413,19 @@ public Map extract(
             updateServiceLevelObjectiveTransportSettings,
             settings.updateServiceLevelObjectiveSettings(),
             clientContext);
-    this.deleteServiceLevelObjectiveCallable =
-        callableFactory.createUnaryCallable(
-            deleteServiceLevelObjectiveTransportSettings,
-            settings.deleteServiceLevelObjectiveSettings(),
-            clientContext);
 
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  public UnaryCallable deleteServiceCallable() {
+    return deleteServiceCallable;
+  }
+
+  public UnaryCallable
+      deleteServiceLevelObjectiveCallable() {
+    return deleteServiceLevelObjectiveCallable;
+  }
+
   public UnaryCallable createServiceCallable() {
     return createServiceCallable;
   }
@@ -437,10 +446,6 @@ public UnaryCallable updateServiceCallable() {
     return updateServiceCallable;
   }
 
-  public UnaryCallable deleteServiceCallable() {
-    return deleteServiceCallable;
-  }
-
   public UnaryCallable
       createServiceLevelObjectiveCallable() {
     return createServiceLevelObjectiveCallable;
@@ -466,11 +471,6 @@ public UnaryCallable deleteServiceCallable() {
     return updateServiceLevelObjectiveCallable;
   }
 
-  public UnaryCallable
-      deleteServiceLevelObjectiveCallable() {
-    return deleteServiceLevelObjectiveCallable;
-  }
-
   @Override
   public final void close() {
     shutdown();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcUptimeCheckServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcUptimeCheckServiceStub.java
index 01f4f296..27bca5dd 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcUptimeCheckServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/GrpcUptimeCheckServiceStub.java
@@ -54,6 +54,15 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public class GrpcUptimeCheckServiceStub extends UptimeCheckServiceStub {
 
+  private static final MethodDescriptor
+      deleteUptimeCheckConfigMethodDescriptor =
+          MethodDescriptor.newBuilder()
+              .setType(MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName("google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig")
+              .setRequestMarshaller(
+                  ProtoUtils.marshaller(DeleteUptimeCheckConfigRequest.getDefaultInstance()))
+              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+              .build();
   private static final MethodDescriptor<
           ListUptimeCheckConfigsRequest, ListUptimeCheckConfigsResponse>
       listUptimeCheckConfigsMethodDescriptor =
@@ -93,15 +102,6 @@ public class GrpcUptimeCheckServiceStub extends UptimeCheckServiceStub {
                   ProtoUtils.marshaller(UpdateUptimeCheckConfigRequest.getDefaultInstance()))
               .setResponseMarshaller(ProtoUtils.marshaller(UptimeCheckConfig.getDefaultInstance()))
               .build();
-  private static final MethodDescriptor
-      deleteUptimeCheckConfigMethodDescriptor =
-          MethodDescriptor.newBuilder()
-              .setType(MethodDescriptor.MethodType.UNARY)
-              .setFullMethodName("google.monitoring.v3.UptimeCheckService/DeleteUptimeCheckConfig")
-              .setRequestMarshaller(
-                  ProtoUtils.marshaller(DeleteUptimeCheckConfigRequest.getDefaultInstance()))
-              .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
-              .build();
   private static final MethodDescriptor
       listUptimeCheckIpsMethodDescriptor =
           MethodDescriptor.newBuilder()
@@ -115,6 +115,8 @@ public class GrpcUptimeCheckServiceStub extends UptimeCheckServiceStub {
 
   private final BackgroundResource backgroundResources;
 
+  private final UnaryCallable
+      deleteUptimeCheckConfigCallable;
   private final UnaryCallable
       listUptimeCheckConfigsCallable;
   private final UnaryCallable
@@ -125,8 +127,6 @@ public class GrpcUptimeCheckServiceStub extends UptimeCheckServiceStub {
       createUptimeCheckConfigCallable;
   private final UnaryCallable
       updateUptimeCheckConfigCallable;
-  private final UnaryCallable
-      deleteUptimeCheckConfigCallable;
   private final UnaryCallable
       listUptimeCheckIpsCallable;
   private final UnaryCallable
@@ -173,6 +173,20 @@ protected GrpcUptimeCheckServiceStub(
       throws IOException {
     this.callableFactory = callableFactory;
 
+    GrpcCallSettings
+        deleteUptimeCheckConfigTransportSettings =
+            GrpcCallSettings.newBuilder()
+                .setMethodDescriptor(deleteUptimeCheckConfigMethodDescriptor)
+                .setParamsExtractor(
+                    new RequestParamsExtractor() {
+                      @Override
+                      public Map extract(DeleteUptimeCheckConfigRequest request) {
+                        ImmutableMap.Builder params = ImmutableMap.builder();
+                        params.put("name", String.valueOf(request.getName()));
+                        return params.build();
+                      }
+                    })
+                .build();
     GrpcCallSettings
         listUptimeCheckConfigsTransportSettings =
             GrpcCallSettings
@@ -232,26 +246,17 @@ public Map extract(UpdateUptimeCheckConfigRequest request) {
                       }
                     })
                 .build();
-    GrpcCallSettings
-        deleteUptimeCheckConfigTransportSettings =
-            GrpcCallSettings.newBuilder()
-                .setMethodDescriptor(deleteUptimeCheckConfigMethodDescriptor)
-                .setParamsExtractor(
-                    new RequestParamsExtractor() {
-                      @Override
-                      public Map extract(DeleteUptimeCheckConfigRequest request) {
-                        ImmutableMap.Builder params = ImmutableMap.builder();
-                        params.put("name", String.valueOf(request.getName()));
-                        return params.build();
-                      }
-                    })
-                .build();
     GrpcCallSettings
         listUptimeCheckIpsTransportSettings =
             GrpcCallSettings.newBuilder()
                 .setMethodDescriptor(listUptimeCheckIpsMethodDescriptor)
                 .build();
 
+    this.deleteUptimeCheckConfigCallable =
+        callableFactory.createUnaryCallable(
+            deleteUptimeCheckConfigTransportSettings,
+            settings.deleteUptimeCheckConfigSettings(),
+            clientContext);
     this.listUptimeCheckConfigsCallable =
         callableFactory.createUnaryCallable(
             listUptimeCheckConfigsTransportSettings,
@@ -277,11 +282,6 @@ public Map extract(DeleteUptimeCheckConfigRequest request) {
             updateUptimeCheckConfigTransportSettings,
             settings.updateUptimeCheckConfigSettings(),
             clientContext);
-    this.deleteUptimeCheckConfigCallable =
-        callableFactory.createUnaryCallable(
-            deleteUptimeCheckConfigTransportSettings,
-            settings.deleteUptimeCheckConfigSettings(),
-            clientContext);
     this.listUptimeCheckIpsCallable =
         callableFactory.createUnaryCallable(
             listUptimeCheckIpsTransportSettings,
@@ -296,6 +296,10 @@ public Map extract(DeleteUptimeCheckConfigRequest request) {
     backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources());
   }
 
+  public UnaryCallable deleteUptimeCheckConfigCallable() {
+    return deleteUptimeCheckConfigCallable;
+  }
+
   public UnaryCallable
       listUptimeCheckConfigsPagedCallable() {
     return listUptimeCheckConfigsPagedCallable;
@@ -321,10 +325,6 @@ public Map extract(DeleteUptimeCheckConfigRequest request) {
     return updateUptimeCheckConfigCallable;
   }
 
-  public UnaryCallable deleteUptimeCheckConfigCallable() {
-    return deleteUptimeCheckConfigCallable;
-  }
-
   public UnaryCallable
       listUptimeCheckIpsPagedCallable() {
     return listUptimeCheckIpsPagedCallable;
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStub.java
index 3d65e9b8..bb268efe 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStub.java
@@ -49,6 +49,24 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public abstract class NotificationChannelServiceStub implements BackgroundResource {
 
+  public UnaryCallable
+      deleteNotificationChannelCallable() {
+    throw new UnsupportedOperationException("Not implemented: deleteNotificationChannelCallable()");
+  }
+
+  public UnaryCallable<
+          GetNotificationChannelVerificationCodeRequest,
+          GetNotificationChannelVerificationCodeResponse>
+      getNotificationChannelVerificationCodeCallable() {
+    throw new UnsupportedOperationException(
+        "Not implemented: getNotificationChannelVerificationCodeCallable()");
+  }
+
+  public UnaryCallable
+      verifyNotificationChannelCallable() {
+    throw new UnsupportedOperationException("Not implemented: verifyNotificationChannelCallable()");
+  }
+
   public UnaryCallable<
           ListNotificationChannelDescriptorsRequest,
           ListNotificationChannelDescriptorsPagedResponse>
@@ -96,30 +114,12 @@ public abstract class NotificationChannelServiceStub implements BackgroundResour
     throw new UnsupportedOperationException("Not implemented: updateNotificationChannelCallable()");
   }
 
-  public UnaryCallable
-      deleteNotificationChannelCallable() {
-    throw new UnsupportedOperationException("Not implemented: deleteNotificationChannelCallable()");
-  }
-
   public UnaryCallable
       sendNotificationChannelVerificationCodeCallable() {
     throw new UnsupportedOperationException(
         "Not implemented: sendNotificationChannelVerificationCodeCallable()");
   }
 
-  public UnaryCallable<
-          GetNotificationChannelVerificationCodeRequest,
-          GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeCallable() {
-    throw new UnsupportedOperationException(
-        "Not implemented: getNotificationChannelVerificationCodeCallable()");
-  }
-
-  public UnaryCallable
-      verifyNotificationChannelCallable() {
-    throw new UnsupportedOperationException("Not implemented: verifyNotificationChannelCallable()");
-  }
-
   @Override
   public abstract void close();
 }
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStubSettings.java
index 21028cdd..163d5f28 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStubSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/NotificationChannelServiceStubSettings.java
@@ -80,16 +80,16 @@
  * 

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 getNotificationChannelDescriptor to 30 seconds: + *

For example, to set the total timeout of deleteNotificationChannel to 30 seconds: * *

  * 
  * NotificationChannelServiceStubSettings.Builder notificationChannelServiceSettingsBuilder =
  *     NotificationChannelServiceStubSettings.newBuilder();
  * notificationChannelServiceSettingsBuilder
- *     .getNotificationChannelDescriptorSettings()
+ *     .deleteNotificationChannelSettings()
  *     .setRetrySettings(
- *         notificationChannelServiceSettingsBuilder.getNotificationChannelDescriptorSettings().getRetrySettings().toBuilder()
+ *         notificationChannelServiceSettingsBuilder.deleteNotificationChannelSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * NotificationChannelServiceStubSettings notificationChannelServiceSettings = notificationChannelServiceSettingsBuilder.build();
@@ -108,6 +108,14 @@ public class NotificationChannelServiceStubSettings
           .add("https://www.googleapis.com/auth/monitoring.write")
           .build();
 
+  private final UnaryCallSettings
+      deleteNotificationChannelSettings;
+  private final UnaryCallSettings<
+          GetNotificationChannelVerificationCodeRequest,
+          GetNotificationChannelVerificationCodeResponse>
+      getNotificationChannelVerificationCodeSettings;
+  private final UnaryCallSettings
+      verifyNotificationChannelSettings;
   private final PagedCallSettings<
           ListNotificationChannelDescriptorsRequest,
           ListNotificationChannelDescriptorsResponse,
@@ -127,16 +135,30 @@ public class NotificationChannelServiceStubSettings
       createNotificationChannelSettings;
   private final UnaryCallSettings
       updateNotificationChannelSettings;
-  private final UnaryCallSettings
-      deleteNotificationChannelSettings;
   private final UnaryCallSettings
       sendNotificationChannelVerificationCodeSettings;
-  private final UnaryCallSettings<
+
+  /** Returns the object with the settings used for calls to deleteNotificationChannel. */
+  public UnaryCallSettings
+      deleteNotificationChannelSettings() {
+    return deleteNotificationChannelSettings;
+  }
+
+  /**
+   * Returns the object with the settings used for calls to getNotificationChannelVerificationCode.
+   */
+  public UnaryCallSettings<
           GetNotificationChannelVerificationCodeRequest,
           GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeSettings;
-  private final UnaryCallSettings
-      verifyNotificationChannelSettings;
+      getNotificationChannelVerificationCodeSettings() {
+    return getNotificationChannelVerificationCodeSettings;
+  }
+
+  /** Returns the object with the settings used for calls to verifyNotificationChannel. */
+  public UnaryCallSettings
+      verifyNotificationChannelSettings() {
+    return verifyNotificationChannelSettings;
+  }
 
   /** Returns the object with the settings used for calls to listNotificationChannelDescriptors. */
   public PagedCallSettings<
@@ -180,12 +202,6 @@ public class NotificationChannelServiceStubSettings
     return updateNotificationChannelSettings;
   }
 
-  /** Returns the object with the settings used for calls to deleteNotificationChannel. */
-  public UnaryCallSettings
-      deleteNotificationChannelSettings() {
-    return deleteNotificationChannelSettings;
-  }
-
   /**
    * Returns the object with the settings used for calls to sendNotificationChannelVerificationCode.
    */
@@ -194,22 +210,6 @@ public class NotificationChannelServiceStubSettings
     return sendNotificationChannelVerificationCodeSettings;
   }
 
-  /**
-   * Returns the object with the settings used for calls to getNotificationChannelVerificationCode.
-   */
-  public UnaryCallSettings<
-          GetNotificationChannelVerificationCodeRequest,
-          GetNotificationChannelVerificationCodeResponse>
-      getNotificationChannelVerificationCodeSettings() {
-    return getNotificationChannelVerificationCodeSettings;
-  }
-
-  /** Returns the object with the settings used for calls to verifyNotificationChannel. */
-  public UnaryCallSettings
-      verifyNotificationChannelSettings() {
-    return verifyNotificationChannelSettings;
-  }
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public NotificationChannelServiceStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -279,6 +279,10 @@ public Builder toBuilder() {
   protected NotificationChannelServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    deleteNotificationChannelSettings = settingsBuilder.deleteNotificationChannelSettings().build();
+    getNotificationChannelVerificationCodeSettings =
+        settingsBuilder.getNotificationChannelVerificationCodeSettings().build();
+    verifyNotificationChannelSettings = settingsBuilder.verifyNotificationChannelSettings().build();
     listNotificationChannelDescriptorsSettings =
         settingsBuilder.listNotificationChannelDescriptorsSettings().build();
     getNotificationChannelDescriptorSettings =
@@ -287,12 +291,8 @@ protected NotificationChannelServiceStubSettings(Builder settingsBuilder) throws
     getNotificationChannelSettings = settingsBuilder.getNotificationChannelSettings().build();
     createNotificationChannelSettings = settingsBuilder.createNotificationChannelSettings().build();
     updateNotificationChannelSettings = settingsBuilder.updateNotificationChannelSettings().build();
-    deleteNotificationChannelSettings = settingsBuilder.deleteNotificationChannelSettings().build();
     sendNotificationChannelVerificationCodeSettings =
         settingsBuilder.sendNotificationChannelVerificationCodeSettings().build();
-    getNotificationChannelVerificationCodeSettings =
-        settingsBuilder.getNotificationChannelVerificationCodeSettings().build();
-    verifyNotificationChannelSettings = settingsBuilder.verifyNotificationChannelSettings().build();
   }
 
   private static final PagedListDescriptor<
@@ -457,6 +457,14 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        deleteNotificationChannelSettings;
+    private final UnaryCallSettings.Builder<
+            GetNotificationChannelVerificationCodeRequest,
+            GetNotificationChannelVerificationCodeResponse>
+        getNotificationChannelVerificationCodeSettings;
+    private final UnaryCallSettings.Builder
+        verifyNotificationChannelSettings;
     private final PagedCallSettings.Builder<
             ListNotificationChannelDescriptorsRequest,
             ListNotificationChannelDescriptorsResponse,
@@ -476,16 +484,8 @@ public static class Builder
         createNotificationChannelSettings;
     private final UnaryCallSettings.Builder
         updateNotificationChannelSettings;
-    private final UnaryCallSettings.Builder
-        deleteNotificationChannelSettings;
     private final UnaryCallSettings.Builder
         sendNotificationChannelVerificationCodeSettings;
-    private final UnaryCallSettings.Builder<
-            GetNotificationChannelVerificationCodeRequest,
-            GetNotificationChannelVerificationCodeResponse>
-        getNotificationChannelVerificationCodeSettings;
-    private final UnaryCallSettings.Builder
-        verifyNotificationChannelSettings;
 
     private static final ImmutableMap>
         RETRYABLE_CODE_DEFINITIONS;
@@ -528,6 +528,13 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      deleteNotificationChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      getNotificationChannelVerificationCodeSettings =
+          UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      verifyNotificationChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       listNotificationChannelDescriptorsSettings =
           PagedCallSettings.newBuilder(LIST_NOTIFICATION_CHANNEL_DESCRIPTORS_PAGE_STR_FACT);
 
@@ -542,28 +549,21 @@ protected Builder(ClientContext clientContext) {
 
       updateNotificationChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteNotificationChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       sendNotificationChannelVerificationCodeSettings =
           UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      getNotificationChannelVerificationCodeSettings =
-          UnaryCallSettings.newUnaryCallSettingsBuilder();
-
-      verifyNotificationChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteNotificationChannelSettings,
+              getNotificationChannelVerificationCodeSettings,
+              verifyNotificationChannelSettings,
               listNotificationChannelDescriptorsSettings,
               getNotificationChannelDescriptorSettings,
               listNotificationChannelsSettings,
               getNotificationChannelSettings,
               createNotificationChannelSettings,
               updateNotificationChannelSettings,
-              deleteNotificationChannelSettings,
-              sendNotificationChannelVerificationCodeSettings,
-              getNotificationChannelVerificationCodeSettings,
-              verifyNotificationChannelSettings);
+              sendNotificationChannelVerificationCodeSettings);
 
       initDefaults(this);
     }
@@ -580,53 +580,53 @@ private static Builder createDefault() {
     private static Builder initDefaults(Builder builder) {
 
       builder
-          .listNotificationChannelDescriptorsSettings()
+          .deleteNotificationChannelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .getNotificationChannelDescriptorSettings()
+          .getNotificationChannelVerificationCodeSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .listNotificationChannelsSettings()
+          .verifyNotificationChannelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .getNotificationChannelSettings()
+          .listNotificationChannelDescriptorsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .createNotificationChannelSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .getNotificationChannelDescriptorSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .updateNotificationChannelSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
+          .listNotificationChannelsSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .deleteNotificationChannelSettings()
+          .getNotificationChannelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .sendNotificationChannelVerificationCodeSettings()
+          .createNotificationChannelSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .getNotificationChannelVerificationCodeSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .updateNotificationChannelSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       builder
-          .verifyNotificationChannelSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .sendNotificationChannelVerificationCodeSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
       return builder;
@@ -635,6 +635,10 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(NotificationChannelServiceStubSettings settings) {
       super(settings);
 
+      deleteNotificationChannelSettings = settings.deleteNotificationChannelSettings.toBuilder();
+      getNotificationChannelVerificationCodeSettings =
+          settings.getNotificationChannelVerificationCodeSettings.toBuilder();
+      verifyNotificationChannelSettings = settings.verifyNotificationChannelSettings.toBuilder();
       listNotificationChannelDescriptorsSettings =
           settings.listNotificationChannelDescriptorsSettings.toBuilder();
       getNotificationChannelDescriptorSettings =
@@ -643,25 +647,21 @@ protected Builder(NotificationChannelServiceStubSettings settings) {
       getNotificationChannelSettings = settings.getNotificationChannelSettings.toBuilder();
       createNotificationChannelSettings = settings.createNotificationChannelSettings.toBuilder();
       updateNotificationChannelSettings = settings.updateNotificationChannelSettings.toBuilder();
-      deleteNotificationChannelSettings = settings.deleteNotificationChannelSettings.toBuilder();
       sendNotificationChannelVerificationCodeSettings =
           settings.sendNotificationChannelVerificationCodeSettings.toBuilder();
-      getNotificationChannelVerificationCodeSettings =
-          settings.getNotificationChannelVerificationCodeSettings.toBuilder();
-      verifyNotificationChannelSettings = settings.verifyNotificationChannelSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteNotificationChannelSettings,
+              getNotificationChannelVerificationCodeSettings,
+              verifyNotificationChannelSettings,
               listNotificationChannelDescriptorsSettings,
               getNotificationChannelDescriptorSettings,
               listNotificationChannelsSettings,
               getNotificationChannelSettings,
               createNotificationChannelSettings,
               updateNotificationChannelSettings,
-              deleteNotificationChannelSettings,
-              sendNotificationChannelVerificationCodeSettings,
-              getNotificationChannelVerificationCodeSettings,
-              verifyNotificationChannelSettings);
+              sendNotificationChannelVerificationCodeSettings);
     }
 
     // NEXT_MAJOR_VER: remove 'throws Exception'
@@ -680,6 +680,29 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to deleteNotificationChannel. */
+    public UnaryCallSettings.Builder
+        deleteNotificationChannelSettings() {
+      return deleteNotificationChannelSettings;
+    }
+
+    /**
+     * Returns the builder for the settings used for calls to
+     * getNotificationChannelVerificationCode.
+     */
+    public UnaryCallSettings.Builder<
+            GetNotificationChannelVerificationCodeRequest,
+            GetNotificationChannelVerificationCodeResponse>
+        getNotificationChannelVerificationCodeSettings() {
+      return getNotificationChannelVerificationCodeSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to verifyNotificationChannel. */
+    public UnaryCallSettings.Builder
+        verifyNotificationChannelSettings() {
+      return verifyNotificationChannelSettings;
+    }
+
     /**
      * Returns the builder for the settings used for calls to listNotificationChannelDescriptors.
      */
@@ -725,12 +748,6 @@ public Builder applyToAllUnaryMethods(
       return updateNotificationChannelSettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteNotificationChannel. */
-    public UnaryCallSettings.Builder
-        deleteNotificationChannelSettings() {
-      return deleteNotificationChannelSettings;
-    }
-
     /**
      * Returns the builder for the settings used for calls to
      * sendNotificationChannelVerificationCode.
@@ -740,23 +757,6 @@ public Builder applyToAllUnaryMethods(
       return sendNotificationChannelVerificationCodeSettings;
     }
 
-    /**
-     * Returns the builder for the settings used for calls to
-     * getNotificationChannelVerificationCode.
-     */
-    public UnaryCallSettings.Builder<
-            GetNotificationChannelVerificationCodeRequest,
-            GetNotificationChannelVerificationCodeResponse>
-        getNotificationChannelVerificationCodeSettings() {
-      return getNotificationChannelVerificationCodeSettings;
-    }
-
-    /** Returns the builder for the settings used for calls to verifyNotificationChannel. */
-    public UnaryCallSettings.Builder
-        verifyNotificationChannelSettings() {
-      return verifyNotificationChannelSettings;
-    }
-
     @Override
     public NotificationChannelServiceStubSettings build() throws IOException {
       return new NotificationChannelServiceStubSettings(this);
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java
index dbe1fc11..f3fa88c2 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStub.java
@@ -48,6 +48,16 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public abstract class ServiceMonitoringServiceStub implements BackgroundResource {
 
+  public UnaryCallable deleteServiceCallable() {
+    throw new UnsupportedOperationException("Not implemented: deleteServiceCallable()");
+  }
+
+  public UnaryCallable
+      deleteServiceLevelObjectiveCallable() {
+    throw new UnsupportedOperationException(
+        "Not implemented: deleteServiceLevelObjectiveCallable()");
+  }
+
   public UnaryCallable createServiceCallable() {
     throw new UnsupportedOperationException("Not implemented: createServiceCallable()");
   }
@@ -68,10 +78,6 @@ public UnaryCallable updateServiceCallable() {
     throw new UnsupportedOperationException("Not implemented: updateServiceCallable()");
   }
 
-  public UnaryCallable deleteServiceCallable() {
-    throw new UnsupportedOperationException("Not implemented: deleteServiceCallable()");
-  }
-
   public UnaryCallable
       createServiceLevelObjectiveCallable() {
     throw new UnsupportedOperationException(
@@ -101,12 +107,6 @@ public UnaryCallable deleteServiceCallable() {
         "Not implemented: updateServiceLevelObjectiveCallable()");
   }
 
-  public UnaryCallable
-      deleteServiceLevelObjectiveCallable() {
-    throw new UnsupportedOperationException(
-        "Not implemented: deleteServiceLevelObjectiveCallable()");
-  }
-
   @Override
   public abstract void close();
 }
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java
index 238cb4b3..80c570e0 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/ServiceMonitoringServiceStubSettings.java
@@ -79,16 +79,16 @@
  * 

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 createService to 30 seconds: + *

For example, to set the total timeout of deleteService to 30 seconds: * *

  * 
  * ServiceMonitoringServiceStubSettings.Builder serviceMonitoringServiceSettingsBuilder =
  *     ServiceMonitoringServiceStubSettings.newBuilder();
  * serviceMonitoringServiceSettingsBuilder
- *     .createServiceSettings()
+ *     .deleteServiceSettings()
  *     .setRetrySettings(
- *         serviceMonitoringServiceSettingsBuilder.createServiceSettings().getRetrySettings().toBuilder()
+ *         serviceMonitoringServiceSettingsBuilder.deleteServiceSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * ServiceMonitoringServiceStubSettings serviceMonitoringServiceSettings = serviceMonitoringServiceSettingsBuilder.build();
@@ -107,13 +107,15 @@ public class ServiceMonitoringServiceStubSettings
           .add("https://www.googleapis.com/auth/monitoring.write")
           .build();
 
+  private final UnaryCallSettings deleteServiceSettings;
+  private final UnaryCallSettings
+      deleteServiceLevelObjectiveSettings;
   private final UnaryCallSettings createServiceSettings;
   private final UnaryCallSettings getServiceSettings;
   private final PagedCallSettings<
           ListServicesRequest, ListServicesResponse, ListServicesPagedResponse>
       listServicesSettings;
   private final UnaryCallSettings updateServiceSettings;
-  private final UnaryCallSettings deleteServiceSettings;
   private final UnaryCallSettings
       createServiceLevelObjectiveSettings;
   private final UnaryCallSettings
@@ -125,8 +127,17 @@ public class ServiceMonitoringServiceStubSettings
       listServiceLevelObjectivesSettings;
   private final UnaryCallSettings
       updateServiceLevelObjectiveSettings;
-  private final UnaryCallSettings
-      deleteServiceLevelObjectiveSettings;
+
+  /** Returns the object with the settings used for calls to deleteService. */
+  public UnaryCallSettings deleteServiceSettings() {
+    return deleteServiceSettings;
+  }
+
+  /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */
+  public UnaryCallSettings
+      deleteServiceLevelObjectiveSettings() {
+    return deleteServiceLevelObjectiveSettings;
+  }
 
   /** Returns the object with the settings used for calls to createService. */
   public UnaryCallSettings createServiceSettings() {
@@ -149,11 +160,6 @@ public UnaryCallSettings updateServiceSettings()
     return updateServiceSettings;
   }
 
-  /** Returns the object with the settings used for calls to deleteService. */
-  public UnaryCallSettings deleteServiceSettings() {
-    return deleteServiceSettings;
-  }
-
   /** Returns the object with the settings used for calls to createServiceLevelObjective. */
   public UnaryCallSettings
       createServiceLevelObjectiveSettings() {
@@ -181,12 +187,6 @@ public UnaryCallSettings deleteServiceSettings() {
     return updateServiceLevelObjectiveSettings;
   }
 
-  /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */
-  public UnaryCallSettings
-      deleteServiceLevelObjectiveSettings() {
-    return deleteServiceLevelObjectiveSettings;
-  }
-
   @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
   public ServiceMonitoringServiceStub createStub() throws IOException {
     if (getTransportChannelProvider()
@@ -256,11 +256,13 @@ public Builder toBuilder() {
   protected ServiceMonitoringServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    deleteServiceSettings = settingsBuilder.deleteServiceSettings().build();
+    deleteServiceLevelObjectiveSettings =
+        settingsBuilder.deleteServiceLevelObjectiveSettings().build();
     createServiceSettings = settingsBuilder.createServiceSettings().build();
     getServiceSettings = settingsBuilder.getServiceSettings().build();
     listServicesSettings = settingsBuilder.listServicesSettings().build();
     updateServiceSettings = settingsBuilder.updateServiceSettings().build();
-    deleteServiceSettings = settingsBuilder.deleteServiceSettings().build();
     createServiceLevelObjectiveSettings =
         settingsBuilder.createServiceLevelObjectiveSettings().build();
     getServiceLevelObjectiveSettings = settingsBuilder.getServiceLevelObjectiveSettings().build();
@@ -268,8 +270,6 @@ protected ServiceMonitoringServiceStubSettings(Builder settingsBuilder) throws I
         settingsBuilder.listServiceLevelObjectivesSettings().build();
     updateServiceLevelObjectiveSettings =
         settingsBuilder.updateServiceLevelObjectiveSettings().build();
-    deleteServiceLevelObjectiveSettings =
-        settingsBuilder.deleteServiceLevelObjectiveSettings().build();
   }
 
   private static final PagedListDescriptor
@@ -407,13 +407,15 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder deleteServiceSettings;
+    private final UnaryCallSettings.Builder
+        deleteServiceLevelObjectiveSettings;
     private final UnaryCallSettings.Builder createServiceSettings;
     private final UnaryCallSettings.Builder getServiceSettings;
     private final PagedCallSettings.Builder<
             ListServicesRequest, ListServicesResponse, ListServicesPagedResponse>
         listServicesSettings;
     private final UnaryCallSettings.Builder updateServiceSettings;
-    private final UnaryCallSettings.Builder deleteServiceSettings;
     private final UnaryCallSettings.Builder<
             CreateServiceLevelObjectiveRequest, ServiceLevelObjective>
         createServiceLevelObjectiveSettings;
@@ -427,8 +429,6 @@ public static class Builder
     private final UnaryCallSettings.Builder<
             UpdateServiceLevelObjectiveRequest, ServiceLevelObjective>
         updateServiceLevelObjectiveSettings;
-    private final UnaryCallSettings.Builder
-        deleteServiceLevelObjectiveSettings;
 
     private static final ImmutableMap>
         RETRYABLE_CODE_DEFINITIONS;
@@ -471,6 +471,10 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      deleteServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+      deleteServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       createServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -479,8 +483,6 @@ protected Builder(ClientContext clientContext) {
 
       updateServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteServiceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       createServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
       getServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
@@ -490,20 +492,18 @@ protected Builder(ClientContext clientContext) {
 
       updateServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteServiceLevelObjectiveSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteServiceSettings,
+              deleteServiceLevelObjectiveSettings,
               createServiceSettings,
               getServiceSettings,
               listServicesSettings,
               updateServiceSettings,
-              deleteServiceSettings,
               createServiceLevelObjectiveSettings,
               getServiceLevelObjectiveSettings,
               listServiceLevelObjectivesSettings,
-              updateServiceLevelObjectiveSettings,
-              deleteServiceLevelObjectiveSettings);
+              updateServiceLevelObjectiveSettings);
 
       initDefaults(this);
     }
@@ -519,6 +519,16 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .deleteServiceSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
+      builder
+          .deleteServiceLevelObjectiveSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .createServiceSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
@@ -539,11 +549,6 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .deleteServiceSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .createServiceLevelObjectiveSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
@@ -564,43 +569,38 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .deleteServiceLevelObjectiveSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       return builder;
     }
 
     protected Builder(ServiceMonitoringServiceStubSettings settings) {
       super(settings);
 
+      deleteServiceSettings = settings.deleteServiceSettings.toBuilder();
+      deleteServiceLevelObjectiveSettings =
+          settings.deleteServiceLevelObjectiveSettings.toBuilder();
       createServiceSettings = settings.createServiceSettings.toBuilder();
       getServiceSettings = settings.getServiceSettings.toBuilder();
       listServicesSettings = settings.listServicesSettings.toBuilder();
       updateServiceSettings = settings.updateServiceSettings.toBuilder();
-      deleteServiceSettings = settings.deleteServiceSettings.toBuilder();
       createServiceLevelObjectiveSettings =
           settings.createServiceLevelObjectiveSettings.toBuilder();
       getServiceLevelObjectiveSettings = settings.getServiceLevelObjectiveSettings.toBuilder();
       listServiceLevelObjectivesSettings = settings.listServiceLevelObjectivesSettings.toBuilder();
       updateServiceLevelObjectiveSettings =
           settings.updateServiceLevelObjectiveSettings.toBuilder();
-      deleteServiceLevelObjectiveSettings =
-          settings.deleteServiceLevelObjectiveSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteServiceSettings,
+              deleteServiceLevelObjectiveSettings,
               createServiceSettings,
               getServiceSettings,
               listServicesSettings,
               updateServiceSettings,
-              deleteServiceSettings,
               createServiceLevelObjectiveSettings,
               getServiceLevelObjectiveSettings,
               listServiceLevelObjectivesSettings,
-              updateServiceLevelObjectiveSettings,
-              deleteServiceLevelObjectiveSettings);
+              updateServiceLevelObjectiveSettings);
     }
 
     // NEXT_MAJOR_VER: remove 'throws Exception'
@@ -619,6 +619,17 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to deleteService. */
+    public UnaryCallSettings.Builder deleteServiceSettings() {
+      return deleteServiceSettings;
+    }
+
+    /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */
+    public UnaryCallSettings.Builder
+        deleteServiceLevelObjectiveSettings() {
+      return deleteServiceLevelObjectiveSettings;
+    }
+
     /** Returns the builder for the settings used for calls to createService. */
     public UnaryCallSettings.Builder createServiceSettings() {
       return createServiceSettings;
@@ -641,11 +652,6 @@ public UnaryCallSettings.Builder updateServiceSet
       return updateServiceSettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteService. */
-    public UnaryCallSettings.Builder deleteServiceSettings() {
-      return deleteServiceSettings;
-    }
-
     /** Returns the builder for the settings used for calls to createServiceLevelObjective. */
     public UnaryCallSettings.Builder
         createServiceLevelObjectiveSettings() {
@@ -673,12 +679,6 @@ public UnaryCallSettings.Builder deleteServiceSetti
       return updateServiceLevelObjectiveSettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */
-    public UnaryCallSettings.Builder
-        deleteServiceLevelObjectiveSettings() {
-      return deleteServiceLevelObjectiveSettings;
-    }
-
     @Override
     public ServiceMonitoringServiceStubSettings build() throws IOException {
       return new ServiceMonitoringServiceStubSettings(this);
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStub.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStub.java
index fbde4c1b..21ec0f7b 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStub.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStub.java
@@ -43,6 +43,10 @@
 @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
 public abstract class UptimeCheckServiceStub implements BackgroundResource {
 
+  public UnaryCallable deleteUptimeCheckConfigCallable() {
+    throw new UnsupportedOperationException("Not implemented: deleteUptimeCheckConfigCallable()");
+  }
+
   public UnaryCallable
       listUptimeCheckConfigsPagedCallable() {
     throw new UnsupportedOperationException(
@@ -69,10 +73,6 @@ public abstract class UptimeCheckServiceStub implements BackgroundResource {
     throw new UnsupportedOperationException("Not implemented: updateUptimeCheckConfigCallable()");
   }
 
-  public UnaryCallable deleteUptimeCheckConfigCallable() {
-    throw new UnsupportedOperationException("Not implemented: deleteUptimeCheckConfigCallable()");
-  }
-
   public UnaryCallable
       listUptimeCheckIpsPagedCallable() {
     throw new UnsupportedOperationException("Not implemented: listUptimeCheckIpsPagedCallable()");
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStubSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStubSettings.java
index 3dc2e232..369e1aef 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStubSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/stub/UptimeCheckServiceStubSettings.java
@@ -75,16 +75,16 @@
  * 

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 getUptimeCheckConfig to 30 seconds: + *

For example, to set the total timeout of deleteUptimeCheckConfig to 30 seconds: * *

  * 
  * UptimeCheckServiceStubSettings.Builder uptimeCheckServiceSettingsBuilder =
  *     UptimeCheckServiceStubSettings.newBuilder();
  * uptimeCheckServiceSettingsBuilder
- *     .getUptimeCheckConfigSettings()
+ *     .deleteUptimeCheckConfigSettings()
  *     .setRetrySettings(
- *         uptimeCheckServiceSettingsBuilder.getUptimeCheckConfigSettings().getRetrySettings().toBuilder()
+ *         uptimeCheckServiceSettingsBuilder.deleteUptimeCheckConfigSettings().getRetrySettings().toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * UptimeCheckServiceStubSettings uptimeCheckServiceSettings = uptimeCheckServiceSettingsBuilder.build();
@@ -102,6 +102,8 @@ public class UptimeCheckServiceStubSettings extends StubSettings
+      deleteUptimeCheckConfigSettings;
   private final PagedCallSettings<
           ListUptimeCheckConfigsRequest,
           ListUptimeCheckConfigsResponse,
@@ -113,12 +115,16 @@ public class UptimeCheckServiceStubSettings extends StubSettings
       updateUptimeCheckConfigSettings;
-  private final UnaryCallSettings
-      deleteUptimeCheckConfigSettings;
   private final PagedCallSettings<
           ListUptimeCheckIpsRequest, ListUptimeCheckIpsResponse, ListUptimeCheckIpsPagedResponse>
       listUptimeCheckIpsSettings;
 
+  /** Returns the object with the settings used for calls to deleteUptimeCheckConfig. */
+  public UnaryCallSettings
+      deleteUptimeCheckConfigSettings() {
+    return deleteUptimeCheckConfigSettings;
+  }
+
   /** Returns the object with the settings used for calls to listUptimeCheckConfigs. */
   public PagedCallSettings<
           ListUptimeCheckConfigsRequest,
@@ -146,12 +152,6 @@ public class UptimeCheckServiceStubSettings extends StubSettings
-      deleteUptimeCheckConfigSettings() {
-    return deleteUptimeCheckConfigSettings;
-  }
-
   /** Returns the object with the settings used for calls to listUptimeCheckIps. */
   public PagedCallSettings<
           ListUptimeCheckIpsRequest, ListUptimeCheckIpsResponse, ListUptimeCheckIpsPagedResponse>
@@ -228,11 +228,11 @@ public Builder toBuilder() {
   protected UptimeCheckServiceStubSettings(Builder settingsBuilder) throws IOException {
     super(settingsBuilder);
 
+    deleteUptimeCheckConfigSettings = settingsBuilder.deleteUptimeCheckConfigSettings().build();
     listUptimeCheckConfigsSettings = settingsBuilder.listUptimeCheckConfigsSettings().build();
     getUptimeCheckConfigSettings = settingsBuilder.getUptimeCheckConfigSettings().build();
     createUptimeCheckConfigSettings = settingsBuilder.createUptimeCheckConfigSettings().build();
     updateUptimeCheckConfigSettings = settingsBuilder.updateUptimeCheckConfigSettings().build();
-    deleteUptimeCheckConfigSettings = settingsBuilder.deleteUptimeCheckConfigSettings().build();
     listUptimeCheckIpsSettings = settingsBuilder.listUptimeCheckIpsSettings().build();
   }
 
@@ -372,6 +372,8 @@ public static class Builder
       extends StubSettings.Builder {
     private final ImmutableList> unaryMethodSettingsBuilders;
 
+    private final UnaryCallSettings.Builder
+        deleteUptimeCheckConfigSettings;
     private final PagedCallSettings.Builder<
             ListUptimeCheckConfigsRequest,
             ListUptimeCheckConfigsResponse,
@@ -383,8 +385,6 @@ public static class Builder
         createUptimeCheckConfigSettings;
     private final UnaryCallSettings.Builder
         updateUptimeCheckConfigSettings;
-    private final UnaryCallSettings.Builder
-        deleteUptimeCheckConfigSettings;
     private final PagedCallSettings.Builder<
             ListUptimeCheckIpsRequest, ListUptimeCheckIpsResponse, ListUptimeCheckIpsPagedResponse>
         listUptimeCheckIpsSettings;
@@ -430,6 +430,8 @@ protected Builder() {
     protected Builder(ClientContext clientContext) {
       super(clientContext);
 
+      deleteUptimeCheckConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
       listUptimeCheckConfigsSettings =
           PagedCallSettings.newBuilder(LIST_UPTIME_CHECK_CONFIGS_PAGE_STR_FACT);
 
@@ -439,18 +441,16 @@ protected Builder(ClientContext clientContext) {
 
       updateUptimeCheckConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
 
-      deleteUptimeCheckConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
-
       listUptimeCheckIpsSettings =
           PagedCallSettings.newBuilder(LIST_UPTIME_CHECK_IPS_PAGE_STR_FACT);
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteUptimeCheckConfigSettings,
               listUptimeCheckConfigsSettings,
               getUptimeCheckConfigSettings,
               createUptimeCheckConfigSettings,
               updateUptimeCheckConfigSettings,
-              deleteUptimeCheckConfigSettings,
               listUptimeCheckIpsSettings);
 
       initDefaults(this);
@@ -467,6 +467,11 @@ private static Builder createDefault() {
 
     private static Builder initDefaults(Builder builder) {
 
+      builder
+          .deleteUptimeCheckConfigSettings()
+          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
+          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
+
       builder
           .listUptimeCheckConfigsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
@@ -487,11 +492,6 @@ private static Builder initDefaults(Builder builder) {
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent"))
           .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
 
-      builder
-          .deleteUptimeCheckConfigSettings()
-          .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
-          .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default"));
-
       builder
           .listUptimeCheckIpsSettings()
           .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))
@@ -503,20 +503,20 @@ private static Builder initDefaults(Builder builder) {
     protected Builder(UptimeCheckServiceStubSettings settings) {
       super(settings);
 
+      deleteUptimeCheckConfigSettings = settings.deleteUptimeCheckConfigSettings.toBuilder();
       listUptimeCheckConfigsSettings = settings.listUptimeCheckConfigsSettings.toBuilder();
       getUptimeCheckConfigSettings = settings.getUptimeCheckConfigSettings.toBuilder();
       createUptimeCheckConfigSettings = settings.createUptimeCheckConfigSettings.toBuilder();
       updateUptimeCheckConfigSettings = settings.updateUptimeCheckConfigSettings.toBuilder();
-      deleteUptimeCheckConfigSettings = settings.deleteUptimeCheckConfigSettings.toBuilder();
       listUptimeCheckIpsSettings = settings.listUptimeCheckIpsSettings.toBuilder();
 
       unaryMethodSettingsBuilders =
           ImmutableList.>of(
+              deleteUptimeCheckConfigSettings,
               listUptimeCheckConfigsSettings,
               getUptimeCheckConfigSettings,
               createUptimeCheckConfigSettings,
               updateUptimeCheckConfigSettings,
-              deleteUptimeCheckConfigSettings,
               listUptimeCheckIpsSettings);
     }
 
@@ -536,6 +536,12 @@ public Builder applyToAllUnaryMethods(
       return unaryMethodSettingsBuilders;
     }
 
+    /** Returns the builder for the settings used for calls to deleteUptimeCheckConfig. */
+    public UnaryCallSettings.Builder
+        deleteUptimeCheckConfigSettings() {
+      return deleteUptimeCheckConfigSettings;
+    }
+
     /** Returns the builder for the settings used for calls to listUptimeCheckConfigs. */
     public PagedCallSettings.Builder<
             ListUptimeCheckConfigsRequest,
@@ -563,12 +569,6 @@ public Builder applyToAllUnaryMethods(
       return updateUptimeCheckConfigSettings;
     }
 
-    /** Returns the builder for the settings used for calls to deleteUptimeCheckConfig. */
-    public UnaryCallSettings.Builder
-        deleteUptimeCheckConfigSettings() {
-      return deleteUptimeCheckConfigSettings;
-    }
-
     /** Returns the builder for the settings used for calls to listUptimeCheckIps. */
     public PagedCallSettings.Builder<
             ListUptimeCheckIpsRequest, ListUptimeCheckIpsResponse, ListUptimeCheckIpsPagedResponse>
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java
index f09bbdca..d1645c28 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClientTest.java
@@ -24,6 +24,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.monitoring.v3.AlertPolicy;
 import com.google.monitoring.v3.AlertPolicyName;
@@ -42,6 +43,7 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -105,6 +107,44 @@ public void tearDown() throws Exception {
     client.close();
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteAlertPolicyTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockAlertPolicyService.addResponse(expectedResponse);
+
+    AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+
+    client.deleteAlertPolicy(name);
+
+    List actualRequests = mockAlertPolicyService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteAlertPolicyRequest actualRequest = (DeleteAlertPolicyRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, AlertPolicyName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteAlertPolicyExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockAlertPolicyService.addException(exception);
+
+    try {
+      AlertPolicyName name =
+          AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+
+      client.deleteAlertPolicy(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void listAlertPoliciesTest() {
@@ -118,7 +158,7 @@ public void listAlertPoliciesTest() {
             .build();
     mockAlertPolicyService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
 
     ListAlertPoliciesPagedResponse pagedListResponse = client.listAlertPolicies(name);
 
@@ -130,7 +170,7 @@ public void listAlertPoliciesTest() {
     Assert.assertEquals(1, actualRequests.size());
     ListAlertPoliciesRequest actualRequest = (ListAlertPoliciesRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -144,7 +184,7 @@ public void listAlertPoliciesExceptionTest() throws Exception {
     mockAlertPolicyService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
 
       client.listAlertPolicies(name);
       Assert.fail("No exception raised");
@@ -156,13 +196,13 @@ public void listAlertPoliciesExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getAlertPolicyTest() {
-    String name2 = "name2-1052831874";
+    AlertPolicyName name2 = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
     String displayName = "displayName1615086568";
     AlertPolicy expectedResponse =
-        AlertPolicy.newBuilder().setName(name2).setDisplayName(displayName).build();
+        AlertPolicy.newBuilder().setName(name2.toString()).setDisplayName(displayName).build();
     mockAlertPolicyService.addResponse(expectedResponse);
 
-    AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+    AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
 
     AlertPolicy actualResponse = client.getAlertPolicy(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -185,7 +225,8 @@ public void getAlertPolicyExceptionTest() throws Exception {
     mockAlertPolicyService.addException(exception);
 
     try {
-      AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+      AlertPolicyName name =
+          AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
 
       client.getAlertPolicy(name);
       Assert.fail("No exception raised");
@@ -197,13 +238,13 @@ public void getAlertPolicyExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void createAlertPolicyTest() {
-    String name2 = "name2-1052831874";
+    AlertPolicyName name2 = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
     String displayName = "displayName1615086568";
     AlertPolicy expectedResponse =
-        AlertPolicy.newBuilder().setName(name2).setDisplayName(displayName).build();
+        AlertPolicy.newBuilder().setName(name2.toString()).setDisplayName(displayName).build();
     mockAlertPolicyService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
     AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
 
     AlertPolicy actualResponse = client.createAlertPolicy(name, alertPolicy);
@@ -213,7 +254,7 @@ public void createAlertPolicyTest() {
     Assert.assertEquals(1, actualRequests.size());
     CreateAlertPolicyRequest actualRequest = (CreateAlertPolicyRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertEquals(alertPolicy, actualRequest.getAlertPolicy());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -228,7 +269,7 @@ public void createAlertPolicyExceptionTest() throws Exception {
     mockAlertPolicyService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
       AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
 
       client.createAlertPolicy(name, alertPolicy);
@@ -238,50 +279,13 @@ public void createAlertPolicyExceptionTest() throws Exception {
     }
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void deleteAlertPolicyTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockAlertPolicyService.addResponse(expectedResponse);
-
-    AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
-
-    client.deleteAlertPolicy(name);
-
-    List actualRequests = mockAlertPolicyService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteAlertPolicyRequest actualRequest = (DeleteAlertPolicyRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, AlertPolicyName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteAlertPolicyExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockAlertPolicyService.addException(exception);
-
-    try {
-      AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
-
-      client.deleteAlertPolicy(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void updateAlertPolicyTest() {
-    String name = "name3373707";
+    AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
     String displayName = "displayName1615086568";
     AlertPolicy expectedResponse =
-        AlertPolicy.newBuilder().setName(name).setDisplayName(displayName).build();
+        AlertPolicy.newBuilder().setName(name.toString()).setDisplayName(displayName).build();
     mockAlertPolicyService.addResponse(expectedResponse);
 
     FieldMask updateMask = FieldMask.newBuilder().build();
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java
index 2fb45fd9..8ce0d25f 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/GroupServiceClientTest.java
@@ -26,6 +26,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.monitoring.v3.CreateGroupRequest;
 import com.google.monitoring.v3.DeleteGroupRequest;
@@ -45,6 +46,7 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -110,27 +112,32 @@ public void tearDown() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void listGroupsTest() {
-    String nextPageToken = "";
-    Group groupElement = Group.newBuilder().build();
-    List group = Arrays.asList(groupElement);
-    ListGroupsResponse expectedResponse =
-        ListGroupsResponse.newBuilder().setNextPageToken(nextPageToken).addAllGroup(group).build();
+  public void updateGroupTest() {
+    GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+    String displayName = "displayName1615086568";
+    String parentName = "parentName1015022848";
+    String filter = "filter-1274492040";
+    boolean isCluster = false;
+    Group expectedResponse =
+        Group.newBuilder()
+            .setName(name.toString())
+            .setDisplayName(displayName)
+            .setParentName(parentName)
+            .setFilter(filter)
+            .setIsCluster(isCluster)
+            .build();
     mockGroupService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
-
-    ListGroupsPagedResponse pagedListResponse = client.listGroups(name);
+    Group group = Group.newBuilder().build();
 
-    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
-    Assert.assertEquals(1, resources.size());
-    Assert.assertEquals(expectedResponse.getGroupList().get(0), resources.get(0));
+    Group actualResponse = client.updateGroup(group);
+    Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockGroupService.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    ListGroupsRequest actualRequest = (ListGroupsRequest) actualRequests.get(0);
+    UpdateGroupRequest actualRequest = (UpdateGroupRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(group, actualRequest.getGroup());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -139,14 +146,14 @@ public void listGroupsTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void listGroupsExceptionTest() throws Exception {
+  public void updateGroupExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockGroupService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      Group group = Group.newBuilder().build();
 
-      client.listGroups(name);
+      client.updateGroup(group);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -155,30 +162,17 @@ public void listGroupsExceptionTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void getGroupTest() {
-    GroupName name2 = GroupName.of("[PROJECT]", "[GROUP]");
-    String displayName = "displayName1615086568";
-    GroupName parentName = GroupName.of("[PROJECT]", "[GROUP]");
-    String filter = "filter-1274492040";
-    boolean isCluster = false;
-    Group expectedResponse =
-        Group.newBuilder()
-            .setName(name2.toString())
-            .setDisplayName(displayName)
-            .setParentName(parentName.toString())
-            .setFilter(filter)
-            .setIsCluster(isCluster)
-            .build();
+  public void deleteGroupTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
     mockGroupService.addResponse(expectedResponse);
 
-    GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+    GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
 
-    Group actualResponse = client.getGroup(name);
-    Assert.assertEquals(expectedResponse, actualResponse);
+    client.deleteGroup(name);
 
     List actualRequests = mockGroupService.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    GetGroupRequest actualRequest = (GetGroupRequest) actualRequests.get(0);
+    DeleteGroupRequest actualRequest = (DeleteGroupRequest) actualRequests.get(0);
 
     Assert.assertEquals(name, GroupName.parse(actualRequest.getName()));
     Assert.assertTrue(
@@ -189,14 +183,14 @@ public void getGroupTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void getGroupExceptionTest() throws Exception {
+  public void deleteGroupExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockGroupService.addException(exception);
 
     try {
-      GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+      GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
 
-      client.getGroup(name);
+      client.deleteGroup(name);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -205,34 +199,27 @@ public void getGroupExceptionTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void createGroupTest() {
-    GroupName name2 = GroupName.of("[PROJECT]", "[GROUP]");
-    String displayName = "displayName1615086568";
-    GroupName parentName = GroupName.of("[PROJECT]", "[GROUP]");
-    String filter = "filter-1274492040";
-    boolean isCluster = false;
-    Group expectedResponse =
-        Group.newBuilder()
-            .setName(name2.toString())
-            .setDisplayName(displayName)
-            .setParentName(parentName.toString())
-            .setFilter(filter)
-            .setIsCluster(isCluster)
-            .build();
+  public void listGroupsTest() {
+    String nextPageToken = "";
+    Group groupElement = Group.newBuilder().build();
+    List group = Arrays.asList(groupElement);
+    ListGroupsResponse expectedResponse =
+        ListGroupsResponse.newBuilder().setNextPageToken(nextPageToken).addAllGroup(group).build();
     mockGroupService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
-    Group group = Group.newBuilder().build();
+    ResourceName name = ProjectName.of("[PROJECT]");
 
-    Group actualResponse = client.createGroup(name, group);
-    Assert.assertEquals(expectedResponse, actualResponse);
+    ListGroupsPagedResponse pagedListResponse = client.listGroups(name);
+
+    List resources = Lists.newArrayList(pagedListResponse.iterateAll());
+    Assert.assertEquals(1, resources.size());
+    Assert.assertEquals(expectedResponse.getGroupList().get(0), resources.get(0));
 
     List actualRequests = mockGroupService.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    CreateGroupRequest actualRequest = (CreateGroupRequest) actualRequests.get(0);
+    ListGroupsRequest actualRequest = (ListGroupsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
-    Assert.assertEquals(group, actualRequest.getGroup());
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -241,15 +228,14 @@ public void createGroupTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void createGroupExceptionTest() throws Exception {
+  public void listGroupsExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockGroupService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
-      Group group = Group.newBuilder().build();
+      ResourceName name = ProjectName.of("[PROJECT]");
 
-      client.createGroup(name, group);
+      client.listGroups(name);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -258,32 +244,32 @@ public void createGroupExceptionTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void updateGroupTest() {
-    GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+  public void getGroupTest() {
+    GroupName name2 = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
     String displayName = "displayName1615086568";
-    GroupName parentName = GroupName.of("[PROJECT]", "[GROUP]");
+    String parentName = "parentName1015022848";
     String filter = "filter-1274492040";
     boolean isCluster = false;
     Group expectedResponse =
         Group.newBuilder()
-            .setName(name.toString())
+            .setName(name2.toString())
             .setDisplayName(displayName)
-            .setParentName(parentName.toString())
+            .setParentName(parentName)
             .setFilter(filter)
             .setIsCluster(isCluster)
             .build();
     mockGroupService.addResponse(expectedResponse);
 
-    Group group = Group.newBuilder().build();
+    GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
 
-    Group actualResponse = client.updateGroup(group);
+    Group actualResponse = client.getGroup(name);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockGroupService.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    UpdateGroupRequest actualRequest = (UpdateGroupRequest) actualRequests.get(0);
+    GetGroupRequest actualRequest = (GetGroupRequest) actualRequests.get(0);
 
-    Assert.assertEquals(group, actualRequest.getGroup());
+    Assert.assertEquals(name, GroupName.parse(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -292,14 +278,14 @@ public void updateGroupTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void updateGroupExceptionTest() throws Exception {
+  public void getGroupExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockGroupService.addException(exception);
 
     try {
-      Group group = Group.newBuilder().build();
+      GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
 
-      client.updateGroup(group);
+      client.getGroup(name);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -308,19 +294,34 @@ public void updateGroupExceptionTest() throws Exception {
 
   @Test
   @SuppressWarnings("all")
-  public void deleteGroupTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
+  public void createGroupTest() {
+    GroupName name2 = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+    String displayName = "displayName1615086568";
+    String parentName = "parentName1015022848";
+    String filter = "filter-1274492040";
+    boolean isCluster = false;
+    Group expectedResponse =
+        Group.newBuilder()
+            .setName(name2.toString())
+            .setDisplayName(displayName)
+            .setParentName(parentName)
+            .setFilter(filter)
+            .setIsCluster(isCluster)
+            .build();
     mockGroupService.addResponse(expectedResponse);
 
-    GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+    ResourceName name = ProjectName.of("[PROJECT]");
+    Group group = Group.newBuilder().build();
 
-    client.deleteGroup(name);
+    Group actualResponse = client.createGroup(name, group);
+    Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockGroupService.getRequests();
     Assert.assertEquals(1, actualRequests.size());
-    DeleteGroupRequest actualRequest = (DeleteGroupRequest) actualRequests.get(0);
+    CreateGroupRequest actualRequest = (CreateGroupRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, GroupName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
+    Assert.assertEquals(group, actualRequest.getGroup());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -329,14 +330,15 @@ public void deleteGroupTest() {
 
   @Test
   @SuppressWarnings("all")
-  public void deleteGroupExceptionTest() throws Exception {
+  public void createGroupExceptionTest() throws Exception {
     StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
     mockGroupService.addException(exception);
 
     try {
-      GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+      ResourceName name = ProjectName.of("[PROJECT]");
+      Group group = Group.newBuilder().build();
 
-      client.deleteGroup(name);
+      client.createGroup(name, group);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -358,7 +360,7 @@ public void listGroupMembersTest() {
             .build();
     mockGroupService.addResponse(expectedResponse);
 
-    GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+    GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
 
     ListGroupMembersPagedResponse pagedListResponse = client.listGroupMembers(name);
 
@@ -384,7 +386,7 @@ public void listGroupMembersExceptionTest() throws Exception {
     mockGroupService.addException(exception);
 
     try {
-      GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+      GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
 
       client.listGroupMembers(name);
       Assert.fail("No exception raised");
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java
index 04e69068..d1d3b6b2 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceClientTest.java
@@ -28,6 +28,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.monitoring.v3.CreateMetricDescriptorRequest;
 import com.google.monitoring.v3.CreateTimeSeriesRequest;
@@ -53,6 +54,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -131,7 +133,7 @@ public void listMonitoredResourceDescriptorsTest() {
             .build();
     mockMetricService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
 
     ListMonitoredResourceDescriptorsPagedResponse pagedListResponse =
         client.listMonitoredResourceDescriptors(name);
@@ -146,7 +148,7 @@ public void listMonitoredResourceDescriptorsTest() {
     ListMonitoredResourceDescriptorsRequest actualRequest =
         (ListMonitoredResourceDescriptorsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -160,7 +162,7 @@ public void listMonitoredResourceDescriptorsExceptionTest() throws Exception {
     mockMetricService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
 
       client.listMonitoredResourceDescriptors(name);
       Assert.fail("No exception raised");
@@ -186,7 +188,8 @@ public void getMonitoredResourceDescriptorTest() {
     mockMetricService.addResponse(expectedResponse);
 
     MonitoredResourceDescriptorName name =
-        MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+        MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+            "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
 
     MonitoredResourceDescriptor actualResponse = client.getMonitoredResourceDescriptor(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -211,7 +214,8 @@ public void getMonitoredResourceDescriptorExceptionTest() throws Exception {
 
     try {
       MonitoredResourceDescriptorName name =
-          MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+          MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+              "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
 
       client.getMonitoredResourceDescriptor(name);
       Assert.fail("No exception raised");
@@ -233,7 +237,7 @@ public void listMetricDescriptorsTest() {
             .build();
     mockMetricService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
 
     ListMetricDescriptorsPagedResponse pagedListResponse = client.listMetricDescriptors(name);
 
@@ -246,7 +250,7 @@ public void listMetricDescriptorsTest() {
     ListMetricDescriptorsRequest actualRequest =
         (ListMetricDescriptorsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -260,7 +264,7 @@ public void listMetricDescriptorsExceptionTest() throws Exception {
     mockMetricService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
 
       client.listMetricDescriptors(name);
       Assert.fail("No exception raised");
@@ -287,7 +291,8 @@ public void getMetricDescriptorTest() {
             .build();
     mockMetricService.addResponse(expectedResponse);
 
-    MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+    MetricDescriptorName name =
+        MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
 
     MetricDescriptor actualResponse = client.getMetricDescriptor(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -310,7 +315,8 @@ public void getMetricDescriptorExceptionTest() throws Exception {
     mockMetricService.addException(exception);
 
     try {
-      MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+      MetricDescriptorName name =
+          MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
 
       client.getMetricDescriptor(name);
       Assert.fail("No exception raised");
@@ -337,7 +343,7 @@ public void createMetricDescriptorTest() {
             .build();
     mockMetricService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
     MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
 
     MetricDescriptor actualResponse = client.createMetricDescriptor(name, metricDescriptor);
@@ -348,7 +354,7 @@ public void createMetricDescriptorTest() {
     CreateMetricDescriptorRequest actualRequest =
         (CreateMetricDescriptorRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertEquals(metricDescriptor, actualRequest.getMetricDescriptor());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -363,7 +369,7 @@ public void createMetricDescriptorExceptionTest() throws Exception {
     mockMetricService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
       MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
 
       client.createMetricDescriptor(name, metricDescriptor);
@@ -379,7 +385,8 @@ public void deleteMetricDescriptorTest() {
     Empty expectedResponse = Empty.newBuilder().build();
     mockMetricService.addResponse(expectedResponse);
 
-    MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+    MetricDescriptorName name =
+        MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
 
     client.deleteMetricDescriptor(name);
 
@@ -402,7 +409,8 @@ public void deleteMetricDescriptorExceptionTest() throws Exception {
     mockMetricService.addException(exception);
 
     try {
-      MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+      MetricDescriptorName name =
+          MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
 
       client.deleteMetricDescriptor(name);
       Assert.fail("No exception raised");
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceSmokeTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceSmokeTest.java
index 3b8e9bc6..d3c0719c 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceSmokeTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/MetricServiceSmokeTest.java
@@ -17,6 +17,7 @@
 
 import static com.google.cloud.monitoring.v3.MetricServiceClient.ListMonitoredResourceDescriptorsPagedResponse;
 
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.base.Preconditions;
 import com.google.monitoring.v3.ProjectName;
 import java.util.logging.Level;
@@ -47,7 +48,7 @@ public static void main(String args[]) {
 
   public static void executeNoCatch(String projectId) throws Exception {
     try (MetricServiceClient client = MetricServiceClient.create()) {
-      ProjectName name = ProjectName.of(projectId);
+      ResourceName name = ProjectName.of(projectId);
 
       ListMonitoredResourceDescriptorsPagedResponse pagedResponse =
           client.listMonitoredResourceDescriptors(name);
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java
index 7468aa62..5db50ef7 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClientTest.java
@@ -25,6 +25,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.monitoring.v3.CreateNotificationChannelRequest;
 import com.google.monitoring.v3.DeleteNotificationChannelRequest;
@@ -52,6 +53,7 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -115,6 +117,155 @@ public void tearDown() throws Exception {
     client.close();
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteNotificationChannelTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockNotificationChannelService.addResponse(expectedResponse);
+
+    NotificationChannelName name =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+    boolean force = false;
+
+    client.deleteNotificationChannel(name, force);
+
+    List actualRequests = mockNotificationChannelService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteNotificationChannelRequest actualRequest =
+        (DeleteNotificationChannelRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName()));
+    Assert.assertEquals(force, actualRequest.getForce());
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteNotificationChannelExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockNotificationChannelService.addException(exception);
+
+    try {
+      NotificationChannelName name =
+          NotificationChannelName.ofProjectNotificationChannelName(
+              "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+      boolean force = false;
+
+      client.deleteNotificationChannel(name, force);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void getNotificationChannelVerificationCodeTest() {
+    String code = "code3059181";
+    GetNotificationChannelVerificationCodeResponse expectedResponse =
+        GetNotificationChannelVerificationCodeResponse.newBuilder().setCode(code).build();
+    mockNotificationChannelService.addResponse(expectedResponse);
+
+    NotificationChannelName name =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+
+    GetNotificationChannelVerificationCodeResponse actualResponse =
+        client.getNotificationChannelVerificationCode(name);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockNotificationChannelService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    GetNotificationChannelVerificationCodeRequest actualRequest =
+        (GetNotificationChannelVerificationCodeRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void getNotificationChannelVerificationCodeExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockNotificationChannelService.addException(exception);
+
+    try {
+      NotificationChannelName name =
+          NotificationChannelName.ofProjectNotificationChannelName(
+              "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+
+      client.getNotificationChannelVerificationCode(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void verifyNotificationChannelTest() {
+    String type = "type3575610";
+    NotificationChannelName name2 =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+    String displayName = "displayName1615086568";
+    String description = "description-1724546052";
+    NotificationChannel expectedResponse =
+        NotificationChannel.newBuilder()
+            .setType(type)
+            .setName(name2.toString())
+            .setDisplayName(displayName)
+            .setDescription(description)
+            .build();
+    mockNotificationChannelService.addResponse(expectedResponse);
+
+    NotificationChannelName name =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+    String code = "code3059181";
+
+    NotificationChannel actualResponse = client.verifyNotificationChannel(name, code);
+    Assert.assertEquals(expectedResponse, actualResponse);
+
+    List actualRequests = mockNotificationChannelService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    VerifyNotificationChannelRequest actualRequest =
+        (VerifyNotificationChannelRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName()));
+    Assert.assertEquals(code, actualRequest.getCode());
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void verifyNotificationChannelExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockNotificationChannelService.addException(exception);
+
+    try {
+      NotificationChannelName name =
+          NotificationChannelName.ofProjectNotificationChannelName(
+              "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+      String code = "code3059181";
+
+      client.verifyNotificationChannel(name, code);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void listNotificationChannelDescriptorsTest() {
@@ -130,7 +281,7 @@ public void listNotificationChannelDescriptorsTest() {
             .build();
     mockNotificationChannelService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
 
     ListNotificationChannelDescriptorsPagedResponse pagedListResponse =
         client.listNotificationChannelDescriptors(name);
@@ -145,7 +296,7 @@ public void listNotificationChannelDescriptorsTest() {
     ListNotificationChannelDescriptorsRequest actualRequest =
         (ListNotificationChannelDescriptorsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -159,7 +310,7 @@ public void listNotificationChannelDescriptorsExceptionTest() throws Exception {
     mockNotificationChannelService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
 
       client.listNotificationChannelDescriptors(name);
       Assert.fail("No exception raised");
@@ -171,13 +322,15 @@ public void listNotificationChannelDescriptorsExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getNotificationChannelDescriptorTest() {
-    String name2 = "name2-1052831874";
+    NotificationChannelDescriptorName name2 =
+        NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+            "[PROJECT]", "[CHANNEL_DESCRIPTOR]");
     String type = "type3575610";
     String displayName = "displayName1615086568";
     String description = "description-1724546052";
     NotificationChannelDescriptor expectedResponse =
         NotificationChannelDescriptor.newBuilder()
-            .setName(name2)
+            .setName(name2.toString())
             .setType(type)
             .setDisplayName(displayName)
             .setDescription(description)
@@ -185,7 +338,8 @@ public void getNotificationChannelDescriptorTest() {
     mockNotificationChannelService.addResponse(expectedResponse);
 
     NotificationChannelDescriptorName name =
-        NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+        NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+            "[PROJECT]", "[CHANNEL_DESCRIPTOR]");
 
     NotificationChannelDescriptor actualResponse = client.getNotificationChannelDescriptor(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -210,7 +364,8 @@ public void getNotificationChannelDescriptorExceptionTest() throws Exception {
 
     try {
       NotificationChannelDescriptorName name =
-          NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+          NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+              "[PROJECT]", "[CHANNEL_DESCRIPTOR]");
 
       client.getNotificationChannelDescriptor(name);
       Assert.fail("No exception raised");
@@ -232,7 +387,7 @@ public void listNotificationChannelsTest() {
             .build();
     mockNotificationChannelService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
 
     ListNotificationChannelsPagedResponse pagedListResponse = client.listNotificationChannels(name);
 
@@ -245,7 +400,7 @@ public void listNotificationChannelsTest() {
     ListNotificationChannelsRequest actualRequest =
         (ListNotificationChannelsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -259,7 +414,7 @@ public void listNotificationChannelsExceptionTest() throws Exception {
     mockNotificationChannelService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
 
       client.listNotificationChannels(name);
       Assert.fail("No exception raised");
@@ -272,20 +427,23 @@ public void listNotificationChannelsExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void getNotificationChannelTest() {
     String type = "type3575610";
-    String name2 = "name2-1052831874";
+    NotificationChannelName name2 =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
     String displayName = "displayName1615086568";
     String description = "description-1724546052";
     NotificationChannel expectedResponse =
         NotificationChannel.newBuilder()
             .setType(type)
-            .setName(name2)
+            .setName(name2.toString())
             .setDisplayName(displayName)
             .setDescription(description)
             .build();
     mockNotificationChannelService.addResponse(expectedResponse);
 
     NotificationChannelName name =
-        NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
 
     NotificationChannel actualResponse = client.getNotificationChannel(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -310,7 +468,8 @@ public void getNotificationChannelExceptionTest() throws Exception {
 
     try {
       NotificationChannelName name =
-          NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+          NotificationChannelName.ofProjectNotificationChannelName(
+              "[PROJECT]", "[NOTIFICATION_CHANNEL]");
 
       client.getNotificationChannel(name);
       Assert.fail("No exception raised");
@@ -323,19 +482,21 @@ public void getNotificationChannelExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void createNotificationChannelTest() {
     String type = "type3575610";
-    String name2 = "name2-1052831874";
+    NotificationChannelName name2 =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
     String displayName = "displayName1615086568";
     String description = "description-1724546052";
     NotificationChannel expectedResponse =
         NotificationChannel.newBuilder()
             .setType(type)
-            .setName(name2)
+            .setName(name2.toString())
             .setDisplayName(displayName)
             .setDescription(description)
             .build();
     mockNotificationChannelService.addResponse(expectedResponse);
 
-    ProjectName name = ProjectName.of("[PROJECT]");
+    ResourceName name = ProjectName.of("[PROJECT]");
     NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
 
     NotificationChannel actualResponse =
@@ -347,7 +508,7 @@ public void createNotificationChannelTest() {
     CreateNotificationChannelRequest actualRequest =
         (CreateNotificationChannelRequest) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectName.parse(actualRequest.getName()));
+    Assert.assertEquals(Objects.toString(name), Objects.toString(actualRequest.getName()));
     Assert.assertEquals(notificationChannel, actualRequest.getNotificationChannel());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -362,7 +523,7 @@ public void createNotificationChannelExceptionTest() throws Exception {
     mockNotificationChannelService.addException(exception);
 
     try {
-      ProjectName name = ProjectName.of("[PROJECT]");
+      ResourceName name = ProjectName.of("[PROJECT]");
       NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
 
       client.createNotificationChannel(name, notificationChannel);
@@ -376,13 +537,15 @@ public void createNotificationChannelExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void updateNotificationChannelTest() {
     String type = "type3575610";
-    String name = "name3373707";
+    NotificationChannelName name =
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
     String displayName = "displayName1615086568";
     String description = "description-1724546052";
     NotificationChannel expectedResponse =
         NotificationChannel.newBuilder()
             .setType(type)
-            .setName(name)
+            .setName(name.toString())
             .setDisplayName(displayName)
             .setDescription(description)
             .build();
@@ -425,49 +588,6 @@ public void updateNotificationChannelExceptionTest() throws Exception {
     }
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void deleteNotificationChannelTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockNotificationChannelService.addResponse(expectedResponse);
-
-    NotificationChannelName name =
-        NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-    boolean force = false;
-
-    client.deleteNotificationChannel(name, force);
-
-    List actualRequests = mockNotificationChannelService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteNotificationChannelRequest actualRequest =
-        (DeleteNotificationChannelRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName()));
-    Assert.assertEquals(force, actualRequest.getForce());
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteNotificationChannelExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockNotificationChannelService.addException(exception);
-
-    try {
-      NotificationChannelName name =
-          NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-      boolean force = false;
-
-      client.deleteNotificationChannel(name, force);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void sendNotificationChannelVerificationCodeTest() {
@@ -475,7 +595,8 @@ public void sendNotificationChannelVerificationCodeTest() {
     mockNotificationChannelService.addResponse(expectedResponse);
 
     NotificationChannelName name =
-        NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+        NotificationChannelName.ofProjectNotificationChannelName(
+            "[PROJECT]", "[NOTIFICATION_CHANNEL]");
 
     client.sendNotificationChannelVerificationCode(name);
 
@@ -499,7 +620,8 @@ public void sendNotificationChannelVerificationCodeExceptionTest() throws Except
 
     try {
       NotificationChannelName name =
-          NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+          NotificationChannelName.ofProjectNotificationChannelName(
+              "[PROJECT]", "[NOTIFICATION_CHANNEL]");
 
       client.sendNotificationChannelVerificationCode(name);
       Assert.fail("No exception raised");
@@ -507,102 +629,4 @@ public void sendNotificationChannelVerificationCodeExceptionTest() throws Except
       // Expected exception
     }
   }
-
-  @Test
-  @SuppressWarnings("all")
-  public void getNotificationChannelVerificationCodeTest() {
-    String code = "code3059181";
-    GetNotificationChannelVerificationCodeResponse expectedResponse =
-        GetNotificationChannelVerificationCodeResponse.newBuilder().setCode(code).build();
-    mockNotificationChannelService.addResponse(expectedResponse);
-
-    NotificationChannelName name =
-        NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-
-    GetNotificationChannelVerificationCodeResponse actualResponse =
-        client.getNotificationChannelVerificationCode(name);
-    Assert.assertEquals(expectedResponse, actualResponse);
-
-    List actualRequests = mockNotificationChannelService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    GetNotificationChannelVerificationCodeRequest actualRequest =
-        (GetNotificationChannelVerificationCodeRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void getNotificationChannelVerificationCodeExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockNotificationChannelService.addException(exception);
-
-    try {
-      NotificationChannelName name =
-          NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-
-      client.getNotificationChannelVerificationCode(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void verifyNotificationChannelTest() {
-    String type = "type3575610";
-    String name2 = "name2-1052831874";
-    String displayName = "displayName1615086568";
-    String description = "description-1724546052";
-    NotificationChannel expectedResponse =
-        NotificationChannel.newBuilder()
-            .setType(type)
-            .setName(name2)
-            .setDisplayName(displayName)
-            .setDescription(description)
-            .build();
-    mockNotificationChannelService.addResponse(expectedResponse);
-
-    NotificationChannelName name =
-        NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-    String code = "code3059181";
-
-    NotificationChannel actualResponse = client.verifyNotificationChannel(name, code);
-    Assert.assertEquals(expectedResponse, actualResponse);
-
-    List actualRequests = mockNotificationChannelService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    VerifyNotificationChannelRequest actualRequest =
-        (VerifyNotificationChannelRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, NotificationChannelName.parse(actualRequest.getName()));
-    Assert.assertEquals(code, actualRequest.getCode());
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void verifyNotificationChannelExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockNotificationChannelService.addException(exception);
-
-    try {
-      NotificationChannelName name =
-          NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
-      String code = "code3059181";
-
-      client.verifyNotificationChannel(name, code);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
 }
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java
index dfa60c36..e2604711 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClientTest.java
@@ -25,6 +25,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.monitoring.v3.CreateServiceLevelObjectiveRequest;
 import com.google.monitoring.v3.CreateServiceRequest;
@@ -50,6 +51,7 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -113,16 +115,95 @@ public void tearDown() throws Exception {
     client.close();
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteServiceTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockServiceMonitoringService.addResponse(expectedResponse);
+
+    ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+
+    client.deleteService(name);
+
+    List actualRequests = mockServiceMonitoringService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteServiceRequest actualRequest = (DeleteServiceRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ServiceName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteServiceExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockServiceMonitoringService.addException(exception);
+
+    try {
+      ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+
+      client.deleteService(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteServiceLevelObjectiveTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockServiceMonitoringService.addResponse(expectedResponse);
+
+    ServiceLevelObjectiveName name =
+        ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+            "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+
+    client.deleteServiceLevelObjective(name);
+
+    List actualRequests = mockServiceMonitoringService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteServiceLevelObjectiveRequest actualRequest =
+        (DeleteServiceLevelObjectiveRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, ServiceLevelObjectiveName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteServiceLevelObjectiveExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockServiceMonitoringService.addException(exception);
+
+    try {
+      ServiceLevelObjectiveName name =
+          ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+              "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+
+      client.deleteServiceLevelObjective(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void createServiceTest() {
-    ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+    ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
     String displayName = "displayName1615086568";
     Service expectedResponse =
         Service.newBuilder().setName(name.toString()).setDisplayName(displayName).build();
     mockServiceMonitoringService.addResponse(expectedResponse);
 
-    ProjectName parent = ProjectName.of("[PROJECT]");
+    ResourceName parent = ProjectName.of("[PROJECT]");
     Service service = Service.newBuilder().build();
 
     Service actualResponse = client.createService(parent, service);
@@ -132,7 +213,7 @@ public void createServiceTest() {
     Assert.assertEquals(1, actualRequests.size());
     CreateServiceRequest actualRequest = (CreateServiceRequest) actualRequests.get(0);
 
-    Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent()));
+    Assert.assertEquals(Objects.toString(parent), Objects.toString(actualRequest.getParent()));
     Assert.assertEquals(service, actualRequest.getService());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -147,7 +228,7 @@ public void createServiceExceptionTest() throws Exception {
     mockServiceMonitoringService.addException(exception);
 
     try {
-      ProjectName parent = ProjectName.of("[PROJECT]");
+      ResourceName parent = ProjectName.of("[PROJECT]");
       Service service = Service.newBuilder().build();
 
       client.createService(parent, service);
@@ -160,13 +241,13 @@ public void createServiceExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getServiceTest() {
-    ServiceName name2 = ServiceName.of("[PROJECT]", "[SERVICE]");
+    ServiceName name2 = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
     String displayName = "displayName1615086568";
     Service expectedResponse =
         Service.newBuilder().setName(name2.toString()).setDisplayName(displayName).build();
     mockServiceMonitoringService.addResponse(expectedResponse);
 
-    ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+    ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
 
     Service actualResponse = client.getService(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -189,7 +270,7 @@ public void getServiceExceptionTest() throws Exception {
     mockServiceMonitoringService.addException(exception);
 
     try {
-      ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+      ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
 
       client.getService(name);
       Assert.fail("No exception raised");
@@ -211,7 +292,7 @@ public void listServicesTest() {
             .build();
     mockServiceMonitoringService.addResponse(expectedResponse);
 
-    ProjectName parent = ProjectName.of("[PROJECT]");
+    ResourceName parent = ProjectName.of("[PROJECT]");
 
     ListServicesPagedResponse pagedListResponse = client.listServices(parent);
 
@@ -223,7 +304,7 @@ public void listServicesTest() {
     Assert.assertEquals(1, actualRequests.size());
     ListServicesRequest actualRequest = (ListServicesRequest) actualRequests.get(0);
 
-    Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent()));
+    Assert.assertEquals(Objects.toString(parent), Objects.toString(actualRequest.getParent()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -237,7 +318,7 @@ public void listServicesExceptionTest() throws Exception {
     mockServiceMonitoringService.addException(exception);
 
     try {
-      ProjectName parent = ProjectName.of("[PROJECT]");
+      ResourceName parent = ProjectName.of("[PROJECT]");
 
       client.listServices(parent);
       Assert.fail("No exception raised");
@@ -249,7 +330,7 @@ public void listServicesExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void updateServiceTest() {
-    ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+    ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
     String displayName = "displayName1615086568";
     Service expectedResponse =
         Service.newBuilder().setName(name.toString()).setDisplayName(displayName).build();
@@ -287,48 +368,12 @@ public void updateServiceExceptionTest() throws Exception {
     }
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void deleteServiceTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockServiceMonitoringService.addResponse(expectedResponse);
-
-    ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
-
-    client.deleteService(name);
-
-    List actualRequests = mockServiceMonitoringService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteServiceRequest actualRequest = (DeleteServiceRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ServiceName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteServiceExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockServiceMonitoringService.addException(exception);
-
-    try {
-      ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
-
-      client.deleteService(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void createServiceLevelObjectiveTest() {
     ServiceLevelObjectiveName name =
-        ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+        ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+            "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
     String displayName = "displayName1615086568";
     double goal = 317825.0;
     ServiceLevelObjective expectedResponse =
@@ -339,7 +384,7 @@ public void createServiceLevelObjectiveTest() {
             .build();
     mockServiceMonitoringService.addResponse(expectedResponse);
 
-    ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+    ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
     ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
 
     ServiceLevelObjective actualResponse =
@@ -366,7 +411,7 @@ public void createServiceLevelObjectiveExceptionTest() throws Exception {
     mockServiceMonitoringService.addException(exception);
 
     try {
-      ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+      ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
       ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
 
       client.createServiceLevelObjective(parent, serviceLevelObjective);
@@ -380,7 +425,8 @@ public void createServiceLevelObjectiveExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void getServiceLevelObjectiveTest() {
     ServiceLevelObjectiveName name2 =
-        ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+        ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+            "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
     String displayName = "displayName1615086568";
     double goal = 317825.0;
     ServiceLevelObjective expectedResponse =
@@ -392,7 +438,8 @@ public void getServiceLevelObjectiveTest() {
     mockServiceMonitoringService.addResponse(expectedResponse);
 
     ServiceLevelObjectiveName name =
-        ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+        ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+            "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
 
     ServiceLevelObjective actualResponse = client.getServiceLevelObjective(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -417,7 +464,8 @@ public void getServiceLevelObjectiveExceptionTest() throws Exception {
 
     try {
       ServiceLevelObjectiveName name =
-          ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+          ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+              "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
 
       client.getServiceLevelObjective(name);
       Assert.fail("No exception raised");
@@ -441,7 +489,7 @@ public void listServiceLevelObjectivesTest() {
             .build();
     mockServiceMonitoringService.addResponse(expectedResponse);
 
-    ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+    ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
 
     ListServiceLevelObjectivesPagedResponse pagedListResponse =
         client.listServiceLevelObjectives(parent);
@@ -469,7 +517,7 @@ public void listServiceLevelObjectivesExceptionTest() throws Exception {
     mockServiceMonitoringService.addException(exception);
 
     try {
-      ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+      ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
 
       client.listServiceLevelObjectives(parent);
       Assert.fail("No exception raised");
@@ -482,7 +530,8 @@ public void listServiceLevelObjectivesExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void updateServiceLevelObjectiveTest() {
     ServiceLevelObjectiveName name =
-        ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+        ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+            "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
     String displayName = "displayName1615086568";
     double goal = 317825.0;
     ServiceLevelObjective expectedResponse =
@@ -526,44 +575,4 @@ public void updateServiceLevelObjectiveExceptionTest() throws Exception {
       // Expected exception
     }
   }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteServiceLevelObjectiveTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockServiceMonitoringService.addResponse(expectedResponse);
-
-    ServiceLevelObjectiveName name =
-        ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
-
-    client.deleteServiceLevelObjective(name);
-
-    List actualRequests = mockServiceMonitoringService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteServiceLevelObjectiveRequest actualRequest =
-        (DeleteServiceLevelObjectiveRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, ServiceLevelObjectiveName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteServiceLevelObjectiveExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockServiceMonitoringService.addException(exception);
-
-    try {
-      ServiceLevelObjectiveName name =
-          ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
-
-      client.deleteServiceLevelObjective(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
 }
diff --git a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java
index 2b122335..f84fc19d 100644
--- a/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java
+++ b/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java
@@ -25,6 +25,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.monitoring.v3.CreateUptimeCheckConfigRequest;
 import com.google.monitoring.v3.DeleteUptimeCheckConfigRequest;
@@ -45,6 +46,7 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -108,6 +110,47 @@ public void tearDown() throws Exception {
     client.close();
   }
 
+  @Test
+  @SuppressWarnings("all")
+  public void deleteUptimeCheckConfigTest() {
+    Empty expectedResponse = Empty.newBuilder().build();
+    mockUptimeCheckService.addResponse(expectedResponse);
+
+    UptimeCheckConfigName name =
+        UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+
+    client.deleteUptimeCheckConfig(name);
+
+    List actualRequests = mockUptimeCheckService.getRequests();
+    Assert.assertEquals(1, actualRequests.size());
+    DeleteUptimeCheckConfigRequest actualRequest =
+        (DeleteUptimeCheckConfigRequest) actualRequests.get(0);
+
+    Assert.assertEquals(name, UptimeCheckConfigName.parse(actualRequest.getName()));
+    Assert.assertTrue(
+        channelProvider.isHeaderSent(
+            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
+            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
+  }
+
+  @Test
+  @SuppressWarnings("all")
+  public void deleteUptimeCheckConfigExceptionTest() throws Exception {
+    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
+    mockUptimeCheckService.addException(exception);
+
+    try {
+      UptimeCheckConfigName name =
+          UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+              "[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+
+      client.deleteUptimeCheckConfig(name);
+      Assert.fail("No exception raised");
+    } catch (InvalidArgumentException e) {
+      // Expected exception
+    }
+  }
+
   @Test
   @SuppressWarnings("all")
   public void listUptimeCheckConfigsTest() {
@@ -123,10 +166,9 @@ public void listUptimeCheckConfigsTest() {
             .build();
     mockUptimeCheckService.addResponse(expectedResponse);
 
-    String formattedParent = ProjectName.format("[PROJECT]");
+    ResourceName parent = ProjectName.of("[PROJECT]");
 
-    ListUptimeCheckConfigsPagedResponse pagedListResponse =
-        client.listUptimeCheckConfigs(formattedParent);
+    ListUptimeCheckConfigsPagedResponse pagedListResponse = client.listUptimeCheckConfigs(parent);
 
     List resources = Lists.newArrayList(pagedListResponse.iterateAll());
     Assert.assertEquals(1, resources.size());
@@ -137,7 +179,7 @@ public void listUptimeCheckConfigsTest() {
     ListUptimeCheckConfigsRequest actualRequest =
         (ListUptimeCheckConfigsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedParent, actualRequest.getParent());
+    Assert.assertEquals(Objects.toString(parent), Objects.toString(actualRequest.getParent()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -151,9 +193,9 @@ public void listUptimeCheckConfigsExceptionTest() throws Exception {
     mockUptimeCheckService.addException(exception);
 
     try {
-      String formattedParent = ProjectName.format("[PROJECT]");
+      ResourceName parent = ProjectName.of("[PROJECT]");
 
-      client.listUptimeCheckConfigs(formattedParent);
+      client.listUptimeCheckConfigs(parent);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -163,18 +205,20 @@ public void listUptimeCheckConfigsExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getUptimeCheckConfigTest() {
-    String name2 = "name2-1052831874";
+    UptimeCheckConfigName name2 =
+        UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
     String displayName = "displayName1615086568";
     boolean isInternal = true;
     UptimeCheckConfig expectedResponse =
         UptimeCheckConfig.newBuilder()
-            .setName(name2)
+            .setName(name2.toString())
             .setDisplayName(displayName)
             .setIsInternal(isInternal)
             .build();
     mockUptimeCheckService.addResponse(expectedResponse);
 
-    UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+    UptimeCheckConfigName name =
+        UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
 
     UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -197,7 +241,9 @@ public void getUptimeCheckConfigExceptionTest() throws Exception {
     mockUptimeCheckService.addException(exception);
 
     try {
-      UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+      UptimeCheckConfigName name =
+          UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+              "[PROJECT]", "[UPTIME_CHECK_CONFIG]");
 
       client.getUptimeCheckConfig(name);
       Assert.fail("No exception raised");
@@ -209,22 +255,22 @@ public void getUptimeCheckConfigExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void createUptimeCheckConfigTest() {
-    String name = "name3373707";
+    UptimeCheckConfigName name =
+        UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
     String displayName = "displayName1615086568";
     boolean isInternal = true;
     UptimeCheckConfig expectedResponse =
         UptimeCheckConfig.newBuilder()
-            .setName(name)
+            .setName(name.toString())
             .setDisplayName(displayName)
             .setIsInternal(isInternal)
             .build();
     mockUptimeCheckService.addResponse(expectedResponse);
 
-    String formattedParent = ProjectName.format("[PROJECT]");
+    ResourceName parent = ProjectName.of("[PROJECT]");
     UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
 
-    UptimeCheckConfig actualResponse =
-        client.createUptimeCheckConfig(formattedParent, uptimeCheckConfig);
+    UptimeCheckConfig actualResponse = client.createUptimeCheckConfig(parent, uptimeCheckConfig);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockUptimeCheckService.getRequests();
@@ -232,7 +278,7 @@ public void createUptimeCheckConfigTest() {
     CreateUptimeCheckConfigRequest actualRequest =
         (CreateUptimeCheckConfigRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedParent, actualRequest.getParent());
+    Assert.assertEquals(Objects.toString(parent), Objects.toString(actualRequest.getParent()));
     Assert.assertEquals(uptimeCheckConfig, actualRequest.getUptimeCheckConfig());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -247,10 +293,10 @@ public void createUptimeCheckConfigExceptionTest() throws Exception {
     mockUptimeCheckService.addException(exception);
 
     try {
-      String formattedParent = ProjectName.format("[PROJECT]");
+      ResourceName parent = ProjectName.of("[PROJECT]");
       UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
 
-      client.createUptimeCheckConfig(formattedParent, uptimeCheckConfig);
+      client.createUptimeCheckConfig(parent, uptimeCheckConfig);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -260,12 +306,13 @@ public void createUptimeCheckConfigExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void updateUptimeCheckConfigTest() {
-    String name = "name3373707";
+    UptimeCheckConfigName name =
+        UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
     String displayName = "displayName1615086568";
     boolean isInternal = true;
     UptimeCheckConfig expectedResponse =
         UptimeCheckConfig.newBuilder()
-            .setName(name)
+            .setName(name.toString())
             .setDisplayName(displayName)
             .setIsInternal(isInternal)
             .build();
@@ -304,44 +351,6 @@ public void updateUptimeCheckConfigExceptionTest() throws Exception {
     }
   }
 
-  @Test
-  @SuppressWarnings("all")
-  public void deleteUptimeCheckConfigTest() {
-    Empty expectedResponse = Empty.newBuilder().build();
-    mockUptimeCheckService.addResponse(expectedResponse);
-
-    UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-
-    client.deleteUptimeCheckConfig(name);
-
-    List actualRequests = mockUptimeCheckService.getRequests();
-    Assert.assertEquals(1, actualRequests.size());
-    DeleteUptimeCheckConfigRequest actualRequest =
-        (DeleteUptimeCheckConfigRequest) actualRequests.get(0);
-
-    Assert.assertEquals(name, UptimeCheckConfigName.parse(actualRequest.getName()));
-    Assert.assertTrue(
-        channelProvider.isHeaderSent(
-            ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
-            GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
-  }
-
-  @Test
-  @SuppressWarnings("all")
-  public void deleteUptimeCheckConfigExceptionTest() throws Exception {
-    StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
-    mockUptimeCheckService.addException(exception);
-
-    try {
-      UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-
-      client.deleteUptimeCheckConfig(name);
-      Assert.fail("No exception raised");
-    } catch (InvalidArgumentException e) {
-      // Expected exception
-    }
-  }
-
   @Test
   @SuppressWarnings("all")
   public void listUptimeCheckIpsTest() {
diff --git a/pom.xml b/pom.xml
index af5b18aa..47ac02d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -253,13 +253,4 @@
       
     
   
-
-  
-    
-      enable-samples
-      
-        samples
-      
-    
-  
 
\ No newline at end of file
diff --git a/proto-google-cloud-monitoring-v3/clirr-ignored-differences.xml b/proto-google-cloud-monitoring-v3/clirr-ignored-differences.xml
index 95972285..3e4b4f89 100644
--- a/proto-google-cloud-monitoring-v3/clirr-ignored-differences.xml
+++ b/proto-google-cloud-monitoring-v3/clirr-ignored-differences.xml
@@ -16,4 +16,25 @@
     com/google/monitoring/v3/*OrBuilder
     boolean has*(*)
   
+
+  
+  
+    6001
+    com/google/monitoring/v3/AlertPolicy$Condition$ConditionCase
+    CONDITION_TIME_SERIES_QUERY_LANGUAGE
+  
+  
+    6011
+    com/google/monitoring/v3/AlertPolicy$Condition
+    CONDITION_TIME_SERIES_QUERY_LANGUAGE_FIELD_NUMBER
+  
+  
+    7002
+    com/google/monitoring/v3/AlertPolicy$Condition*
+    * *ConditionTimeSeriesQueryLanguage*(*)
+  
+  
+    8001
+    com/google/monitoring/v3/AlertPolicy$Condition$TimeSeriesQueryLanguageCondition*
+  
 
diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java
index 2a536565..d3878751 100644
--- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java
+++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java
@@ -1529,55 +1529,6 @@ public interface ConditionOrBuilder
     com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsenceOrBuilder
         getConditionAbsentOrBuilder();
 
-    /**
-     *
-     *
-     * 
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * If set, no other conditions can be present.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - * - * @return Whether the conditionTimeSeriesQueryLanguage field is set. - */ - boolean hasConditionTimeSeriesQueryLanguage(); - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * If set, no other conditions can be present.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - * - * @return The conditionTimeSeriesQueryLanguage. - */ - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - getConditionTimeSeriesQueryLanguage(); - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * If set, no other conditions can be present.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageConditionOrBuilder - getConditionTimeSeriesQueryLanguageOrBuilder(); - public com.google.monitoring.v3.AlertPolicy.Condition.ConditionCase getConditionCase(); } /** @@ -1691,33 +1642,6 @@ private Condition( name_ = s; break; } - case 114: - { - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .Builder - subBuilder = null; - if (conditionCase_ == 14) { - subBuilder = - ((com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageCondition) - condition_) - .toBuilder(); - } - condition_ = - input.readMessage( - com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageCondition.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageCondition) - condition_); - condition_ = subBuilder.buildPartial(); - } - conditionCase_ = 14; - break; - } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -8521,1104 +8445,188 @@ public com.google.protobuf.Parser getParserForType() { } } - public interface TimeSeriesQueryLanguageConditionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - com.google.protobuf.MessageOrBuilder { + private int conditionCase_ = 0; + private java.lang.Object condition_; - /** - * - * - *
-       * Monitoring Query Language query that generates time series data and
-       * describes a condition for alerting on that data.
-       * 
- * - * string query = 1; - * - * @return The query. - */ - java.lang.String getQuery(); - /** - * - * - *
-       * Monitoring Query Language query that generates time series data and
-       * describes a condition for alerting on that data.
-       * 
- * - * string query = 1; - * - * @return The bytes for query. - */ - com.google.protobuf.ByteString getQueryBytes(); + public enum ConditionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONDITION_THRESHOLD(1), + CONDITION_ABSENT(2), + CONDITION_NOT_SET(0); + private final int value; + private ConditionCase(int value) { + this.value = value; + } /** - * - * - *
-       * A short explanation of what the query represents. For example:
-       *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-       * 
- * - * string summary = 2; - * - * @return The summary. - */ - java.lang.String getSummary(); - /** - * - * - *
-       * A short explanation of what the query represents. For example:
-       *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-       * 
- * - * string summary = 2; - * - * @return The bytes for summary. + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. */ - com.google.protobuf.ByteString getSummaryBytes(); + @java.lang.Deprecated + public static ConditionCase valueOf(int value) { + return forNumber(value); + } + + public static ConditionCase forNumber(int value) { + switch (value) { + case 1: + return CONDITION_THRESHOLD; + case 2: + return CONDITION_ABSENT; + case 0: + return CONDITION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConditionCase getConditionCase() { + return ConditionCase.forNumber(conditionCase_); } + + public static final int NAME_FIELD_NUMBER = 12; + private volatile java.lang.Object name_; /** * * *
-     * A condition type that allows alert policies to be defined using
-     * Monitoring Query Language.
+     * Required if the condition exists. The unique resource name for this
+     * condition. Its format is:
+     *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+     * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the
+     * condition is created as part of a new or updated alerting policy.
+     * When calling the
+     * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+     * method, do not include the `name` field in the conditions of the
+     * requested alerting policy. Stackdriver Monitoring creates the
+     * condition identifiers and includes them in the new policy.
+     * When calling the
+     * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+     * method to update a policy, including a condition `name` causes the
+     * existing condition to be updated. Conditions without names are added to
+     * the updated policy. Existing conditions are deleted if they are not
+     * updated.
+     * Best practice is to preserve `[CONDITION_ID]` if you make only small
+     * changes, such as those to condition thresholds, durations, or trigger
+     * values.  Otherwise, treat the change as a new condition and let the
+     * existing condition be deleted.
      * 
* - * Protobuf type {@code - * google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition} + * string name = 12; + * + * @return The name. */ - public static final class TimeSeriesQueryLanguageCondition - extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - TimeSeriesQueryLanguageConditionOrBuilder { - private static final long serialVersionUID = 0L; - // Use TimeSeriesQueryLanguageCondition.newBuilder() to construct. - private TimeSeriesQueryLanguageCondition( - com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; } - - private TimeSeriesQueryLanguageCondition() { - query_ = ""; - summary_ = ""; + } + /** + * + * + *
+     * Required if the condition exists. The unique resource name for this
+     * condition. Its format is:
+     *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
+     * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the
+     * condition is created as part of a new or updated alerting policy.
+     * When calling the
+     * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
+     * method, do not include the `name` field in the conditions of the
+     * requested alerting policy. Stackdriver Monitoring creates the
+     * condition identifiers and includes them in the new policy.
+     * When calling the
+     * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
+     * method to update a policy, including a condition `name` causes the
+     * existing condition to be updated. Conditions without names are added to
+     * the updated policy. Existing conditions are deleted if they are not
+     * updated.
+     * Best practice is to preserve `[CONDITION_ID]` if you make only small
+     * changes, such as those to condition thresholds, durations, or trigger
+     * values.  Otherwise, treat the change as a new condition and let the
+     * existing condition be deleted.
+     * 
+ * + * string name = 12; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new TimeSeriesQueryLanguageCondition(); + public static final int DISPLAY_NAME_FIELD_NUMBER = 6; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * A short name or phrase used to identify the condition in dashboards,
+     * notifications, and incidents. To avoid confusion, don't use the same
+     * display name for multiple conditions in the same policy.
+     * 
+ * + * string display_name = 6; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + } + /** + * + * + *
+     * A short name or phrase used to identify the condition in dashboards,
+     * notifications, and incidents. To avoid confusion, don't use the same
+     * display name for multiple conditions in the same policy.
+     * 
+ * + * string display_name = 6; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - - private TimeSeriesQueryLanguageCondition( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - query_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - summary_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .class, - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .Builder.class); - } - - public static final int QUERY_FIELD_NUMBER = 1; - private volatile java.lang.Object query_; - /** - * - * - *
-       * Monitoring Query Language query that generates time series data and
-       * describes a condition for alerting on that data.
-       * 
- * - * string query = 1; - * - * @return The query. - */ - public java.lang.String getQuery() { - java.lang.Object ref = query_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - query_ = s; - return s; - } - } - /** - * - * - *
-       * Monitoring Query Language query that generates time series data and
-       * describes a condition for alerting on that data.
-       * 
- * - * string query = 1; - * - * @return The bytes for query. - */ - public com.google.protobuf.ByteString getQueryBytes() { - java.lang.Object ref = query_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - query_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int SUMMARY_FIELD_NUMBER = 2; - private volatile java.lang.Object summary_; - /** - * - * - *
-       * A short explanation of what the query represents. For example:
-       *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-       * 
- * - * string summary = 2; - * - * @return The summary. - */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summary_ = s; - return s; - } - } - /** - * - * - *
-       * A short explanation of what the query represents. For example:
-       *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-       * 
- * - * string summary = 2; - * - * @return The bytes for summary. - */ - public com.google.protobuf.ByteString getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getQueryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, query_); - } - if (!getSummaryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, summary_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getQueryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, query_); - } - if (!getSummaryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, summary_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition)) { - return super.equals(obj); - } - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition other = - (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) obj; - - if (!getQuery().equals(other.getQuery())) return false; - if (!getSummary().equals(other.getSummary())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + QUERY_FIELD_NUMBER; - hash = (53 * hash) + getQuery().hashCode(); - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-       * A condition type that allows alert policies to be defined using
-       * Monitoring Query Language.
-       * 
- * - * Protobuf type {@code - * google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageConditionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .class, - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .Builder.class); - } - - // Construct using - // com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } - - @java.lang.Override - public Builder clear() { - super.clear(); - query_ = ""; - - summary_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.monitoring.v3.AlertProto - .internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_descriptor; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - getDefaultInstanceForType() { - return com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - build() { - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - buildPartial() { - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition result = - new com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition( - this); - result.query_ = query_; - result.summary_ = summary_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) { - return mergeFrom( - (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition other) { - if (other - == com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance()) return this; - if (!other.getQuery().isEmpty()) { - query_ = other.query_; - onChanged(); - } - if (!other.getSummary().isEmpty()) { - summary_ = other.summary_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object query_ = ""; - /** - * - * - *
-         * Monitoring Query Language query that generates time series data and
-         * describes a condition for alerting on that data.
-         * 
- * - * string query = 1; - * - * @return The query. - */ - public java.lang.String getQuery() { - java.lang.Object ref = query_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - query_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * Monitoring Query Language query that generates time series data and
-         * describes a condition for alerting on that data.
-         * 
- * - * string query = 1; - * - * @return The bytes for query. - */ - public com.google.protobuf.ByteString getQueryBytes() { - java.lang.Object ref = query_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - query_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * Monitoring Query Language query that generates time series data and
-         * describes a condition for alerting on that data.
-         * 
- * - * string query = 1; - * - * @param value The query to set. - * @return This builder for chaining. - */ - public Builder setQuery(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - query_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * Monitoring Query Language query that generates time series data and
-         * describes a condition for alerting on that data.
-         * 
- * - * string query = 1; - * - * @return This builder for chaining. - */ - public Builder clearQuery() { - - query_ = getDefaultInstance().getQuery(); - onChanged(); - return this; - } - /** - * - * - *
-         * Monitoring Query Language query that generates time series data and
-         * describes a condition for alerting on that data.
-         * 
- * - * string query = 1; - * - * @param value The bytes for query to set. - * @return This builder for chaining. - */ - public Builder setQueryBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - query_ = value; - onChanged(); - return this; - } - - private java.lang.Object summary_ = ""; - /** - * - * - *
-         * A short explanation of what the query represents. For example:
-         *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-         * 
- * - * string summary = 2; - * - * @return The summary. - */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summary_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * A short explanation of what the query represents. For example:
-         *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-         * 
- * - * string summary = 2; - * - * @return The bytes for summary. - */ - public com.google.protobuf.ByteString getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * A short explanation of what the query represents. For example:
-         *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-         * 
- * - * string summary = 2; - * - * @param value The summary to set. - * @return This builder for chaining. - */ - public Builder setSummary(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - summary_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * A short explanation of what the query represents. For example:
-         *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-         * 
- * - * string summary = 2; - * - * @return This builder for chaining. - */ - public Builder clearSummary() { - - summary_ = getDefaultInstance().getSummary(); - onChanged(); - return this; - } - /** - * - * - *
-         * A short explanation of what the query represents. For example:
-         *   "Error ratio exceeds 15% for >5% of servers in >2 regions"
-         * 
- * - * string summary = 2; - * - * @param value The bytes for summary to set. - * @return This builder for chaining. - */ - public Builder setSummaryBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - summary_ = value; - onChanged(); - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - } - - // @@protoc_insertion_point(class_scope:google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - private static final com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageCondition - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition(); - } - - public static com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TimeSeriesQueryLanguageCondition parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TimeSeriesQueryLanguageCondition(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - private int conditionCase_ = 0; - private java.lang.Object condition_; - - public enum ConditionCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONDITION_THRESHOLD(1), - CONDITION_ABSENT(2), - CONDITION_TIME_SERIES_QUERY_LANGUAGE(14), - CONDITION_NOT_SET(0); - private final int value; - - private ConditionCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ConditionCase valueOf(int value) { - return forNumber(value); - } - - public static ConditionCase forNumber(int value) { - switch (value) { - case 1: - return CONDITION_THRESHOLD; - case 2: - return CONDITION_ABSENT; - case 14: - return CONDITION_TIME_SERIES_QUERY_LANGUAGE; - case 0: - return CONDITION_NOT_SET; - default: - return null; - } - } - - public int getNumber() { - return this.value; - } - }; - - public ConditionCase getConditionCase() { - return ConditionCase.forNumber(conditionCase_); - } - - public static final int NAME_FIELD_NUMBER = 12; - private volatile java.lang.Object name_; - /** - * - * - *
-     * Required if the condition exists. The unique resource name for this
-     * condition. Its format is:
-     *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
-     * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the
-     * condition is created as part of a new or updated alerting policy.
-     * When calling the
-     * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
-     * method, do not include the `name` field in the conditions of the
-     * requested alerting policy. Stackdriver Monitoring creates the
-     * condition identifiers and includes them in the new policy.
-     * When calling the
-     * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
-     * method to update a policy, including a condition `name` causes the
-     * existing condition to be updated. Conditions without names are added to
-     * the updated policy. Existing conditions are deleted if they are not
-     * updated.
-     * Best practice is to preserve `[CONDITION_ID]` if you make only small
-     * changes, such as those to condition thresholds, durations, or trigger
-     * values.  Otherwise, treat the change as a new condition and let the
-     * existing condition be deleted.
-     * 
- * - * string name = 12; - * - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * - * - *
-     * Required if the condition exists. The unique resource name for this
-     * condition. Its format is:
-     *     projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
-     * `[CONDITION_ID]` is assigned by Stackdriver Monitoring when the
-     * condition is created as part of a new or updated alerting policy.
-     * When calling the
-     * [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy]
-     * method, do not include the `name` field in the conditions of the
-     * requested alerting policy. Stackdriver Monitoring creates the
-     * condition identifiers and includes them in the new policy.
-     * When calling the
-     * [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy]
-     * method to update a policy, including a condition `name` causes the
-     * existing condition to be updated. Conditions without names are added to
-     * the updated policy. Existing conditions are deleted if they are not
-     * updated.
-     * Best practice is to preserve `[CONDITION_ID]` if you make only small
-     * changes, such as those to condition thresholds, durations, or trigger
-     * values.  Otherwise, treat the change as a new condition and let the
-     * existing condition be deleted.
-     * 
- * - * string name = 12; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int DISPLAY_NAME_FIELD_NUMBER = 6; - private volatile java.lang.Object displayName_; - /** - * - * - *
-     * A short name or phrase used to identify the condition in dashboards,
-     * notifications, and incidents. To avoid confusion, don't use the same
-     * display name for multiple conditions in the same policy.
-     * 
- * - * string display_name = 6; - * - * @return The displayName. - */ - public java.lang.String getDisplayName() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - displayName_ = s; - return s; - } - } - /** - * - * - *
-     * A short name or phrase used to identify the condition in dashboards,
-     * notifications, and incidents. To avoid confusion, don't use the same
-     * display name for multiple conditions in the same policy.
-     * 
- * - * string display_name = 6; - * - * @return The bytes for displayName. - */ - public com.google.protobuf.ByteString getDisplayNameBytes() { - java.lang.Object ref = displayName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - displayName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } + } public static final int CONDITION_THRESHOLD_FIELD_NUMBER = 1; /** @@ -9724,72 +8732,6 @@ public com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence getCondition return com.google.monitoring.v3.AlertPolicy.Condition.MetricAbsence.getDefaultInstance(); } - public static final int CONDITION_TIME_SERIES_QUERY_LANGUAGE_FIELD_NUMBER = 14; - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * If set, no other conditions can be present.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - * - * @return Whether the conditionTimeSeriesQueryLanguage field is set. - */ - public boolean hasConditionTimeSeriesQueryLanguage() { - return conditionCase_ == 14; - } - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * If set, no other conditions can be present.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - * - * @return The conditionTimeSeriesQueryLanguage. - */ - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - getConditionTimeSeriesQueryLanguage() { - if (conditionCase_ == 14) { - return (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } - /** - * - * - *
-     * A condition that uses the Monitoring Query Language to define
-     * alerts.
-     * If set, no other conditions can be present.
-     * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageConditionOrBuilder - getConditionTimeSeriesQueryLanguageOrBuilder() { - if (conditionCase_ == 14) { - return (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } - private byte memoizedIsInitialized = -1; @java.lang.Override @@ -9818,12 +8760,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 12, name_); } - if (conditionCase_ == 14) { - output.writeMessage( - 14, - (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_); - } unknownFields.writeTo(output); } @@ -9849,13 +8785,6 @@ public int getSerializedSize() { if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, name_); } - if (conditionCase_ == 14) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 14, - (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_); - } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -9882,10 +8811,6 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getConditionAbsent().equals(other.getConditionAbsent())) return false; break; - case 14: - if (!getConditionTimeSeriesQueryLanguage() - .equals(other.getConditionTimeSeriesQueryLanguage())) return false; - break; case 0: default: } @@ -9913,10 +8838,6 @@ public int hashCode() { hash = (37 * hash) + CONDITION_ABSENT_FIELD_NUMBER; hash = (53 * hash) + getConditionAbsent().hashCode(); break; - case 14: - hash = (37 * hash) + CONDITION_TIME_SERIES_QUERY_LANGUAGE_FIELD_NUMBER; - hash = (53 * hash) + getConditionTimeSeriesQueryLanguage().hashCode(); - break; case 0: default: } @@ -10118,13 +9039,6 @@ public com.google.monitoring.v3.AlertPolicy.Condition buildPartial() { result.condition_ = conditionAbsentBuilder_.build(); } } - if (conditionCase_ == 14) { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - result.condition_ = condition_; - } else { - result.condition_ = conditionTimeSeriesQueryLanguageBuilder_.build(); - } - } result.conditionCase_ = conditionCase_; onBuilt(); return result; @@ -10197,11 +9111,6 @@ public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy.Condition other) { mergeConditionAbsent(other.getConditionAbsent()); break; } - case CONDITION_TIME_SERIES_QUERY_LANGUAGE: - { - mergeConditionTimeSeriesQueryLanguage(other.getConditionTimeSeriesQueryLanguage()); - break; - } case CONDITION_NOT_SET: { break; @@ -11024,274 +9933,6 @@ public Builder clearConditionAbsent() { return conditionAbsentBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition, - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .Builder, - com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageConditionOrBuilder> - conditionTimeSeriesQueryLanguageBuilder_; - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - * - * @return Whether the conditionTimeSeriesQueryLanguage field is set. - */ - public boolean hasConditionTimeSeriesQueryLanguage() { - return conditionCase_ == 14; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - * - * @return The conditionTimeSeriesQueryLanguage. - */ - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - getConditionTimeSeriesQueryLanguage() { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - if (conditionCase_ == 14) { - return (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } else { - if (conditionCase_ == 14) { - return conditionTimeSeriesQueryLanguageBuilder_.getMessage(); - } - return com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public Builder setConditionTimeSeriesQueryLanguage( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition value) { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - condition_ = value; - onChanged(); - } else { - conditionTimeSeriesQueryLanguageBuilder_.setMessage(value); - } - conditionCase_ = 14; - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public Builder setConditionTimeSeriesQueryLanguage( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition.Builder - builderForValue) { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - condition_ = builderForValue.build(); - onChanged(); - } else { - conditionTimeSeriesQueryLanguageBuilder_.setMessage(builderForValue.build()); - } - conditionCase_ = 14; - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public Builder mergeConditionTimeSeriesQueryLanguage( - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition value) { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - if (conditionCase_ == 14 - && condition_ - != com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance()) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .newBuilder( - (com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageCondition) - condition_) - .mergeFrom(value) - .buildPartial(); - } else { - condition_ = value; - } - onChanged(); - } else { - if (conditionCase_ == 14) { - conditionTimeSeriesQueryLanguageBuilder_.mergeFrom(value); - } - conditionTimeSeriesQueryLanguageBuilder_.setMessage(value); - } - conditionCase_ = 14; - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public Builder clearConditionTimeSeriesQueryLanguage() { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - if (conditionCase_ == 14) { - conditionCase_ = 0; - condition_ = null; - onChanged(); - } - } else { - if (conditionCase_ == 14) { - conditionCase_ = 0; - condition_ = null; - } - conditionTimeSeriesQueryLanguageBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition.Builder - getConditionTimeSeriesQueryLanguageBuilder() { - return getConditionTimeSeriesQueryLanguageFieldBuilder().getBuilder(); - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - public com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageConditionOrBuilder - getConditionTimeSeriesQueryLanguageOrBuilder() { - if ((conditionCase_ == 14) && (conditionTimeSeriesQueryLanguageBuilder_ != null)) { - return conditionTimeSeriesQueryLanguageBuilder_.getMessageOrBuilder(); - } else { - if (conditionCase_ == 14) { - return (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_; - } - return com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } - } - /** - * - * - *
-       * A condition that uses the Monitoring Query Language to define
-       * alerts.
-       * If set, no other conditions can be present.
-       * 
- * - * - * .google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; - * - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition, - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .Builder, - com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageConditionOrBuilder> - getConditionTimeSeriesQueryLanguageFieldBuilder() { - if (conditionTimeSeriesQueryLanguageBuilder_ == null) { - if (!(conditionCase_ == 14)) { - condition_ = - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .getDefaultInstance(); - } - conditionTimeSeriesQueryLanguageBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition, - com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition - .Builder, - com.google.monitoring.v3.AlertPolicy.Condition - .TimeSeriesQueryLanguageConditionOrBuilder>( - (com.google.monitoring.v3.AlertPolicy.Condition.TimeSeriesQueryLanguageCondition) - condition_, - getParentForChildren(), - isClean()); - condition_ = null; - } - conditionCase_ = 14; - onChanged(); - ; - return conditionTimeSeriesQueryLanguageBuilder_; - } - @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyName.java index 11d1eee9..a51e2e27 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyName.java @@ -16,25 +16,40 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class AlertPolicyName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected AlertPolicyName() {} + + private static final PathTemplate PROJECT_ALERT_POLICY_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/alertPolicies/{alert_policy}"); + private static final PathTemplate ORGANIZATION_ALERT_POLICY_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/alertPolicies/{alert_policy}"); + private static final PathTemplate FOLDER_ALERT_POLICY_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/alertPolicies/{alert_policy}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String alertPolicy; + private String project; + private String alertPolicy; + private String organization; + private String folder; public String getProject() { return project; @@ -44,35 +59,121 @@ public String getAlertPolicy() { return alertPolicy; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private AlertPolicyName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); alertPolicy = Preconditions.checkNotNull(builder.getAlertPolicy()); + pathTemplate = PROJECT_ALERT_POLICY_PATH_TEMPLATE; + } + + private AlertPolicyName(OrganizationAlertPolicyBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + alertPolicy = Preconditions.checkNotNull(builder.getAlertPolicy()); + pathTemplate = ORGANIZATION_ALERT_POLICY_PATH_TEMPLATE; + } + + private AlertPolicyName(FolderAlertPolicyBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + alertPolicy = Preconditions.checkNotNull(builder.getAlertPolicy()); + pathTemplate = FOLDER_ALERT_POLICY_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectAlertPolicyBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationAlertPolicyBuilder newOrganizationAlertPolicyBuilder() { + return new OrganizationAlertPolicyBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderAlertPolicyBuilder newFolderAlertPolicyBuilder() { + return new FolderAlertPolicyBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static AlertPolicyName of(String project, String alertPolicy) { - return newBuilder().setProject(project).setAlertPolicy(alertPolicy).build(); + return newProjectAlertPolicyBuilder().setProject(project).setAlertPolicy(alertPolicy).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static AlertPolicyName ofProjectAlertPolicyName(String project, String alertPolicy) { + return newProjectAlertPolicyBuilder().setProject(project).setAlertPolicy(alertPolicy).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static AlertPolicyName ofOrganizationAlertPolicyName( + String organization, String alertPolicy) { + return newOrganizationAlertPolicyBuilder() + .setOrganization(organization) + .setAlertPolicy(alertPolicy) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static AlertPolicyName ofFolderAlertPolicyName(String folder, String alertPolicy) { + return newFolderAlertPolicyBuilder().setFolder(folder).setAlertPolicy(alertPolicy).build(); } public static String format(String project, String alertPolicy) { return newBuilder().setProject(project).setAlertPolicy(alertPolicy).build().toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectAlertPolicyName(String project, String alertPolicy) { + return newBuilder().setProject(project).setAlertPolicy(alertPolicy).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationAlertPolicyName(String organization, String alertPolicy) { + return newOrganizationAlertPolicyBuilder() + .setOrganization(organization) + .setAlertPolicy(alertPolicy) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderAlertPolicyName(String folder, String alertPolicy) { + return newFolderAlertPolicyBuilder() + .setFolder(folder) + .setAlertPolicy(alertPolicy) + .build() + .toString(); + } + public static AlertPolicyName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "AlertPolicyName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("alert_policy")); + if (PROJECT_ALERT_POLICY_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_ALERT_POLICY_PATH_TEMPLATE.match(formattedString); + return ofProjectAlertPolicyName(matchMap.get("project"), matchMap.get("alert_policy")); + } else if (ORGANIZATION_ALERT_POLICY_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_ALERT_POLICY_PATH_TEMPLATE.match(formattedString); + return ofOrganizationAlertPolicyName( + matchMap.get("organization"), matchMap.get("alert_policy")); + } else if (FOLDER_ALERT_POLICY_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_ALERT_POLICY_PATH_TEMPLATE.match(formattedString); + return ofFolderAlertPolicyName(matchMap.get("folder"), matchMap.get("alert_policy")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -84,7 +185,7 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (AlertPolicyName value : values) { if (value == null) { list.add(""); @@ -96,16 +197,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_ALERT_POLICY_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_ALERT_POLICY_PATH_TEMPLATE.matches(formattedString) + || FOLDER_ALERT_POLICY_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("alertPolicy", alertPolicy); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (alertPolicy != null) { + fieldMapBuilder.put("alert_policy", alertPolicy); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -119,15 +233,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "alert_policy", alertPolicy); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for AlertPolicyName. */ + /** Builder for projects/{project}/alertPolicies/{alert_policy}. */ public static class Builder { private String project; private String alertPolicy; + protected Builder() {} + public String getProject() { return project; } @@ -146,9 +262,11 @@ public Builder setAlertPolicy(String alertPolicy) { return this; } - private Builder() {} - private Builder(AlertPolicyName alertPolicyName) { + Preconditions.checkArgument( + alertPolicyName.pathTemplate == PROJECT_ALERT_POLICY_PATH_TEMPLATE, + "toBuilder is only supported when AlertPolicyName has the pattern of " + + "projects/{project}/alertPolicies/{alert_policy}."); project = alertPolicyName.project; alertPolicy = alertPolicyName.alertPolicy; } @@ -158,14 +276,81 @@ public AlertPolicyName build() { } } + /** Builder for organizations/{organization}/alertPolicies/{alert_policy}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationAlertPolicyBuilder { + + private String organization; + private String alertPolicy; + + private OrganizationAlertPolicyBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getAlertPolicy() { + return alertPolicy; + } + + public OrganizationAlertPolicyBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationAlertPolicyBuilder setAlertPolicy(String alertPolicy) { + this.alertPolicy = alertPolicy; + return this; + } + + public AlertPolicyName build() { + return new AlertPolicyName(this); + } + } + + /** Builder for folders/{folder}/alertPolicies/{alert_policy}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderAlertPolicyBuilder { + + private String folder; + private String alertPolicy; + + private FolderAlertPolicyBuilder() {} + + public String getFolder() { + return folder; + } + + public String getAlertPolicy() { + return alertPolicy; + } + + public FolderAlertPolicyBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderAlertPolicyBuilder setAlertPolicy(String alertPolicy) { + this.alertPolicy = alertPolicy; + return this; + } + + public AlertPolicyName build() { + return new AlertPolicyName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof AlertPolicyName) { + if (o != null || getClass() == o.getClass()) { AlertPolicyName that = (AlertPolicyName) o; - return (this.project.equals(that.project)) && (this.alertPolicy.equals(that.alertPolicy)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.alertPolicy, that.alertPolicy)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -174,9 +359,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(alertPolicy); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= alertPolicy.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java index cd007727..f307e7df 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java @@ -51,10 +51,6 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_monitoring_v3_AlertPolicy_Condition_MetricAbsence_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -74,7 +70,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "google/monitoring/v3/mutation_record.pro" + "to\032\036google/protobuf/duration.proto\032\036goog" + "le/protobuf/wrappers.proto\032\027google/rpc/s" - + "tatus.proto\"\253\022\n\013AlertPolicy\022\014\n\004name\030\001 \001(" + + "tatus.proto\"\351\020\n\013AlertPolicy\022\014\n\004name\030\001 \001(" + "\t\022\024\n\014display_name\030\002 \001(\t\022F\n\rdocumentation" + "\030\r \001(\0132/.google.monitoring.v3.AlertPolic" + "y.Documentation\022F\n\013user_labels\030\020 \003(\01321.g" @@ -90,55 +86,50 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "cord\022=\n\017mutation_record\030\013 \001(\0132$.google.m" + "onitoring.v3.MutationRecord\0323\n\rDocumenta" + "tion\022\017\n\007content\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t" - + "\032\324\n\n\tCondition\022\014\n\004name\030\014 \001(\t\022\024\n\014display_" + + "\032\222\t\n\tCondition\022\014\n\004name\030\014 \001(\t\022\024\n\014display_" + "name\030\006 \001(\t\022Z\n\023condition_threshold\030\001 \001(\0132" + ";.google.monitoring.v3.AlertPolicy.Condi" + "tion.MetricThresholdH\000\022U\n\020condition_abse" + "nt\030\002 \001(\01329.google.monitoring.v3.AlertPol" - + "icy.Condition.MetricAbsenceH\000\022|\n$conditi" - + "on_time_series_query_language\030\016 \001(\0132L.go" - + "ogle.monitoring.v3.AlertPolicy.Condition" - + ".TimeSeriesQueryLanguageConditionH\000\0325\n\007T" - + "rigger\022\017\n\005count\030\001 \001(\005H\000\022\021\n\007percent\030\002 \001(\001" - + "H\000B\006\n\004type\032\201\003\n\017MetricThreshold\022\016\n\006filter" - + "\030\002 \001(\t\0227\n\014aggregations\030\010 \003(\0132!.google.mo" - + "nitoring.v3.Aggregation\022\032\n\022denominator_f" - + "ilter\030\t \001(\t\022C\n\030denominator_aggregations\030" - + "\n \003(\0132!.google.monitoring.v3.Aggregation" - + "\0228\n\ncomparison\030\004 \001(\0162$.google.monitoring" - + ".v3.ComparisonType\022\027\n\017threshold_value\030\005 " - + "\001(\001\022+\n\010duration\030\006 \001(\0132\031.google.protobuf." - + "Duration\022D\n\007trigger\030\007 \001(\01323.google.monit" - + "oring.v3.AlertPolicy.Condition.Trigger\032\313" - + "\001\n\rMetricAbsence\022\016\n\006filter\030\001 \001(\t\0227\n\014aggr" - + "egations\030\005 \003(\0132!.google.monitoring.v3.Ag" - + "gregation\022+\n\010duration\030\002 \001(\0132\031.google.pro" - + "tobuf.Duration\022D\n\007trigger\030\003 \001(\01323.google" - + ".monitoring.v3.AlertPolicy.Condition.Tri" - + "gger\032B\n TimeSeriesQueryLanguageCondition" - + "\022\r\n\005query\030\001 \001(\t\022\017\n\007summary\030\002 \001(\t:\227\002\352A\223\002\n" - + ".monitoring.googleapis.com/AlertPolicyCo" - + "ndition\022Fprojects/{project}/alertPolicie" - + "s/{alert_policy}/conditions/{condition}\022" - + "Porganizations/{organization}/alertPolic" - + "ies/{alert_policy}/conditions/{condition" - + "}\022Dfolders/{folder}/alertPolicies/{alert" - + "_policy}/conditions/{condition}\022\001*B\013\n\tco" - + "ndition\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 \001(\t\022" - + "\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025ConditionCombinerT" - + "ype\022\027\n\023COMBINE_UNSPECIFIED\020\000\022\007\n\003AND\020\001\022\006\n" - + "\002OR\020\002\022\036\n\032AND_WITH_MATCHING_RESOURCE\020\003:\311\001" - + "\352A\305\001\n%monitoring.googleapis.com/AlertPol" - + "icy\022/projects/{project}/alertPolicies/{a" - + "lert_policy}\0229organizations/{organizatio" - + "n}/alertPolicies/{alert_policy}\022-folders" - + "/{folder}/alertPolicies/{alert_policy}\022\001" - + "*B\302\001\n\030com.google.monitoring.v3B\nAlertPro" - + "toP\001Z>google.golang.org/genproto/googlea" - + "pis/monitoring/v3;monitoring\252\002\032Google.Cl" - + "oud.Monitoring.V3\312\002\032Google\\Cloud\\Monitor" - + "ing\\V3\352\002\035Google::Cloud::Monitoring::V3b\006" - + "proto3" + + "icy.Condition.MetricAbsenceH\000\0325\n\007Trigger" + + "\022\017\n\005count\030\001 \001(\005H\000\022\021\n\007percent\030\002 \001(\001H\000B\006\n\004" + + "type\032\201\003\n\017MetricThreshold\022\016\n\006filter\030\002 \001(\t" + + "\0227\n\014aggregations\030\010 \003(\0132!.google.monitori" + + "ng.v3.Aggregation\022\032\n\022denominator_filter\030" + + "\t \001(\t\022C\n\030denominator_aggregations\030\n \003(\0132" + + "!.google.monitoring.v3.Aggregation\0228\n\nco" + + "mparison\030\004 \001(\0162$.google.monitoring.v3.Co" + + "mparisonType\022\027\n\017threshold_value\030\005 \001(\001\022+\n" + + "\010duration\030\006 \001(\0132\031.google.protobuf.Durati" + + "on\022D\n\007trigger\030\007 \001(\01323.google.monitoring." + + "v3.AlertPolicy.Condition.Trigger\032\313\001\n\rMet" + + "ricAbsence\022\016\n\006filter\030\001 \001(\t\0227\n\014aggregatio" + + "ns\030\005 \003(\0132!.google.monitoring.v3.Aggregat" + + "ion\022+\n\010duration\030\002 \001(\0132\031.google.protobuf." + + "Duration\022D\n\007trigger\030\003 \001(\01323.google.monit" + + "oring.v3.AlertPolicy.Condition.Trigger:\227" + + "\002\352A\223\002\n.monitoring.googleapis.com/AlertPo" + + "licyCondition\022Fprojects/{project}/alertP" + + "olicies/{alert_policy}/conditions/{condi" + + "tion}\022Porganizations/{organization}/aler" + + "tPolicies/{alert_policy}/conditions/{con" + + "dition}\022Dfolders/{folder}/alertPolicies/" + + "{alert_policy}/conditions/{condition}\022\001*" + + "B\013\n\tcondition\0321\n\017UserLabelsEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025ConditionCom" + + "binerType\022\027\n\023COMBINE_UNSPECIFIED\020\000\022\007\n\003AN" + + "D\020\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHING_RESOURC" + + "E\020\003:\311\001\352A\305\001\n%monitoring.googleapis.com/Al" + + "ertPolicy\022/projects/{project}/alertPolic" + + "ies/{alert_policy}\0229organizations/{organ" + + "ization}/alertPolicies/{alert_policy}\022-f" + + "olders/{folder}/alertPolicies/{alert_pol" + + "icy}\022\001*B\302\001\n\030com.google.monitoring.v3B\nAl" + + "ertProtoP\001Z>google.golang.org/genproto/g" + + "oogleapis/monitoring/v3;monitoring\252\002\032Goo" + + "gle.Cloud.Monitoring.V3\312\002\032Google\\Cloud\\M" + + "onitoring\\V3\352\002\035Google::Cloud::Monitoring" + + "::V3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -183,12 +174,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor, new java.lang.String[] { - "Name", - "DisplayName", - "ConditionThreshold", - "ConditionAbsent", - "ConditionTimeSeriesQueryLanguage", - "Condition", + "Name", "DisplayName", "ConditionThreshold", "ConditionAbsent", "Condition", }); internal_static_google_monitoring_v3_AlertPolicy_Condition_Trigger_descriptor = internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor @@ -227,16 +213,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Filter", "Aggregations", "Duration", "Trigger", }); - internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_descriptor = - internal_static_google_monitoring_v3_AlertPolicy_Condition_descriptor - .getNestedTypes() - .get(3); - internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_monitoring_v3_AlertPolicy_Condition_TimeSeriesQueryLanguageCondition_descriptor, - new java.lang.String[] { - "Query", "Summary", - }); internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_descriptor = internal_static_google_monitoring_v3_AlertPolicy_descriptor.getNestedTypes().get(2); internal_static_google_monitoring_v3_AlertPolicy_UserLabelsEntry_fieldAccessorTable = diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupName.java index 365d0978..77d84dac 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/GroupName.java @@ -16,25 +16,39 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class GroupName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected GroupName() {} + + private static final PathTemplate PROJECT_GROUP_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/groups/{group}"); + private static final PathTemplate ORGANIZATION_GROUP_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/groups/{group}"); + private static final PathTemplate FOLDER_GROUP_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/groups/{group}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String group; + private String project; + private String group; + private String organization; + private String folder; public String getProject() { return project; @@ -44,35 +58,112 @@ public String getGroup() { return group; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private GroupName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); group = Preconditions.checkNotNull(builder.getGroup()); + pathTemplate = PROJECT_GROUP_PATH_TEMPLATE; + } + + private GroupName(OrganizationGroupBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + group = Preconditions.checkNotNull(builder.getGroup()); + pathTemplate = ORGANIZATION_GROUP_PATH_TEMPLATE; + } + + private GroupName(FolderGroupBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + group = Preconditions.checkNotNull(builder.getGroup()); + pathTemplate = FOLDER_GROUP_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectGroupBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationGroupBuilder newOrganizationGroupBuilder() { + return new OrganizationGroupBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderGroupBuilder newFolderGroupBuilder() { + return new FolderGroupBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static GroupName of(String project, String group) { - return newBuilder().setProject(project).setGroup(group).build(); + return newProjectGroupBuilder().setProject(project).setGroup(group).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static GroupName ofProjectGroupName(String project, String group) { + return newProjectGroupBuilder().setProject(project).setGroup(group).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static GroupName ofOrganizationGroupName(String organization, String group) { + return newOrganizationGroupBuilder().setOrganization(organization).setGroup(group).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static GroupName ofFolderGroupName(String folder, String group) { + return newFolderGroupBuilder().setFolder(folder).setGroup(group).build(); } public static String format(String project, String group) { return newBuilder().setProject(project).setGroup(group).build().toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectGroupName(String project, String group) { + return newBuilder().setProject(project).setGroup(group).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationGroupName(String organization, String group) { + return newOrganizationGroupBuilder() + .setOrganization(organization) + .setGroup(group) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderGroupName(String folder, String group) { + return newFolderGroupBuilder().setFolder(folder).setGroup(group).build().toString(); + } + public static GroupName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "GroupName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("group")); + if (PROJECT_GROUP_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_GROUP_PATH_TEMPLATE.match(formattedString); + return ofProjectGroupName(matchMap.get("project"), matchMap.get("group")); + } else if (ORGANIZATION_GROUP_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_GROUP_PATH_TEMPLATE.match(formattedString); + return ofOrganizationGroupName(matchMap.get("organization"), matchMap.get("group")); + } else if (FOLDER_GROUP_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_GROUP_PATH_TEMPLATE.match(formattedString); + return ofFolderGroupName(matchMap.get("folder"), matchMap.get("group")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -84,7 +175,7 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (GroupName value : values) { if (value == null) { list.add(""); @@ -96,16 +187,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_GROUP_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_GROUP_PATH_TEMPLATE.matches(formattedString) + || FOLDER_GROUP_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("group", group); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (group != null) { + fieldMapBuilder.put("group", group); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -119,15 +223,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "group", group); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for GroupName. */ + /** Builder for projects/{project}/groups/{group}. */ public static class Builder { private String project; private String group; + protected Builder() {} + public String getProject() { return project; } @@ -146,9 +252,11 @@ public Builder setGroup(String group) { return this; } - private Builder() {} - private Builder(GroupName groupName) { + Preconditions.checkArgument( + groupName.pathTemplate == PROJECT_GROUP_PATH_TEMPLATE, + "toBuilder is only supported when GroupName has the pattern of " + + "projects/{project}/groups/{group}."); project = groupName.project; group = groupName.group; } @@ -158,14 +266,81 @@ public GroupName build() { } } + /** Builder for organizations/{organization}/groups/{group}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationGroupBuilder { + + private String organization; + private String group; + + private OrganizationGroupBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getGroup() { + return group; + } + + public OrganizationGroupBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationGroupBuilder setGroup(String group) { + this.group = group; + return this; + } + + public GroupName build() { + return new GroupName(this); + } + } + + /** Builder for folders/{folder}/groups/{group}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderGroupBuilder { + + private String folder; + private String group; + + private FolderGroupBuilder() {} + + public String getFolder() { + return folder; + } + + public String getGroup() { + return group; + } + + public FolderGroupBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderGroupBuilder setGroup(String group) { + this.group = group; + return this; + } + + public GroupName build() { + return new GroupName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof GroupName) { + if (o != null || getClass() == o.getClass()) { GroupName that = (GroupName) o; - return (this.project.equals(that.project)) && (this.group.equals(that.group)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.group, that.group)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -174,9 +349,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(group); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= group.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricDescriptorName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricDescriptorName.java index 1e181cf0..ab9106e3 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricDescriptorName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MetricDescriptorName.java @@ -16,26 +16,42 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class MetricDescriptorName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected MetricDescriptorName() {} + + private static final PathTemplate PROJECT_METRIC_DESCRIPTOR_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/metricDescriptors/{metric_descriptor=**}"); + private static final PathTemplate ORGANIZATION_METRIC_DESCRIPTOR_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/metricDescriptors/{metric_descriptor=**}"); + private static final PathTemplate FOLDER_METRIC_DESCRIPTOR_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/metricDescriptors/{metric_descriptor=**}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String metricDescriptor; + private String project; + private String metricDescriptor; + private String organization; + private String folder; public String getProject() { return project; @@ -45,21 +61,87 @@ public String getMetricDescriptor() { return metricDescriptor; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private MetricDescriptorName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); metricDescriptor = Preconditions.checkNotNull(builder.getMetricDescriptor()); + pathTemplate = PROJECT_METRIC_DESCRIPTOR_PATH_TEMPLATE; + } + + private MetricDescriptorName(OrganizationMetricDescriptorBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + metricDescriptor = Preconditions.checkNotNull(builder.getMetricDescriptor()); + pathTemplate = ORGANIZATION_METRIC_DESCRIPTOR_PATH_TEMPLATE; + } + + private MetricDescriptorName(FolderMetricDescriptorBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + metricDescriptor = Preconditions.checkNotNull(builder.getMetricDescriptor()); + pathTemplate = FOLDER_METRIC_DESCRIPTOR_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectMetricDescriptorBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationMetricDescriptorBuilder newOrganizationMetricDescriptorBuilder() { + return new OrganizationMetricDescriptorBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderMetricDescriptorBuilder newFolderMetricDescriptorBuilder() { + return new FolderMetricDescriptorBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static MetricDescriptorName of(String project, String metricDescriptor) { - return newBuilder().setProject(project).setMetricDescriptor(metricDescriptor).build(); + return newProjectMetricDescriptorBuilder() + .setProject(project) + .setMetricDescriptor(metricDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static MetricDescriptorName ofProjectMetricDescriptorName( + String project, String metricDescriptor) { + return newProjectMetricDescriptorBuilder() + .setProject(project) + .setMetricDescriptor(metricDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static MetricDescriptorName ofOrganizationMetricDescriptorName( + String organization, String metricDescriptor) { + return newOrganizationMetricDescriptorBuilder() + .setOrganization(organization) + .setMetricDescriptor(metricDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static MetricDescriptorName ofFolderMetricDescriptorName( + String folder, String metricDescriptor) { + return newFolderMetricDescriptorBuilder() + .setFolder(folder) + .setMetricDescriptor(metricDescriptor) + .build(); } public static String format(String project, String metricDescriptor) { @@ -70,14 +152,53 @@ public static String format(String project, String metricDescriptor) { .toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectMetricDescriptorName(String project, String metricDescriptor) { + return newBuilder() + .setProject(project) + .setMetricDescriptor(metricDescriptor) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationMetricDescriptorName( + String organization, String metricDescriptor) { + return newOrganizationMetricDescriptorBuilder() + .setOrganization(organization) + .setMetricDescriptor(metricDescriptor) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderMetricDescriptorName(String folder, String metricDescriptor) { + return newFolderMetricDescriptorBuilder() + .setFolder(folder) + .setMetricDescriptor(metricDescriptor) + .build() + .toString(); + } + public static MetricDescriptorName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "MetricDescriptorName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("metric_descriptor")); + if (PROJECT_METRIC_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_METRIC_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofProjectMetricDescriptorName( + matchMap.get("project"), matchMap.get("metric_descriptor")); + } else if (ORGANIZATION_METRIC_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_METRIC_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofOrganizationMetricDescriptorName( + matchMap.get("organization"), matchMap.get("metric_descriptor")); + } else if (FOLDER_METRIC_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_METRIC_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofFolderMetricDescriptorName( + matchMap.get("folder"), matchMap.get("metric_descriptor")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -89,7 +210,7 @@ public static List parseList(List formattedStrings } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (MetricDescriptorName value : values) { if (value == null) { list.add(""); @@ -101,16 +222,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_METRIC_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_METRIC_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString) + || FOLDER_METRIC_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("metricDescriptor", metricDescriptor); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (metricDescriptor != null) { + fieldMapBuilder.put("metric_descriptor", metricDescriptor); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -124,15 +258,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "metric_descriptor", metricDescriptor); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for MetricDescriptorName. */ + /** Builder for projects/{project}/metricDescriptors/{metric_descriptor=**}. */ public static class Builder { private String project; private String metricDescriptor; + protected Builder() {} + public String getProject() { return project; } @@ -151,9 +287,11 @@ public Builder setMetricDescriptor(String metricDescriptor) { return this; } - private Builder() {} - private Builder(MetricDescriptorName metricDescriptorName) { + Preconditions.checkArgument( + metricDescriptorName.pathTemplate == PROJECT_METRIC_DESCRIPTOR_PATH_TEMPLATE, + "toBuilder is only supported when MetricDescriptorName has the pattern of " + + "projects/{project}/metricDescriptors/{metric_descriptor=**}."); project = metricDescriptorName.project; metricDescriptor = metricDescriptorName.metricDescriptor; } @@ -163,15 +301,81 @@ public MetricDescriptorName build() { } } + /** Builder for organizations/{organization}/metricDescriptors/{metric_descriptor=**}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationMetricDescriptorBuilder { + + private String organization; + private String metricDescriptor; + + private OrganizationMetricDescriptorBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getMetricDescriptor() { + return metricDescriptor; + } + + public OrganizationMetricDescriptorBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationMetricDescriptorBuilder setMetricDescriptor(String metricDescriptor) { + this.metricDescriptor = metricDescriptor; + return this; + } + + public MetricDescriptorName build() { + return new MetricDescriptorName(this); + } + } + + /** Builder for folders/{folder}/metricDescriptors/{metric_descriptor=**}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderMetricDescriptorBuilder { + + private String folder; + private String metricDescriptor; + + private FolderMetricDescriptorBuilder() {} + + public String getFolder() { + return folder; + } + + public String getMetricDescriptor() { + return metricDescriptor; + } + + public FolderMetricDescriptorBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderMetricDescriptorBuilder setMetricDescriptor(String metricDescriptor) { + this.metricDescriptor = metricDescriptor; + return this; + } + + public MetricDescriptorName build() { + return new MetricDescriptorName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof MetricDescriptorName) { + if (o != null || getClass() == o.getClass()) { MetricDescriptorName that = (MetricDescriptorName) o; - return (this.project.equals(that.project)) - && (this.metricDescriptor.equals(that.metricDescriptor)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.metricDescriptor, that.metricDescriptor)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -180,9 +384,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(metricDescriptor); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= metricDescriptor.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MonitoredResourceDescriptorName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MonitoredResourceDescriptorName.java index 25b82a96..f96dbc72 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MonitoredResourceDescriptorName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/MonitoredResourceDescriptorName.java @@ -16,26 +16,42 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class MonitoredResourceDescriptorName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected MonitoredResourceDescriptorName() {} + + private static final PathTemplate PROJECT_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}"); + private static final PathTemplate ORGANIZATION_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}"); + private static final PathTemplate FOLDER_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String monitoredResourceDescriptor; + private String project; + private String monitoredResourceDescriptor; + private String organization; + private String folder; public String getProject() { return project; @@ -45,28 +61,95 @@ public String getMonitoredResourceDescriptor() { return monitoredResourceDescriptor; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private MonitoredResourceDescriptorName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); monitoredResourceDescriptor = Preconditions.checkNotNull(builder.getMonitoredResourceDescriptor()); + pathTemplate = PROJECT_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE; + } + + private MonitoredResourceDescriptorName(OrganizationMonitoredResourceDescriptorBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + monitoredResourceDescriptor = + Preconditions.checkNotNull(builder.getMonitoredResourceDescriptor()); + pathTemplate = ORGANIZATION_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE; + } + + private MonitoredResourceDescriptorName(FolderMonitoredResourceDescriptorBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + monitoredResourceDescriptor = + Preconditions.checkNotNull(builder.getMonitoredResourceDescriptor()); + pathTemplate = FOLDER_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectMonitoredResourceDescriptorBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationMonitoredResourceDescriptorBuilder + newOrganizationMonitoredResourceDescriptorBuilder() { + return new OrganizationMonitoredResourceDescriptorBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderMonitoredResourceDescriptorBuilder + newFolderMonitoredResourceDescriptorBuilder() { + return new FolderMonitoredResourceDescriptorBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static MonitoredResourceDescriptorName of( String project, String monitoredResourceDescriptor) { - return newBuilder() + return newProjectMonitoredResourceDescriptorBuilder() + .setProject(project) + .setMonitoredResourceDescriptor(monitoredResourceDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static MonitoredResourceDescriptorName ofProjectMonitoredResourceDescriptorName( + String project, String monitoredResourceDescriptor) { + return newProjectMonitoredResourceDescriptorBuilder() .setProject(project) .setMonitoredResourceDescriptor(monitoredResourceDescriptor) .build(); } + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static MonitoredResourceDescriptorName ofOrganizationMonitoredResourceDescriptorName( + String organization, String monitoredResourceDescriptor) { + return newOrganizationMonitoredResourceDescriptorBuilder() + .setOrganization(organization) + .setMonitoredResourceDescriptor(monitoredResourceDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static MonitoredResourceDescriptorName ofFolderMonitoredResourceDescriptorName( + String folder, String monitoredResourceDescriptor) { + return newFolderMonitoredResourceDescriptorBuilder() + .setFolder(folder) + .setMonitoredResourceDescriptor(monitoredResourceDescriptor) + .build(); + } + public static String format(String project, String monitoredResourceDescriptor) { return newBuilder() .setProject(project) @@ -75,15 +158,57 @@ public static String format(String project, String monitoredResourceDescriptor) .toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectMonitoredResourceDescriptorName( + String project, String monitoredResourceDescriptor) { + return newBuilder() + .setProject(project) + .setMonitoredResourceDescriptor(monitoredResourceDescriptor) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationMonitoredResourceDescriptorName( + String organization, String monitoredResourceDescriptor) { + return newOrganizationMonitoredResourceDescriptorBuilder() + .setOrganization(organization) + .setMonitoredResourceDescriptor(monitoredResourceDescriptor) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderMonitoredResourceDescriptorName( + String folder, String monitoredResourceDescriptor) { + return newFolderMonitoredResourceDescriptorBuilder() + .setFolder(folder) + .setMonitoredResourceDescriptor(monitoredResourceDescriptor) + .build() + .toString(); + } + public static MonitoredResourceDescriptorName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, - "MonitoredResourceDescriptorName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("monitored_resource_descriptor")); + if (PROJECT_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofProjectMonitoredResourceDescriptorName( + matchMap.get("project"), matchMap.get("monitored_resource_descriptor")); + } else if (ORGANIZATION_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofOrganizationMonitoredResourceDescriptorName( + matchMap.get("organization"), matchMap.get("monitored_resource_descriptor")); + } else if (FOLDER_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + FOLDER_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofFolderMonitoredResourceDescriptorName( + matchMap.get("folder"), matchMap.get("monitored_resource_descriptor")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -95,7 +220,7 @@ public static List parseList(List forma } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (MonitoredResourceDescriptorName value : values) { if (value == null) { list.add(""); @@ -107,16 +232,29 @@ public static List toStringList(List va } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString) + || FOLDER_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("monitoredResourceDescriptor", monitoredResourceDescriptor); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (monitoredResourceDescriptor != null) { + fieldMapBuilder.put("monitored_resource_descriptor", monitoredResourceDescriptor); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -130,16 +268,19 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, "monitored_resource_descriptor", monitoredResourceDescriptor); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for MonitoredResourceDescriptorName. */ + /** + * Builder for projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}. + */ public static class Builder { private String project; private String monitoredResourceDescriptor; + protected Builder() {} + public String getProject() { return project; } @@ -158,9 +299,12 @@ public Builder setMonitoredResourceDescriptor(String monitoredResourceDescriptor return this; } - private Builder() {} - private Builder(MonitoredResourceDescriptorName monitoredResourceDescriptorName) { + Preconditions.checkArgument( + monitoredResourceDescriptorName.pathTemplate + == PROJECT_MONITORED_RESOURCE_DESCRIPTOR_PATH_TEMPLATE, + "toBuilder is only supported when MonitoredResourceDescriptorName has the pattern of " + + "projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}."); project = monitoredResourceDescriptorName.project; monitoredResourceDescriptor = monitoredResourceDescriptorName.monitoredResourceDescriptor; } @@ -170,15 +314,86 @@ public MonitoredResourceDescriptorName build() { } } + /** + * Builder for + * organizations/{organization}/monitoredResourceDescriptors/{monitored_resource_descriptor}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationMonitoredResourceDescriptorBuilder { + + private String organization; + private String monitoredResourceDescriptor; + + private OrganizationMonitoredResourceDescriptorBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getMonitoredResourceDescriptor() { + return monitoredResourceDescriptor; + } + + public OrganizationMonitoredResourceDescriptorBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationMonitoredResourceDescriptorBuilder setMonitoredResourceDescriptor( + String monitoredResourceDescriptor) { + this.monitoredResourceDescriptor = monitoredResourceDescriptor; + return this; + } + + public MonitoredResourceDescriptorName build() { + return new MonitoredResourceDescriptorName(this); + } + } + + /** Builder for folders/{folder}/monitoredResourceDescriptors/{monitored_resource_descriptor}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderMonitoredResourceDescriptorBuilder { + + private String folder; + private String monitoredResourceDescriptor; + + private FolderMonitoredResourceDescriptorBuilder() {} + + public String getFolder() { + return folder; + } + + public String getMonitoredResourceDescriptor() { + return monitoredResourceDescriptor; + } + + public FolderMonitoredResourceDescriptorBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderMonitoredResourceDescriptorBuilder setMonitoredResourceDescriptor( + String monitoredResourceDescriptor) { + this.monitoredResourceDescriptor = monitoredResourceDescriptor; + return this; + } + + public MonitoredResourceDescriptorName build() { + return new MonitoredResourceDescriptorName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof MonitoredResourceDescriptorName) { + if (o != null || getClass() == o.getClass()) { MonitoredResourceDescriptorName that = (MonitoredResourceDescriptorName) o; - return (this.project.equals(that.project)) - && (this.monitoredResourceDescriptor.equals(that.monitoredResourceDescriptor)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.monitoredResourceDescriptor, that.monitoredResourceDescriptor)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -187,9 +402,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(monitoredResourceDescriptor); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= monitoredResourceDescriptor.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorName.java index cd62ad23..fcd572eb 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelDescriptorName.java @@ -16,26 +16,42 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class NotificationChannelDescriptorName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected NotificationChannelDescriptorName() {} + + private static final PathTemplate PROJECT_CHANNEL_DESCRIPTOR_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/notificationChannelDescriptors/{channel_descriptor}"); + private static final PathTemplate ORGANIZATION_CHANNEL_DESCRIPTOR_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}"); + private static final PathTemplate FOLDER_CHANNEL_DESCRIPTOR_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/notificationChannelDescriptors/{channel_descriptor}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String channelDescriptor; + private String project; + private String channelDescriptor; + private String organization; + private String folder; public String getProject() { return project; @@ -45,21 +61,87 @@ public String getChannelDescriptor() { return channelDescriptor; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private NotificationChannelDescriptorName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); channelDescriptor = Preconditions.checkNotNull(builder.getChannelDescriptor()); + pathTemplate = PROJECT_CHANNEL_DESCRIPTOR_PATH_TEMPLATE; + } + + private NotificationChannelDescriptorName(OrganizationChannelDescriptorBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + channelDescriptor = Preconditions.checkNotNull(builder.getChannelDescriptor()); + pathTemplate = ORGANIZATION_CHANNEL_DESCRIPTOR_PATH_TEMPLATE; + } + + private NotificationChannelDescriptorName(FolderChannelDescriptorBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + channelDescriptor = Preconditions.checkNotNull(builder.getChannelDescriptor()); + pathTemplate = FOLDER_CHANNEL_DESCRIPTOR_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectChannelDescriptorBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationChannelDescriptorBuilder newOrganizationChannelDescriptorBuilder() { + return new OrganizationChannelDescriptorBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderChannelDescriptorBuilder newFolderChannelDescriptorBuilder() { + return new FolderChannelDescriptorBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static NotificationChannelDescriptorName of(String project, String channelDescriptor) { - return newBuilder().setProject(project).setChannelDescriptor(channelDescriptor).build(); + return newProjectChannelDescriptorBuilder() + .setProject(project) + .setChannelDescriptor(channelDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static NotificationChannelDescriptorName ofProjectChannelDescriptorName( + String project, String channelDescriptor) { + return newProjectChannelDescriptorBuilder() + .setProject(project) + .setChannelDescriptor(channelDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static NotificationChannelDescriptorName ofOrganizationChannelDescriptorName( + String organization, String channelDescriptor) { + return newOrganizationChannelDescriptorBuilder() + .setOrganization(organization) + .setChannelDescriptor(channelDescriptor) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static NotificationChannelDescriptorName ofFolderChannelDescriptorName( + String folder, String channelDescriptor) { + return newFolderChannelDescriptorBuilder() + .setFolder(folder) + .setChannelDescriptor(channelDescriptor) + .build(); } public static String format(String project, String channelDescriptor) { @@ -70,15 +152,55 @@ public static String format(String project, String channelDescriptor) { .toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectChannelDescriptorName( + String project, String channelDescriptor) { + return newBuilder() + .setProject(project) + .setChannelDescriptor(channelDescriptor) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationChannelDescriptorName( + String organization, String channelDescriptor) { + return newOrganizationChannelDescriptorBuilder() + .setOrganization(organization) + .setChannelDescriptor(channelDescriptor) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderChannelDescriptorName(String folder, String channelDescriptor) { + return newFolderChannelDescriptorBuilder() + .setFolder(folder) + .setChannelDescriptor(channelDescriptor) + .build() + .toString(); + } + public static NotificationChannelDescriptorName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, - "NotificationChannelDescriptorName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("channel_descriptor")); + if (PROJECT_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofProjectChannelDescriptorName( + matchMap.get("project"), matchMap.get("channel_descriptor")); + } else if (ORGANIZATION_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofOrganizationChannelDescriptorName( + matchMap.get("organization"), matchMap.get("channel_descriptor")); + } else if (FOLDER_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.match(formattedString); + return ofFolderChannelDescriptorName( + matchMap.get("folder"), matchMap.get("channel_descriptor")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -90,7 +212,7 @@ public static List parseList(List for } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (NotificationChannelDescriptorName value : values) { if (value == null) { list.add(""); @@ -102,16 +224,29 @@ public static List toStringList(List } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString) + || FOLDER_CHANNEL_DESCRIPTOR_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("channelDescriptor", channelDescriptor); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (channelDescriptor != null) { + fieldMapBuilder.put("channel_descriptor", channelDescriptor); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -125,15 +260,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "channel_descriptor", channelDescriptor); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for NotificationChannelDescriptorName. */ + /** Builder for projects/{project}/notificationChannelDescriptors/{channel_descriptor}. */ public static class Builder { private String project; private String channelDescriptor; + protected Builder() {} + public String getProject() { return project; } @@ -152,9 +289,12 @@ public Builder setChannelDescriptor(String channelDescriptor) { return this; } - private Builder() {} - private Builder(NotificationChannelDescriptorName notificationChannelDescriptorName) { + Preconditions.checkArgument( + notificationChannelDescriptorName.pathTemplate + == PROJECT_CHANNEL_DESCRIPTOR_PATH_TEMPLATE, + "toBuilder is only supported when NotificationChannelDescriptorName has the pattern of " + + "projects/{project}/notificationChannelDescriptors/{channel_descriptor}."); project = notificationChannelDescriptorName.project; channelDescriptor = notificationChannelDescriptorName.channelDescriptor; } @@ -164,15 +304,83 @@ public NotificationChannelDescriptorName build() { } } + /** + * Builder for organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationChannelDescriptorBuilder { + + private String organization; + private String channelDescriptor; + + private OrganizationChannelDescriptorBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getChannelDescriptor() { + return channelDescriptor; + } + + public OrganizationChannelDescriptorBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationChannelDescriptorBuilder setChannelDescriptor(String channelDescriptor) { + this.channelDescriptor = channelDescriptor; + return this; + } + + public NotificationChannelDescriptorName build() { + return new NotificationChannelDescriptorName(this); + } + } + + /** Builder for folders/{folder}/notificationChannelDescriptors/{channel_descriptor}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderChannelDescriptorBuilder { + + private String folder; + private String channelDescriptor; + + private FolderChannelDescriptorBuilder() {} + + public String getFolder() { + return folder; + } + + public String getChannelDescriptor() { + return channelDescriptor; + } + + public FolderChannelDescriptorBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderChannelDescriptorBuilder setChannelDescriptor(String channelDescriptor) { + this.channelDescriptor = channelDescriptor; + return this; + } + + public NotificationChannelDescriptorName build() { + return new NotificationChannelDescriptorName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof NotificationChannelDescriptorName) { + if (o != null || getClass() == o.getClass()) { NotificationChannelDescriptorName that = (NotificationChannelDescriptorName) o; - return (this.project.equals(that.project)) - && (this.channelDescriptor.equals(that.channelDescriptor)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.channelDescriptor, that.channelDescriptor)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -181,9 +389,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(channelDescriptor); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= channelDescriptor.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelName.java index 22f0b028..6fbee4bd 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/NotificationChannelName.java @@ -16,26 +16,42 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class NotificationChannelName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected NotificationChannelName() {} + + private static final PathTemplate PROJECT_NOTIFICATION_CHANNEL_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/notificationChannels/{notification_channel}"); + private static final PathTemplate ORGANIZATION_NOTIFICATION_CHANNEL_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/notificationChannels/{notification_channel}"); + private static final PathTemplate FOLDER_NOTIFICATION_CHANNEL_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/notificationChannels/{notification_channel}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String notificationChannel; + private String project; + private String notificationChannel; + private String organization; + private String folder; public String getProject() { return project; @@ -45,21 +61,87 @@ public String getNotificationChannel() { return notificationChannel; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private NotificationChannelName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); notificationChannel = Preconditions.checkNotNull(builder.getNotificationChannel()); + pathTemplate = PROJECT_NOTIFICATION_CHANNEL_PATH_TEMPLATE; + } + + private NotificationChannelName(OrganizationNotificationChannelBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + notificationChannel = Preconditions.checkNotNull(builder.getNotificationChannel()); + pathTemplate = ORGANIZATION_NOTIFICATION_CHANNEL_PATH_TEMPLATE; + } + + private NotificationChannelName(FolderNotificationChannelBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + notificationChannel = Preconditions.checkNotNull(builder.getNotificationChannel()); + pathTemplate = FOLDER_NOTIFICATION_CHANNEL_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectNotificationChannelBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationNotificationChannelBuilder newOrganizationNotificationChannelBuilder() { + return new OrganizationNotificationChannelBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderNotificationChannelBuilder newFolderNotificationChannelBuilder() { + return new FolderNotificationChannelBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static NotificationChannelName of(String project, String notificationChannel) { - return newBuilder().setProject(project).setNotificationChannel(notificationChannel).build(); + return newProjectNotificationChannelBuilder() + .setProject(project) + .setNotificationChannel(notificationChannel) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static NotificationChannelName ofProjectNotificationChannelName( + String project, String notificationChannel) { + return newProjectNotificationChannelBuilder() + .setProject(project) + .setNotificationChannel(notificationChannel) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static NotificationChannelName ofOrganizationNotificationChannelName( + String organization, String notificationChannel) { + return newOrganizationNotificationChannelBuilder() + .setOrganization(organization) + .setNotificationChannel(notificationChannel) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static NotificationChannelName ofFolderNotificationChannelName( + String folder, String notificationChannel) { + return newFolderNotificationChannelBuilder() + .setFolder(folder) + .setNotificationChannel(notificationChannel) + .build(); } public static String format(String project, String notificationChannel) { @@ -70,14 +152,57 @@ public static String format(String project, String notificationChannel) { .toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectNotificationChannelName( + String project, String notificationChannel) { + return newBuilder() + .setProject(project) + .setNotificationChannel(notificationChannel) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationNotificationChannelName( + String organization, String notificationChannel) { + return newOrganizationNotificationChannelBuilder() + .setOrganization(organization) + .setNotificationChannel(notificationChannel) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderNotificationChannelName( + String folder, String notificationChannel) { + return newFolderNotificationChannelBuilder() + .setFolder(folder) + .setNotificationChannel(notificationChannel) + .build() + .toString(); + } + public static NotificationChannelName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "NotificationChannelName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("notification_channel")); + if (PROJECT_NOTIFICATION_CHANNEL_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_NOTIFICATION_CHANNEL_PATH_TEMPLATE.match(formattedString); + return ofProjectNotificationChannelName( + matchMap.get("project"), matchMap.get("notification_channel")); + } else if (ORGANIZATION_NOTIFICATION_CHANNEL_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_NOTIFICATION_CHANNEL_PATH_TEMPLATE.match(formattedString); + return ofOrganizationNotificationChannelName( + matchMap.get("organization"), matchMap.get("notification_channel")); + } else if (FOLDER_NOTIFICATION_CHANNEL_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + FOLDER_NOTIFICATION_CHANNEL_PATH_TEMPLATE.match(formattedString); + return ofFolderNotificationChannelName( + matchMap.get("folder"), matchMap.get("notification_channel")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -89,7 +214,7 @@ public static List parseList(List formattedStri } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (NotificationChannelName value : values) { if (value == null) { list.add(""); @@ -101,16 +226,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_NOTIFICATION_CHANNEL_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_NOTIFICATION_CHANNEL_PATH_TEMPLATE.matches(formattedString) + || FOLDER_NOTIFICATION_CHANNEL_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("notificationChannel", notificationChannel); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (notificationChannel != null) { + fieldMapBuilder.put("notification_channel", notificationChannel); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -124,16 +262,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, "notification_channel", notificationChannel); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for NotificationChannelName. */ + /** Builder for projects/{project}/notificationChannels/{notification_channel}. */ public static class Builder { private String project; private String notificationChannel; + protected Builder() {} + public String getProject() { return project; } @@ -152,9 +291,11 @@ public Builder setNotificationChannel(String notificationChannel) { return this; } - private Builder() {} - private Builder(NotificationChannelName notificationChannelName) { + Preconditions.checkArgument( + notificationChannelName.pathTemplate == PROJECT_NOTIFICATION_CHANNEL_PATH_TEMPLATE, + "toBuilder is only supported when NotificationChannelName has the pattern of " + + "projects/{project}/notificationChannels/{notification_channel}."); project = notificationChannelName.project; notificationChannel = notificationChannelName.notificationChannel; } @@ -164,15 +305,82 @@ public NotificationChannelName build() { } } + /** Builder for organizations/{organization}/notificationChannels/{notification_channel}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationNotificationChannelBuilder { + + private String organization; + private String notificationChannel; + + private OrganizationNotificationChannelBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getNotificationChannel() { + return notificationChannel; + } + + public OrganizationNotificationChannelBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationNotificationChannelBuilder setNotificationChannel( + String notificationChannel) { + this.notificationChannel = notificationChannel; + return this; + } + + public NotificationChannelName build() { + return new NotificationChannelName(this); + } + } + + /** Builder for folders/{folder}/notificationChannels/{notification_channel}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderNotificationChannelBuilder { + + private String folder; + private String notificationChannel; + + private FolderNotificationChannelBuilder() {} + + public String getFolder() { + return folder; + } + + public String getNotificationChannel() { + return notificationChannel; + } + + public FolderNotificationChannelBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderNotificationChannelBuilder setNotificationChannel(String notificationChannel) { + this.notificationChannel = notificationChannel; + return this; + } + + public NotificationChannelName build() { + return new NotificationChannelName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof NotificationChannelName) { + if (o != null || getClass() == o.getClass()) { NotificationChannelName that = (NotificationChannelName) o; - return (this.project.equals(that.project)) - && (this.notificationChannel.equals(that.notificationChannel)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.notificationChannel, that.notificationChannel)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -181,9 +389,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(notificationChannel); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= notificationChannel.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java index a641a9d9..fea632a7 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceLevelObjectiveName.java @@ -16,27 +16,43 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class ServiceLevelObjectiveName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected ServiceLevelObjectiveName() {} + + private static final PathTemplate PROJECT_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}"); + private static final PathTemplate ORGANIZATION_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}"); + private static final PathTemplate FOLDER_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String service; - private final String serviceLevelObjective; + private String project; + private String service; + private String serviceLevelObjective; + private String organization; + private String folder; public String getProject() { return project; @@ -50,29 +66,99 @@ public String getServiceLevelObjective() { return serviceLevelObjective; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private ServiceLevelObjectiveName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); service = Preconditions.checkNotNull(builder.getService()); serviceLevelObjective = Preconditions.checkNotNull(builder.getServiceLevelObjective()); + pathTemplate = PROJECT_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE; + } + + private ServiceLevelObjectiveName(OrganizationServiceServiceLevelObjectiveBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + service = Preconditions.checkNotNull(builder.getService()); + serviceLevelObjective = Preconditions.checkNotNull(builder.getServiceLevelObjective()); + pathTemplate = ORGANIZATION_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE; + } + + private ServiceLevelObjectiveName(FolderServiceServiceLevelObjectiveBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + service = Preconditions.checkNotNull(builder.getService()); + serviceLevelObjective = Preconditions.checkNotNull(builder.getServiceLevelObjective()); + pathTemplate = FOLDER_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectServiceServiceLevelObjectiveBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationServiceServiceLevelObjectiveBuilder + newOrganizationServiceServiceLevelObjectiveBuilder() { + return new OrganizationServiceServiceLevelObjectiveBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderServiceServiceLevelObjectiveBuilder + newFolderServiceServiceLevelObjectiveBuilder() { + return new FolderServiceServiceLevelObjectiveBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static ServiceLevelObjectiveName of( String project, String service, String serviceLevelObjective) { - return newBuilder() + return newProjectServiceServiceLevelObjectiveBuilder() .setProject(project) .setService(service) .setServiceLevelObjective(serviceLevelObjective) .build(); } + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceLevelObjectiveName ofProjectServiceServiceLevelObjectiveName( + String project, String service, String serviceLevelObjective) { + return newProjectServiceServiceLevelObjectiveBuilder() + .setProject(project) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceLevelObjectiveName ofOrganizationServiceServiceLevelObjectiveName( + String organization, String service, String serviceLevelObjective) { + return newOrganizationServiceServiceLevelObjectiveBuilder() + .setOrganization(organization) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceLevelObjectiveName ofFolderServiceServiceLevelObjectiveName( + String folder, String service, String serviceLevelObjective) { + return newFolderServiceServiceLevelObjectiveBuilder() + .setFolder(folder) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build(); + } + public static String format(String project, String service, String serviceLevelObjective) { return newBuilder() .setProject(project) @@ -82,16 +168,65 @@ public static String format(String project, String service, String serviceLevelO .toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectServiceServiceLevelObjectiveName( + String project, String service, String serviceLevelObjective) { + return newBuilder() + .setProject(project) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationServiceServiceLevelObjectiveName( + String organization, String service, String serviceLevelObjective) { + return newOrganizationServiceServiceLevelObjectiveBuilder() + .setOrganization(organization) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderServiceServiceLevelObjectiveName( + String folder, String service, String serviceLevelObjective) { + return newFolderServiceServiceLevelObjectiveBuilder() + .setFolder(folder) + .setService(service) + .setServiceLevelObjective(serviceLevelObjective) + .build() + .toString(); + } + public static ServiceLevelObjectiveName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, - "ServiceLevelObjectiveName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), matchMap.get("service"), matchMap.get("service_level_objective")); + if (PROJECT_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.match(formattedString); + return ofProjectServiceServiceLevelObjectiveName( + matchMap.get("project"), + matchMap.get("service"), + matchMap.get("service_level_objective")); + } else if (ORGANIZATION_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.matches( + formattedString)) { + Map matchMap = + ORGANIZATION_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.match(formattedString); + return ofOrganizationServiceServiceLevelObjectiveName( + matchMap.get("organization"), + matchMap.get("service"), + matchMap.get("service_level_objective")); + } else if (FOLDER_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + FOLDER_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.match(formattedString); + return ofFolderServiceServiceLevelObjectiveName( + matchMap.get("folder"), matchMap.get("service"), matchMap.get("service_level_objective")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -103,7 +238,7 @@ public static List parseList(List formattedSt } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (ServiceLevelObjectiveName value : values) { if (value == null) { list.add(""); @@ -115,17 +250,32 @@ public static List toStringList(List values) } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.matches(formattedString) + || FOLDER_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("service", service); - fieldMapBuilder.put("serviceLevelObjective", serviceLevelObjective); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (service != null) { + fieldMapBuilder.put("service", service); + } + if (serviceLevelObjective != null) { + fieldMapBuilder.put("service_level_objective", serviceLevelObjective); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -139,17 +289,21 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( - "project", project, "service", service, "service_level_objective", serviceLevelObjective); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for ServiceLevelObjectiveName. */ + /** + * Builder for + * projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}. + */ public static class Builder { private String project; private String service; private String serviceLevelObjective; + protected Builder() {} + public String getProject() { return project; } @@ -177,9 +331,12 @@ public Builder setServiceLevelObjective(String serviceLevelObjective) { return this; } - private Builder() {} - private Builder(ServiceLevelObjectiveName serviceLevelObjectiveName) { + Preconditions.checkArgument( + serviceLevelObjectiveName.pathTemplate + == PROJECT_SERVICE_SERVICE_LEVEL_OBJECTIVE_PATH_TEMPLATE, + "toBuilder is only supported when ServiceLevelObjectiveName has the pattern of " + + "projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}."); project = serviceLevelObjectiveName.project; service = serviceLevelObjectiveName.service; serviceLevelObjective = serviceLevelObjectiveName.serviceLevelObjective; @@ -190,16 +347,110 @@ public ServiceLevelObjectiveName build() { } } + /** + * Builder for + * organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationServiceServiceLevelObjectiveBuilder { + + private String organization; + private String service; + private String serviceLevelObjective; + + private OrganizationServiceServiceLevelObjectiveBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getService() { + return service; + } + + public String getServiceLevelObjective() { + return serviceLevelObjective; + } + + public OrganizationServiceServiceLevelObjectiveBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationServiceServiceLevelObjectiveBuilder setService(String service) { + this.service = service; + return this; + } + + public OrganizationServiceServiceLevelObjectiveBuilder setServiceLevelObjective( + String serviceLevelObjective) { + this.serviceLevelObjective = serviceLevelObjective; + return this; + } + + public ServiceLevelObjectiveName build() { + return new ServiceLevelObjectiveName(this); + } + } + + /** + * Builder for + * folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderServiceServiceLevelObjectiveBuilder { + + private String folder; + private String service; + private String serviceLevelObjective; + + private FolderServiceServiceLevelObjectiveBuilder() {} + + public String getFolder() { + return folder; + } + + public String getService() { + return service; + } + + public String getServiceLevelObjective() { + return serviceLevelObjective; + } + + public FolderServiceServiceLevelObjectiveBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderServiceServiceLevelObjectiveBuilder setService(String service) { + this.service = service; + return this; + } + + public FolderServiceServiceLevelObjectiveBuilder setServiceLevelObjective( + String serviceLevelObjective) { + this.serviceLevelObjective = serviceLevelObjective; + return this; + } + + public ServiceLevelObjectiveName build() { + return new ServiceLevelObjectiveName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ServiceLevelObjectiveName) { + if (o != null || getClass() == o.getClass()) { ServiceLevelObjectiveName that = (ServiceLevelObjectiveName) o; - return (this.project.equals(that.project)) - && (this.service.equals(that.service)) - && (this.serviceLevelObjective.equals(that.serviceLevelObjective)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.service, that.service)) + && (Objects.equals(this.serviceLevelObjective, that.serviceLevelObjective)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -208,11 +459,17 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(service); + h *= 1000003; + h ^= Objects.hashCode(serviceLevelObjective); h *= 1000003; - h ^= service.hashCode(); + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= serviceLevelObjective.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceName.java index 549dfa63..9070e6dc 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/ServiceName.java @@ -16,25 +16,39 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class ServiceName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected ServiceName() {} + + private static final PathTemplate PROJECT_SERVICE_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding("projects/{project}/services/{service}"); + private static final PathTemplate ORGANIZATION_SERVICE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/services/{service}"); + private static final PathTemplate FOLDER_SERVICE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/services/{service}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String service; + private String project; + private String service; + private String organization; + private String folder; public String getProject() { return project; @@ -44,35 +58,115 @@ public String getService() { return service; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private ServiceName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); service = Preconditions.checkNotNull(builder.getService()); + pathTemplate = PROJECT_SERVICE_PATH_TEMPLATE; + } + + private ServiceName(OrganizationServiceBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + service = Preconditions.checkNotNull(builder.getService()); + pathTemplate = ORGANIZATION_SERVICE_PATH_TEMPLATE; + } + + private ServiceName(FolderServiceBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + service = Preconditions.checkNotNull(builder.getService()); + pathTemplate = FOLDER_SERVICE_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectServiceBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationServiceBuilder newOrganizationServiceBuilder() { + return new OrganizationServiceBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderServiceBuilder newFolderServiceBuilder() { + return new FolderServiceBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static ServiceName of(String project, String service) { - return newBuilder().setProject(project).setService(service).build(); + return newProjectServiceBuilder().setProject(project).setService(service).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceName ofProjectServiceName(String project, String service) { + return newProjectServiceBuilder().setProject(project).setService(service).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceName ofOrganizationServiceName(String organization, String service) { + return newOrganizationServiceBuilder() + .setOrganization(organization) + .setService(service) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ServiceName ofFolderServiceName(String folder, String service) { + return newFolderServiceBuilder().setFolder(folder).setService(service).build(); } public static String format(String project, String service) { return newBuilder().setProject(project).setService(service).build().toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectServiceName(String project, String service) { + return newBuilder().setProject(project).setService(service).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationServiceName(String organization, String service) { + return newOrganizationServiceBuilder() + .setOrganization(organization) + .setService(service) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderServiceName(String folder, String service) { + return newFolderServiceBuilder().setFolder(folder).setService(service).build().toString(); + } + public static ServiceName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "ServiceName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("service")); + if (PROJECT_SERVICE_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_SERVICE_PATH_TEMPLATE.match(formattedString); + return ofProjectServiceName(matchMap.get("project"), matchMap.get("service")); + } else if (ORGANIZATION_SERVICE_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = ORGANIZATION_SERVICE_PATH_TEMPLATE.match(formattedString); + return ofOrganizationServiceName(matchMap.get("organization"), matchMap.get("service")); + } else if (FOLDER_SERVICE_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = FOLDER_SERVICE_PATH_TEMPLATE.match(formattedString); + return ofFolderServiceName(matchMap.get("folder"), matchMap.get("service")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -84,7 +178,7 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (ServiceName value : values) { if (value == null) { list.add(""); @@ -96,16 +190,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_SERVICE_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_SERVICE_PATH_TEMPLATE.matches(formattedString) + || FOLDER_SERVICE_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("service", service); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (service != null) { + fieldMapBuilder.put("service", service); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -119,15 +226,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "service", service); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for ServiceName. */ + /** Builder for projects/{project}/services/{service}. */ public static class Builder { private String project; private String service; + protected Builder() {} + public String getProject() { return project; } @@ -146,9 +255,11 @@ public Builder setService(String service) { return this; } - private Builder() {} - private Builder(ServiceName serviceName) { + Preconditions.checkArgument( + serviceName.pathTemplate == PROJECT_SERVICE_PATH_TEMPLATE, + "toBuilder is only supported when ServiceName has the pattern of " + + "projects/{project}/services/{service}."); project = serviceName.project; service = serviceName.service; } @@ -158,14 +269,81 @@ public ServiceName build() { } } + /** Builder for organizations/{organization}/services/{service}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationServiceBuilder { + + private String organization; + private String service; + + private OrganizationServiceBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getService() { + return service; + } + + public OrganizationServiceBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationServiceBuilder setService(String service) { + this.service = service; + return this; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + + /** Builder for folders/{folder}/services/{service}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderServiceBuilder { + + private String folder; + private String service; + + private FolderServiceBuilder() {} + + public String getFolder() { + return folder; + } + + public String getService() { + return service; + } + + public FolderServiceBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderServiceBuilder setService(String service) { + this.service = service; + return this; + } + + public ServiceName build() { + return new ServiceName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof ServiceName) { + if (o != null || getClass() == o.getClass()) { ServiceName that = (ServiceName) o; - return (this.project.equals(that.project)) && (this.service.equals(that.service)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.service, that.service)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -174,9 +352,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(service); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= service.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigName.java b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigName.java index 8dcc9cc6..a00ec050 100644 --- a/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigName.java +++ b/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/UptimeCheckConfigName.java @@ -16,26 +16,42 @@ package com.google.monitoring.v3; +import com.google.api.core.BetaApi; import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") public class UptimeCheckConfigName implements ResourceName { - private static final PathTemplate PATH_TEMPLATE = + @Deprecated + protected UptimeCheckConfigName() {} + + private static final PathTemplate PROJECT_UPTIME_CHECK_CONFIG_PATH_TEMPLATE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/uptimeCheckConfigs/{uptime_check_config}"); + private static final PathTemplate ORGANIZATION_UPTIME_CHECK_CONFIG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}"); + private static final PathTemplate FOLDER_UPTIME_CHECK_CONFIG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/uptimeCheckConfigs/{uptime_check_config}"); private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; - private final String project; - private final String uptimeCheckConfig; + private String project; + private String uptimeCheckConfig; + private String organization; + private String folder; public String getProject() { return project; @@ -45,21 +61,87 @@ public String getUptimeCheckConfig() { return uptimeCheckConfig; } - public static Builder newBuilder() { - return new Builder(); + public String getOrganization() { + return organization; } - public Builder toBuilder() { - return new Builder(this); + public String getFolder() { + return folder; } private UptimeCheckConfigName(Builder builder) { project = Preconditions.checkNotNull(builder.getProject()); uptimeCheckConfig = Preconditions.checkNotNull(builder.getUptimeCheckConfig()); + pathTemplate = PROJECT_UPTIME_CHECK_CONFIG_PATH_TEMPLATE; + } + + private UptimeCheckConfigName(OrganizationUptimeCheckConfigBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + uptimeCheckConfig = Preconditions.checkNotNull(builder.getUptimeCheckConfig()); + pathTemplate = ORGANIZATION_UPTIME_CHECK_CONFIG_PATH_TEMPLATE; + } + + private UptimeCheckConfigName(FolderUptimeCheckConfigBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + uptimeCheckConfig = Preconditions.checkNotNull(builder.getUptimeCheckConfig()); + pathTemplate = FOLDER_UPTIME_CHECK_CONFIG_PATH_TEMPLATE; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectUptimeCheckConfigBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static OrganizationUptimeCheckConfigBuilder newOrganizationUptimeCheckConfigBuilder() { + return new OrganizationUptimeCheckConfigBuilder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static FolderUptimeCheckConfigBuilder newFolderUptimeCheckConfigBuilder() { + return new FolderUptimeCheckConfigBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); } public static UptimeCheckConfigName of(String project, String uptimeCheckConfig) { - return newBuilder().setProject(project).setUptimeCheckConfig(uptimeCheckConfig).build(); + return newProjectUptimeCheckConfigBuilder() + .setProject(project) + .setUptimeCheckConfig(uptimeCheckConfig) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static UptimeCheckConfigName ofProjectUptimeCheckConfigName( + String project, String uptimeCheckConfig) { + return newProjectUptimeCheckConfigBuilder() + .setProject(project) + .setUptimeCheckConfig(uptimeCheckConfig) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static UptimeCheckConfigName ofOrganizationUptimeCheckConfigName( + String organization, String uptimeCheckConfig) { + return newOrganizationUptimeCheckConfigBuilder() + .setOrganization(organization) + .setUptimeCheckConfig(uptimeCheckConfig) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static UptimeCheckConfigName ofFolderUptimeCheckConfigName( + String folder, String uptimeCheckConfig) { + return newFolderUptimeCheckConfigBuilder() + .setFolder(folder) + .setUptimeCheckConfig(uptimeCheckConfig) + .build(); } public static String format(String project, String uptimeCheckConfig) { @@ -70,14 +152,56 @@ public static String format(String project, String uptimeCheckConfig) { .toString(); } + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectUptimeCheckConfigName( + String project, String uptimeCheckConfig) { + return newBuilder() + .setProject(project) + .setUptimeCheckConfig(uptimeCheckConfig) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatOrganizationUptimeCheckConfigName( + String organization, String uptimeCheckConfig) { + return newOrganizationUptimeCheckConfigBuilder() + .setOrganization(organization) + .setUptimeCheckConfig(uptimeCheckConfig) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatFolderUptimeCheckConfigName(String folder, String uptimeCheckConfig) { + return newFolderUptimeCheckConfigBuilder() + .setFolder(folder) + .setUptimeCheckConfig(uptimeCheckConfig) + .build() + .toString(); + } + public static UptimeCheckConfigName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - Map matchMap = - PATH_TEMPLATE.validatedMatch( - formattedString, "UptimeCheckConfigName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("uptime_check_config")); + if (PROJECT_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + PROJECT_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.match(formattedString); + return ofProjectUptimeCheckConfigName( + matchMap.get("project"), matchMap.get("uptime_check_config")); + } else if (ORGANIZATION_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + ORGANIZATION_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.match(formattedString); + return ofOrganizationUptimeCheckConfigName( + matchMap.get("organization"), matchMap.get("uptime_check_config")); + } else if (FOLDER_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = + FOLDER_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.match(formattedString); + return ofFolderUptimeCheckConfigName( + matchMap.get("folder"), matchMap.get("uptime_check_config")); + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -89,7 +213,7 @@ public static List parseList(List formattedString } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (UptimeCheckConfigName value : values) { if (value == null) { list.add(""); @@ -101,16 +225,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.matches(formattedString) + || ORGANIZATION_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.matches(formattedString) + || FOLDER_UPTIME_CHECK_CONFIG_PATH_TEMPLATE.matches(formattedString); } + @Override public Map getFieldValuesMap() { if (fieldValuesMap == null) { synchronized (this) { if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("uptimeCheckConfig", uptimeCheckConfig); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (uptimeCheckConfig != null) { + fieldMapBuilder.put("uptime_check_config", uptimeCheckConfig); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -124,15 +261,17 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "uptime_check_config", uptimeCheckConfig); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } - /** Builder for UptimeCheckConfigName. */ + /** Builder for projects/{project}/uptimeCheckConfigs/{uptime_check_config}. */ public static class Builder { private String project; private String uptimeCheckConfig; + protected Builder() {} + public String getProject() { return project; } @@ -151,9 +290,11 @@ public Builder setUptimeCheckConfig(String uptimeCheckConfig) { return this; } - private Builder() {} - private Builder(UptimeCheckConfigName uptimeCheckConfigName) { + Preconditions.checkArgument( + uptimeCheckConfigName.pathTemplate == PROJECT_UPTIME_CHECK_CONFIG_PATH_TEMPLATE, + "toBuilder is only supported when UptimeCheckConfigName has the pattern of " + + "projects/{project}/uptimeCheckConfigs/{uptime_check_config}."); project = uptimeCheckConfigName.project; uptimeCheckConfig = uptimeCheckConfigName.uptimeCheckConfig; } @@ -163,15 +304,81 @@ public UptimeCheckConfigName build() { } } + /** Builder for organizations/{organization}/uptimeCheckConfigs/{uptime_check_config}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class OrganizationUptimeCheckConfigBuilder { + + private String organization; + private String uptimeCheckConfig; + + private OrganizationUptimeCheckConfigBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getUptimeCheckConfig() { + return uptimeCheckConfig; + } + + public OrganizationUptimeCheckConfigBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationUptimeCheckConfigBuilder setUptimeCheckConfig(String uptimeCheckConfig) { + this.uptimeCheckConfig = uptimeCheckConfig; + return this; + } + + public UptimeCheckConfigName build() { + return new UptimeCheckConfigName(this); + } + } + + /** Builder for folders/{folder}/uptimeCheckConfigs/{uptime_check_config}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class FolderUptimeCheckConfigBuilder { + + private String folder; + private String uptimeCheckConfig; + + private FolderUptimeCheckConfigBuilder() {} + + public String getFolder() { + return folder; + } + + public String getUptimeCheckConfig() { + return uptimeCheckConfig; + } + + public FolderUptimeCheckConfigBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderUptimeCheckConfigBuilder setUptimeCheckConfig(String uptimeCheckConfig) { + this.uptimeCheckConfig = uptimeCheckConfig; + return this; + } + + public UptimeCheckConfigName build() { + return new UptimeCheckConfigName(this); + } + } + @Override public boolean equals(Object o) { if (o == this) { return true; } - if (o instanceof UptimeCheckConfigName) { + if (o != null || getClass() == o.getClass()) { UptimeCheckConfigName that = (UptimeCheckConfigName) o; - return (this.project.equals(that.project)) - && (this.uptimeCheckConfig.equals(that.uptimeCheckConfig)); + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.uptimeCheckConfig, that.uptimeCheckConfig)) + && (Objects.equals(this.organization, that.organization)) + && (Objects.equals(this.folder, that.folder)); } return false; } @@ -180,9 +387,15 @@ public boolean equals(Object o) { public int hashCode() { int h = 1; h *= 1000003; - h ^= project.hashCode(); + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(uptimeCheckConfig); + h *= 1000003; + h ^= Objects.hashCode(organization); h *= 1000003; - h ^= uptimeCheckConfig.hashCode(); + h ^= Objects.hashCode(folder); return h; } } diff --git a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto index 830a514d..6662304d 100644 --- a/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto +++ b/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto @@ -215,19 +215,6 @@ message AlertPolicy { Trigger trigger = 3; } - // A condition type that allows alert policies to be defined using - // Monitoring Query Language. - message TimeSeriesQueryLanguageCondition { - // Monitoring Query Language query that generates time series data and - // describes a condition for alerting on that data. - string query = 1; - - // A short explanation of what the query represents. For example: - // - // "Error ratio exceeds 15% for >5% of servers in >2 regions" - string summary = 2; - } - // Required if the condition exists. The unique resource name for this // condition. Its format is: // @@ -268,11 +255,6 @@ message AlertPolicy { // A condition that checks that a time series continues to // receive new data points. MetricAbsence condition_absent = 2; - - // A condition that uses the Monitoring Query Language to define - // alerts. - // If set, no other conditions can be present. - TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14; } } diff --git a/synth.metadata b/synth.metadata index 8da26e00..3bcb7183 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-monitoring.git", - "sha": "ad5dc73d8a99ded1dbd9152fe5b5152cb06aace5" + "sha": "6ed9f56add0f760b00c5250bbe80f2b87d02bd22" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "101d31acd73076c52d78e18322be01f3debe8cb5", - "internalRef": "306855444" + "sha": "123873dc7e2be35252d172205f67a375e70e9747", + "internalRef": "311581003" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "f395615039665af6599f69305efcd886685e74f9" } } ],