From 66f448033b8513186040a45863d7431f82b69454 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 9 Feb 2021 10:24:04 -0800 Subject: [PATCH] docs: generate sample code in the Java microgenerator (#419) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/89565b2d-2643-4c84-a434-564a46601538/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 356341083 Source-Link: https://github.com/googleapis/googleapis/commit/8d8c008e56f1af31d57f75561e0f1848ffb29eeb --- .../v3/AlertPolicyServiceClient.java | 319 ++++++++ .../monitoring/v3/GroupServiceClient.java | 366 +++++++++ .../monitoring/v3/MetricServiceClient.java | 606 ++++++++++++++ .../v3/NotificationChannelServiceClient.java | 759 ++++++++++++++++++ .../v3/ServiceMonitoringServiceClient.java | 622 ++++++++++++++ .../v3/UptimeCheckServiceClient.java | 389 +++++++++ .../cloud/monitoring/v3/package-info.java | 54 ++ synth.metadata | 6 +- 8 files changed, 3118 insertions(+), 3 deletions(-) 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 4fa41dca..f773ca0e 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 @@ -59,6 +59,14 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+ *   AlertPolicyName name =
+ *       AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the AlertPolicyServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -165,6 +173,17 @@ public AlertPolicyServiceStub getStub() { /** * Lists the existing alerting policies for the project. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose alert policies are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policies to be @@ -185,6 +204,17 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ResourceName name) /** * Lists the existing alerting policies for the project. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose alert policies are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policies to be @@ -205,6 +235,17 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(OrganizationName n /** * Lists the existing alerting policies for the project. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose alert policies are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policies to be @@ -225,6 +266,18 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ProjectName name) /** * Lists the existing alerting policies for the project. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   String name =
+   *       AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]").toString();
+   *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose alert policies are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policies to be @@ -242,6 +295,26 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(String name) { /** * Lists the existing alerting policies for the project. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   ListAlertPoliciesRequest request =
+   *       ListAlertPoliciesRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(request).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 */ @@ -254,6 +327,27 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR * Lists the existing alerting policies for the project. * *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   ListAlertPoliciesRequest request =
+   *       ListAlertPoliciesRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       alertPolicyServiceClient.listAlertPoliciesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (AlertPolicy element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listAlertPoliciesPagedCallable() { @@ -265,6 +359,24 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR * Lists the existing alerting policies for the project. * *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   while (true) {
+   *     ListAlertPoliciesResponse response =
+   *         alertPolicyServiceClient.listAlertPoliciesCallable().call(request);
+   *     for (AlertPolicy element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listAlertPoliciesCallable() { @@ -275,6 +387,16 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR /** * Gets a single alerting policy. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -289,6 +411,16 @@ public final AlertPolicy getAlertPolicy(AlertPolicyName name) { /** * Gets a single alerting policy. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -302,6 +434,20 @@ public final AlertPolicy getAlertPolicy(String name) { /** * Gets a single alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   GetAlertPolicyRequest request =
+   *       GetAlertPolicyRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(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 */ @@ -314,6 +460,21 @@ public final AlertPolicy getAlertPolicy(GetAlertPolicyRequest request) { * Gets a single alerting policy. * *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   GetAlertPolicyRequest request =
+   *       GetAlertPolicyRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       alertPolicyServiceClient.getAlertPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   AlertPolicy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getAlertPolicyCallable() { return stub.getAlertPolicyCallable(); @@ -323,6 +484,16 @@ public final UnaryCallable getAlertPolicyCal /** * Creates a new alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
+   *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name, alertPolicy);
+   * }
+   * }
+ * * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be @@ -347,6 +518,16 @@ public final AlertPolicy createAlertPolicy(ResourceName name, AlertPolicy alertP /** * Creates a new alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
+   *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name, alertPolicy);
+   * }
+   * }
+ * * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be @@ -371,6 +552,16 @@ public final AlertPolicy createAlertPolicy(OrganizationName name, AlertPolicy al /** * Creates a new alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
+   *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name, alertPolicy);
+   * }
+   * }
+ * * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be @@ -395,6 +586,17 @@ public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPo /** * Creates a new alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   String name =
+   *       AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]").toString();
+   *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
+   *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name, alertPolicy);
+   * }
+   * }
+ * * @param name Required. The project in which to create the alerting policy. The format is: *

projects/[PROJECT_ID_OR_NUMBER] *

Note that this field names the parent container in which the alerting policy will be @@ -416,6 +618,21 @@ public final AlertPolicy createAlertPolicy(String name, AlertPolicy alertPolicy) /** * Creates a new alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   CreateAlertPolicyRequest request =
+   *       CreateAlertPolicyRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .setAlertPolicy(AlertPolicy.newBuilder().build())
+   *           .build();
+   *   AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(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 */ @@ -428,6 +645,22 @@ public final AlertPolicy createAlertPolicy(CreateAlertPolicyRequest request) { * Creates a new alerting policy. * *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   CreateAlertPolicyRequest request =
+   *       CreateAlertPolicyRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .setAlertPolicy(AlertPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       alertPolicyServiceClient.createAlertPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   AlertPolicy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createAlertPolicyCallable() { return stub.createAlertPolicyCallable(); @@ -437,6 +670,16 @@ public final UnaryCallable createAlertPol /** * Deletes an alerting policy. * + *

Sample code: + * + *

{@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]. @@ -454,6 +697,16 @@ public final void deleteAlertPolicy(AlertPolicyName name) { /** * Deletes an alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   String name =
+   *       AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]").toString();
+   *   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]. @@ -468,6 +721,20 @@ public final void deleteAlertPolicy(String name) { /** * Deletes an alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   DeleteAlertPolicyRequest request =
+   *       DeleteAlertPolicyRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .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 */ @@ -480,6 +747,21 @@ public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) { * Deletes an alerting policy. * *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   DeleteAlertPolicyRequest request =
+   *       DeleteAlertPolicyRequest.newBuilder()
+   *           .setName(
+   *               AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteAlertPolicyCallable() { return stub.deleteAlertPolicyCallable(); @@ -491,6 +773,16 @@ public final UnaryCallable deleteAlertPolicyCal * only certain fields in the current alerting policy by specifying the fields to be updated via * `updateMask`. Returns the updated alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
+   *   AlertPolicy response = alertPolicyServiceClient.updateAlertPolicy(updateMask, alertPolicy);
+   * }
+   * }
+ * * @param updateMask Optional. A list of alerting policy field names. If this field is not empty, * each listed field in the existing alerting policy is set to the value of the corresponding * field in the supplied policy (`alert_policy`), or to the field's default value if the field @@ -526,6 +818,19 @@ public final AlertPolicy updateAlertPolicy(FieldMask updateMask, AlertPolicy ale * only certain fields in the current alerting policy by specifying the fields to be updated via * `updateMask`. Returns the updated alerting policy. * + *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   UpdateAlertPolicyRequest request =
+   *       UpdateAlertPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAlertPolicy(AlertPolicy.newBuilder().build())
+   *           .build();
+   *   AlertPolicy response = alertPolicyServiceClient.updateAlertPolicy(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 */ @@ -540,6 +845,20 @@ public final AlertPolicy updateAlertPolicy(UpdateAlertPolicyRequest request) { * `updateMask`. Returns the updated alerting policy. * *

Sample code: + * + *

{@code
+   * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+   *   UpdateAlertPolicyRequest request =
+   *       UpdateAlertPolicyRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setAlertPolicy(AlertPolicy.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       alertPolicyServiceClient.updateAlertPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   AlertPolicy response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateAlertPolicyCallable() { return stub.updateAlertPolicyCallable(); 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 d9471edb..4f2acc60 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 @@ -64,6 +64,13 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+ *   Group response = groupServiceClient.getGroup(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the GroupServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -166,6 +173,17 @@ public GroupServiceStub getStub() { /** * Lists the existing groups. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   for (Group element : groupServiceClient.listGroups(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose groups are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -180,6 +198,17 @@ public final ListGroupsPagedResponse listGroups(ResourceName name) { /** * Lists the existing groups. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (Group element : groupServiceClient.listGroups(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose groups are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -194,6 +223,17 @@ public final ListGroupsPagedResponse listGroups(OrganizationName name) { /** * Lists the existing groups. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (Group element : groupServiceClient.listGroups(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose groups are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -208,6 +248,17 @@ public final ListGroupsPagedResponse listGroups(ProjectName name) { /** * Lists the existing groups. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   String name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString();
+   *   for (Group element : groupServiceClient.listGroups(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project whose groups are to be listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -221,6 +272,22 @@ public final ListGroupsPagedResponse listGroups(String name) { /** * Lists the existing groups. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ListGroupsRequest request =
+   *       ListGroupsRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Group element : groupServiceClient.listGroups(request).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 */ @@ -233,6 +300,22 @@ public final ListGroupsPagedResponse listGroups(ListGroupsRequest request) { * Lists the existing groups. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ListGroupsRequest request =
+   *       ListGroupsRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = groupServiceClient.listGroupsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Group element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGroupsPagedCallable() { return stub.listGroupsPagedCallable(); @@ -243,6 +326,23 @@ public final UnaryCallable listGroup * Lists the existing groups. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   while (true) {
+   *     ListGroupsResponse response = groupServiceClient.listGroupsCallable().call(request);
+   *     for (Group element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGroupsCallable() { return stub.listGroupsCallable(); @@ -252,6 +352,15 @@ public final UnaryCallable listGroupsCall /** * Gets a single group. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -266,6 +375,15 @@ public final Group getGroup(GroupName name) { /** * Gets a single group. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -279,6 +397,18 @@ public final Group getGroup(String name) { /** * Gets a single group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GetGroupRequest request =
+   *       GetGroupRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .build();
+   *   Group response = groupServiceClient.getGroup(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 */ @@ -291,6 +421,18 @@ public final Group getGroup(GetGroupRequest request) { * Gets a single group. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GetGroupRequest request =
+   *       GetGroupRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .build();
+   *   ApiFuture future = groupServiceClient.getGroupCallable().futureCall(request);
+   *   // Do something.
+   *   Group response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getGroupCallable() { return stub.getGroupCallable(); @@ -300,6 +442,16 @@ public final UnaryCallable getGroupCallable() { /** * Creates a new group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   Group group = Group.newBuilder().build();
+   *   Group response = groupServiceClient.createGroup(name, group);
+   * }
+   * }
+ * * @param name Required. The project in which to create the group. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param group Required. A group definition. It is an error to define the `name` field because @@ -319,6 +471,16 @@ public final Group createGroup(ResourceName name, Group group) { /** * Creates a new group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   Group group = Group.newBuilder().build();
+   *   Group response = groupServiceClient.createGroup(name, group);
+   * }
+   * }
+ * * @param name Required. The project in which to create the group. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param group Required. A group definition. It is an error to define the `name` field because @@ -338,6 +500,16 @@ public final Group createGroup(OrganizationName name, Group group) { /** * Creates a new group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   Group group = Group.newBuilder().build();
+   *   Group response = groupServiceClient.createGroup(name, group);
+   * }
+   * }
+ * * @param name Required. The project in which to create the group. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param group Required. A group definition. It is an error to define the `name` field because @@ -357,6 +529,16 @@ public final Group createGroup(ProjectName name, Group group) { /** * Creates a new group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   String name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString();
+   *   Group group = Group.newBuilder().build();
+   *   Group response = groupServiceClient.createGroup(name, group);
+   * }
+   * }
+ * * @param name Required. The project in which to create the group. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param group Required. A group definition. It is an error to define the `name` field because @@ -373,6 +555,20 @@ public final Group createGroup(String name, Group group) { /** * Creates a new group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   CreateGroupRequest request =
+   *       CreateGroupRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setGroup(Group.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   Group response = groupServiceClient.createGroup(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 */ @@ -385,6 +581,20 @@ public final Group createGroup(CreateGroupRequest request) { * Creates a new group. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   CreateGroupRequest request =
+   *       CreateGroupRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setGroup(Group.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = groupServiceClient.createGroupCallable().futureCall(request);
+   *   // Do something.
+   *   Group response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createGroupCallable() { return stub.createGroupCallable(); @@ -394,6 +604,15 @@ public final UnaryCallable createGroupCallable() { /** * Updates an existing group. You can change any group attributes except `name`. * + *

Sample code: + * + *

{@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 @@ -407,6 +626,19 @@ public final Group updateGroup(Group group) { /** * Updates an existing group. You can change any group attributes except `name`. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   UpdateGroupRequest request =
+   *       UpdateGroupRequest.newBuilder()
+   *           .setGroup(Group.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .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 */ @@ -419,6 +651,19 @@ public final Group updateGroup(UpdateGroupRequest request) { * Updates an existing group. You can change any group attributes except `name`. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   UpdateGroupRequest request =
+   *       UpdateGroupRequest.newBuilder()
+   *           .setGroup(Group.newBuilder().build())
+   *           .setValidateOnly(true)
+   *           .build();
+   *   ApiFuture future = groupServiceClient.updateGroupCallable().futureCall(request);
+   *   // Do something.
+   *   Group response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateGroupCallable() { return stub.updateGroupCallable(); @@ -428,6 +673,15 @@ public final UnaryCallable updateGroupCallable() { /** * Deletes an existing group. * + *

Sample code: + * + *

{@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 @@ -442,6 +696,15 @@ public final void deleteGroup(GroupName name) { /** * Deletes an existing group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   String name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString();
+   *   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 @@ -455,6 +718,19 @@ public final void deleteGroup(String name) { /** * Deletes an existing group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   DeleteGroupRequest request =
+   *       DeleteGroupRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setRecursive(true)
+   *           .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 */ @@ -467,6 +743,19 @@ public final void deleteGroup(DeleteGroupRequest request) { * Deletes an existing group. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   DeleteGroupRequest request =
+   *       DeleteGroupRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setRecursive(true)
+   *           .build();
+   *   ApiFuture future = groupServiceClient.deleteGroupCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteGroupCallable() { return stub.deleteGroupCallable(); @@ -476,6 +765,17 @@ public final UnaryCallable deleteGroupCallable() { /** * Lists the monitored resources that are members of a group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+   *   for (MonitoredResource element : groupServiceClient.listGroupMembers(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The group whose members are listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -490,6 +790,17 @@ public final ListGroupMembersPagedResponse listGroupMembers(GroupName name) { /** * Lists the monitored resources that are members of a group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   String name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString();
+   *   for (MonitoredResource element : groupServiceClient.listGroupMembers(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The group whose members are listed. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -503,6 +814,24 @@ public final ListGroupMembersPagedResponse listGroupMembers(String name) { /** * Lists the monitored resources that are members of a group. * + *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ListGroupMembersRequest request =
+   *       ListGroupMembersRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setInterval(TimeInterval.newBuilder().build())
+   *           .build();
+   *   for (MonitoredResource element : groupServiceClient.listGroupMembers(request).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 */ @@ -515,6 +844,25 @@ public final ListGroupMembersPagedResponse listGroupMembers(ListGroupMembersRequ * Lists the monitored resources that are members of a group. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   ListGroupMembersRequest request =
+   *       ListGroupMembersRequest.newBuilder()
+   *           .setName(GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setInterval(TimeInterval.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       groupServiceClient.listGroupMembersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (MonitoredResource element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGroupMembersPagedCallable() { @@ -526,6 +874,24 @@ public final ListGroupMembersPagedResponse listGroupMembers(ListGroupMembersRequ * Lists the monitored resources that are members of a group. * *

Sample code: + * + *

{@code
+   * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+   *   while (true) {
+   *     ListGroupMembersResponse response =
+   *         groupServiceClient.listGroupMembersCallable().call(request);
+   *     for (MonitoredResource element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listGroupMembersCallable() { 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 90916859..fce5c46f 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 @@ -63,6 +63,16 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+ *   MonitoredResourceDescriptorName name =
+ *       MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+ *           "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ *   MonitoredResourceDescriptor response =
+ *       metricServiceClient.getMonitoredResourceDescriptor(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the MetricServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -167,6 +177,18 @@ public MetricServiceStub getStub() { * Lists monitored resource descriptors that match a filter. This method does not require a * Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   for (MonitoredResourceDescriptor element :
+   *       metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -185,6 +207,18 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * Lists monitored resource descriptors that match a filter. This method does not require a * Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (MonitoredResourceDescriptor element :
+   *       metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -203,6 +237,18 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * Lists monitored resource descriptors that match a filter. This method does not require a * Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (MonitoredResourceDescriptor element :
+   *       metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -221,6 +267,21 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * Lists monitored resource descriptors that match a filter. This method does not require a * Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name =
+   *       MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *               "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
+   *           .toString();
+   *   for (MonitoredResourceDescriptor element :
+   *       metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -237,6 +298,27 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * Lists monitored resource descriptors that match a filter. This method does not require a * Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request =
+   *       ListMonitoredResourceDescriptorsRequest.newBuilder()
+   *           .setName(
+   *               MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *                       "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (MonitoredResourceDescriptor element :
+   *       metricServiceClient.listMonitoredResourceDescriptors(request).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 */ @@ -251,6 +333,27 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request =
+   *       ListMonitoredResourceDescriptorsRequest.newBuilder()
+   *           .setName(
+   *               MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *                       "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (MonitoredResourceDescriptor element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse> @@ -264,6 +367,24 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource * Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   while (true) {
+   *     ListMonitoredResourceDescriptorsResponse response =
+   *         metricServiceClient.listMonitoredResourceDescriptorsCallable().call(request);
+   *     for (MonitoredResourceDescriptor element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> @@ -275,6 +396,18 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource /** * Gets a single monitored resource descriptor. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   MonitoredResourceDescriptorName name =
+   *       MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *           "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+   *   MonitoredResourceDescriptor response =
+   *       metricServiceClient.getMonitoredResourceDescriptor(name);
+   * }
+   * }
+ * * @param name Required. The monitored resource descriptor to get. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] *

The `[RESOURCE_TYPE]` is a predefined type, such as `cloudsql_database`. @@ -293,6 +426,19 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor( /** * Gets a single monitored resource descriptor. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name =
+   *       MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *               "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
+   *           .toString();
+   *   MonitoredResourceDescriptor response =
+   *       metricServiceClient.getMonitoredResourceDescriptor(name);
+   * }
+   * }
+ * * @param name Required. The monitored resource descriptor to get. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE] *

The `[RESOURCE_TYPE]` is a predefined type, such as `cloudsql_database`. @@ -308,6 +454,22 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String n /** * Gets a single monitored resource descriptor. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   GetMonitoredResourceDescriptorRequest request =
+   *       GetMonitoredResourceDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *                       "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   MonitoredResourceDescriptor response =
+   *       metricServiceClient.getMonitoredResourceDescriptor(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 */ @@ -321,6 +483,22 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor( * Gets a single monitored resource descriptor. This method does not require a Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   GetMonitoredResourceDescriptorRequest request =
+   *       GetMonitoredResourceDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+   *                       "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.getMonitoredResourceDescriptorCallable().futureCall(request);
+   *   // Do something.
+   *   MonitoredResourceDescriptor response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getMonitoredResourceDescriptorCallable() { @@ -331,6 +509,18 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor( /** * Lists metric descriptors that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   for (MetricDescriptor element :
+   *       metricServiceClient.listMetricDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -347,6 +537,18 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ResourceNa /** * Lists metric descriptors that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (MetricDescriptor element :
+   *       metricServiceClient.listMetricDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -363,6 +565,18 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(Organizati /** * Lists metric descriptors that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (MetricDescriptor element :
+   *       metricServiceClient.listMetricDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -379,6 +593,20 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectNam /** * Lists metric descriptors that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name =
+   *       MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *           .toString();
+   *   for (MetricDescriptor element :
+   *       metricServiceClient.listMetricDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -393,6 +621,27 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(String nam /** * Lists metric descriptors that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ListMetricDescriptorsRequest request =
+   *       ListMetricDescriptorsRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (MetricDescriptor element :
+   *       metricServiceClient.listMetricDescriptors(request).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 */ @@ -406,6 +655,27 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors( * Lists metric descriptors that match a filter. This method does not require a Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ListMetricDescriptorsRequest request =
+   *       ListMetricDescriptorsRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.listMetricDescriptorsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (MetricDescriptor element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listMetricDescriptorsPagedCallable() { @@ -417,6 +687,24 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors( * Lists metric descriptors that match a filter. This method does not require a Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   while (true) {
+   *     ListMetricDescriptorsResponse response =
+   *         metricServiceClient.listMetricDescriptorsCallable().call(request);
+   *     for (MetricDescriptor element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listMetricDescriptorsCallable() { @@ -427,6 +715,16 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors( /** * Gets a single metric descriptor. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   MetricDescriptorName name =
+   *       MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   MetricDescriptor response = metricServiceClient.getMetricDescriptor(name);
+   * }
+   * }
+ * * @param name Required. The metric descriptor on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] *

An example value of `[METRIC_ID]` is @@ -445,6 +743,17 @@ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) { /** * Gets a single metric descriptor. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name =
+   *       MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *           .toString();
+   *   MetricDescriptor response = metricServiceClient.getMetricDescriptor(name);
+   * }
+   * }
+ * * @param name Required. The metric descriptor on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] *

An example value of `[METRIC_ID]` is @@ -461,6 +770,21 @@ public final MetricDescriptor getMetricDescriptor(String name) { /** * Gets a single metric descriptor. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   GetMetricDescriptorRequest request =
+   *       GetMetricDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   MetricDescriptor response = metricServiceClient.getMetricDescriptor(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 */ @@ -473,6 +797,22 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req * Gets a single metric descriptor. This method does not require a Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   GetMetricDescriptorRequest request =
+   *       GetMetricDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.getMetricDescriptorCallable().futureCall(request);
+   *   // Do something.
+   *   MetricDescriptor response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getMetricDescriptorCallable() { @@ -484,6 +824,17 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req * Creates a new metric descriptor. User-created metric descriptors define [custom * metrics](https://cloud.google.com/monitoring/custom-metrics). * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
+   *   MetricDescriptor response =
+   *       metricServiceClient.createMetricDescriptor(name, metricDescriptor);
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param metricDescriptor Required. The new [custom @@ -505,6 +856,17 @@ public final MetricDescriptor createMetricDescriptor( * Creates a new metric descriptor. User-created metric descriptors define [custom * metrics](https://cloud.google.com/monitoring/custom-metrics). * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
+   *   MetricDescriptor response =
+   *       metricServiceClient.createMetricDescriptor(name, metricDescriptor);
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param metricDescriptor Required. The new [custom @@ -526,6 +888,17 @@ public final MetricDescriptor createMetricDescriptor( * Creates a new metric descriptor. User-created metric descriptors define [custom * metrics](https://cloud.google.com/monitoring/custom-metrics). * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
+   *   MetricDescriptor response =
+   *       metricServiceClient.createMetricDescriptor(name, metricDescriptor);
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param metricDescriptor Required. The new [custom @@ -547,6 +920,19 @@ public final MetricDescriptor createMetricDescriptor( * Creates a new metric descriptor. User-created metric descriptors define [custom * metrics](https://cloud.google.com/monitoring/custom-metrics). * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name =
+   *       MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *           .toString();
+   *   MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
+   *   MetricDescriptor response =
+   *       metricServiceClient.createMetricDescriptor(name, metricDescriptor);
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param metricDescriptor Required. The new [custom @@ -568,6 +954,22 @@ public final MetricDescriptor createMetricDescriptor( * Creates a new metric descriptor. User-created metric descriptors define [custom * metrics](https://cloud.google.com/monitoring/custom-metrics). * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   CreateMetricDescriptorRequest request =
+   *       CreateMetricDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .setMetricDescriptor(MetricDescriptor.newBuilder().build())
+   *           .build();
+   *   MetricDescriptor response = metricServiceClient.createMetricDescriptor(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 */ @@ -581,6 +983,23 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque * metrics](https://cloud.google.com/monitoring/custom-metrics). * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   CreateMetricDescriptorRequest request =
+   *       CreateMetricDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .setMetricDescriptor(MetricDescriptor.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.createMetricDescriptorCallable().futureCall(request);
+   *   // Do something.
+   *   MetricDescriptor response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createMetricDescriptorCallable() { @@ -592,6 +1011,16 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque * Deletes a metric descriptor. Only user-created [custom * metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   MetricDescriptorName name =
+   *       MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
+   *   metricServiceClient.deleteMetricDescriptor(name);
+   * }
+   * }
+ * * @param name Required. The metric descriptor on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] *

An example of `[METRIC_ID]` is: `"custom.googleapis.com/my_test_metric"`. @@ -610,6 +1039,17 @@ public final void deleteMetricDescriptor(MetricDescriptorName name) { * Deletes a metric descriptor. Only user-created [custom * metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name =
+   *       MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *           .toString();
+   *   metricServiceClient.deleteMetricDescriptor(name);
+   * }
+   * }
+ * * @param name Required. The metric descriptor on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] *

An example of `[METRIC_ID]` is: `"custom.googleapis.com/my_test_metric"`. @@ -626,6 +1066,21 @@ public final void deleteMetricDescriptor(String name) { * Deletes a metric descriptor. Only user-created [custom * metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   DeleteMetricDescriptorRequest request =
+   *       DeleteMetricDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   metricServiceClient.deleteMetricDescriptor(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 */ @@ -639,6 +1094,22 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request) * metrics](https://cloud.google.com/monitoring/custom-metrics) can be deleted. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   DeleteMetricDescriptorRequest request =
+   *       DeleteMetricDescriptorRequest.newBuilder()
+   *           .setName(
+   *               MetricDescriptorName.ofProjectMetricDescriptorName(
+   *                       "[PROJECT]", "[METRIC_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.deleteMetricDescriptorCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteMetricDescriptorCallable() { @@ -649,6 +1120,21 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request) /** * Lists time series that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   String filter = "filter-1274492040";
+   *   TimeInterval interval = TimeInterval.newBuilder().build();
+   *   ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
+   *   for (TimeSeries element :
+   *       metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param filter Required. A [monitoring @@ -681,6 +1167,21 @@ public final ListTimeSeriesPagedResponse listTimeSeries( /** * Lists time series that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   String filter = "filter-1274492040";
+   *   TimeInterval interval = TimeInterval.newBuilder().build();
+   *   ListTimeSeriesRequest.TimeSeriesView view = ListTimeSeriesRequest.TimeSeriesView.forNumber(0);
+   *   for (TimeSeries element :
+   *       metricServiceClient.listTimeSeries(name, filter, interval, view).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param filter Required. A [monitoring @@ -713,6 +1214,26 @@ public final ListTimeSeriesPagedResponse listTimeSeries( /** * Lists time series that match a filter. This method does not require a Workspace. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ListTimeSeriesRequest request =
+   *       ListTimeSeriesRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setInterval(TimeInterval.newBuilder().build())
+   *           .setAggregation(Aggregation.newBuilder().build())
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (TimeSeries element : metricServiceClient.listTimeSeries(request).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 */ @@ -725,6 +1246,27 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re * Lists time series that match a filter. This method does not require a Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ListTimeSeriesRequest request =
+   *       ListTimeSeriesRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setInterval(TimeInterval.newBuilder().build())
+   *           .setAggregation(Aggregation.newBuilder().build())
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       metricServiceClient.listTimeSeriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (TimeSeries element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listTimeSeriesPagedCallable() { @@ -736,6 +1278,24 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re * Lists time series that match a filter. This method does not require a Workspace. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   while (true) {
+   *     ListTimeSeriesResponse response =
+   *         metricServiceClient.listTimeSeriesCallable().call(request);
+   *     for (TimeSeries element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listTimeSeriesCallable() { @@ -748,6 +1308,16 @@ public final ListTimeSeriesPagedResponse listTimeSeries(ListTimeSeriesRequest re * the request were written. If any time series could not be written, a corresponding failure * message is included in the error response. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   List timeSeries = new ArrayList<>();
+   *   metricServiceClient.createTimeSeries(name, timeSeries);
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param timeSeries Required. The new data to be added to a list of time series. Adds at most one @@ -772,6 +1342,16 @@ public final void createTimeSeries(ProjectName name, List timeSeries * the request were written. If any time series could not be written, a corresponding failure * message is included in the error response. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   String name = ProjectName.of("[PROJECT]").toString();
+   *   List timeSeries = new ArrayList<>();
+   *   metricServiceClient.createTimeSeries(name, timeSeries);
+   * }
+   * }
+ * * @param name Required. The project on which to execute the request. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param timeSeries Required. The new data to be added to a list of time series. Adds at most one @@ -793,6 +1373,19 @@ public final void createTimeSeries(String name, List timeSeries) { * the request were written. If any time series could not be written, a corresponding failure * message is included in the error response. * + *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   CreateTimeSeriesRequest request =
+   *       CreateTimeSeriesRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .addAllTimeSeries(new ArrayList())
+   *           .build();
+   *   metricServiceClient.createTimeSeries(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 */ @@ -807,6 +1400,19 @@ public final void createTimeSeries(CreateTimeSeriesRequest request) { * message is included in the error response. * *

Sample code: + * + *

{@code
+   * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+   *   CreateTimeSeriesRequest request =
+   *       CreateTimeSeriesRequest.newBuilder()
+   *           .setName(ProjectName.of("[PROJECT]").toString())
+   *           .addAllTimeSeries(new ArrayList())
+   *           .build();
+   *   ApiFuture future = metricServiceClient.createTimeSeriesCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable createTimeSeriesCallable() { return stub.createTimeSeriesCallable(); 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 5d334cd7..033bbe4b 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 @@ -64,6 +64,17 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (NotificationChannelServiceClient notificationChannelServiceClient =
+ *     NotificationChannelServiceClient.create()) {
+ *   NotificationChannelDescriptorName name =
+ *       NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+ *           "[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+ *   NotificationChannelDescriptor response =
+ *       notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the NotificationChannelServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -173,6 +184,19 @@ public NotificationChannelServiceStub getStub() { * Lists the descriptors for supported channel types. The use of descriptors makes it possible for * new channel types to be dynamically added. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   for (NotificationChannelDescriptor element :
+   *       notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @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] @@ -196,6 +220,19 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * Lists the descriptors for supported channel types. The use of descriptors makes it possible for * new channel types to be dynamically added. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   for (NotificationChannelDescriptor element :
+   *       notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @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] @@ -219,6 +256,19 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * Lists the descriptors for supported channel types. The use of descriptors makes it possible for * new channel types to be dynamically added. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   for (NotificationChannelDescriptor element :
+   *       notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @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] @@ -242,6 +292,22 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * Lists the descriptors for supported channel types. The use of descriptors makes it possible for * new channel types to be dynamically added. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *               "[PROJECT]", "[CHANNEL_DESCRIPTOR]")
+   *           .toString();
+   *   for (NotificationChannelDescriptor element :
+   *       notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @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] @@ -263,6 +329,29 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * Lists the descriptors for supported channel types. The use of descriptors makes it possible for * new channel types to be dynamically added. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ListNotificationChannelDescriptorsRequest request =
+   *       ListNotificationChannelDescriptorsRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *                       "[PROJECT]", "[CHANNEL_DESCRIPTOR]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (NotificationChannelDescriptor element :
+   *       notificationChannelServiceClient
+   *           .listNotificationChannelDescriptors(request)
+   *           .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 */ @@ -277,6 +366,29 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * new channel types to be dynamically added. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ListNotificationChannelDescriptorsRequest request =
+   *       ListNotificationChannelDescriptorsRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *                       "[PROJECT]", "[CHANNEL_DESCRIPTOR]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient
+   *           .listNotificationChannelDescriptorsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (NotificationChannelDescriptor element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListNotificationChannelDescriptorsRequest, @@ -291,6 +403,27 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * new channel types to be dynamically added. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   while (true) {
+   *     ListNotificationChannelDescriptorsResponse response =
+   *         notificationChannelServiceClient
+   *             .listNotificationChannelDescriptorsCallable()
+   *             .call(request);
+   *     for (NotificationChannelDescriptor element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse> @@ -303,6 +436,19 @@ public final ListNotificationChannelDescriptorsPagedResponse listNotificationCha * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   NotificationChannelDescriptorName name =
+   *       NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *           "[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+   *   NotificationChannelDescriptor response =
+   *       notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+   * }
+   * }
+ * * @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 @@ -321,6 +467,20 @@ public final NotificationChannelDescriptor getNotificationChannelDescriptor( * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *               "[PROJECT]", "[CHANNEL_DESCRIPTOR]")
+   *           .toString();
+   *   NotificationChannelDescriptor response =
+   *       notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+   * }
+   * }
+ * * @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 @@ -336,6 +496,23 @@ public final NotificationChannelDescriptor getNotificationChannelDescriptor(Stri * Gets a single channel descriptor. The descriptor indicates which fields are expected / * permitted for a notification channel of the given type. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   GetNotificationChannelDescriptorRequest request =
+   *       GetNotificationChannelDescriptorRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *                       "[PROJECT]", "[CHANNEL_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   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 */ @@ -350,6 +527,25 @@ public final NotificationChannelDescriptor getNotificationChannelDescriptor( * permitted for a notification channel of the given type. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   GetNotificationChannelDescriptorRequest request =
+   *       GetNotificationChannelDescriptorRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+   *                       "[PROJECT]", "[CHANNEL_DESCRIPTOR]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient
+   *           .getNotificationChannelDescriptorCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   NotificationChannelDescriptor response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getNotificationChannelDescriptorCallable() { @@ -360,6 +556,19 @@ public final NotificationChannelDescriptor getNotificationChannelDescriptor( /** * Lists the notification channels that have been created for the project. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   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 in which to look for the notification channels; it does not @@ -380,6 +589,19 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Reso /** * Lists the notification channels that have been created for the project. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   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 in which to look for the notification channels; it does not @@ -401,6 +623,19 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( /** * Lists the notification channels that have been created for the project. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ProjectName 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 in which to look for the notification channels; it does not @@ -421,6 +656,22 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Proj /** * Lists the notification channels that have been created for the project. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   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 in which to look for the notification channels; it does not @@ -439,6 +690,29 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Stri /** * Lists the notification channels that have been created for the project. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ListNotificationChannelsRequest request =
+   *       ListNotificationChannelsRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (NotificationChannel element :
+   *       notificationChannelServiceClient.listNotificationChannels(request).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 */ @@ -452,6 +726,31 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( * Lists the notification channels that have been created for the project. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ListNotificationChannelsRequest request =
+   *       ListNotificationChannelsRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient
+   *           .listNotificationChannelsPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (NotificationChannel element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listNotificationChannelsPagedCallable() { @@ -463,6 +762,25 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( * Lists the notification channels that have been created for the project. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   while (true) {
+   *     ListNotificationChannelsResponse response =
+   *         notificationChannelServiceClient.listNotificationChannelsCallable().call(request);
+   *     for (NotificationChannel element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listNotificationChannelsCallable() { @@ -476,6 +794,18 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels( * 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: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   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] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -495,6 +825,19 @@ public final NotificationChannel getNotificationChannel(NotificationChannelName * 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: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   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] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -512,6 +855,23 @@ public final NotificationChannel getNotificationChannel(String name) { * 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: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   GetNotificationChannelRequest request =
+   *       GetNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .build();
+   *   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 */ @@ -527,6 +887,23 @@ public final NotificationChannel getNotificationChannel(GetNotificationChannelRe * information that was supplied in the call to the create method. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   GetNotificationChannelRequest request =
+   *       GetNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient.getNotificationChannelCallable().futureCall(request);
+   *   // Do something.
+   *   NotificationChannel response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getNotificationChannelCallable() { @@ -538,6 +915,18 @@ public final NotificationChannel getNotificationChannel(GetNotificationChannelRe * Creates a new notification channel, representing a single notification endpoint such as an * email address, SMS number, or PagerDuty service. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ResourceName name = ResourceName.of("[FOLDER]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
+   * }
+   * }
+ * * @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 @@ -562,6 +951,18 @@ public final NotificationChannel createNotificationChannel( * Creates a new notification channel, representing a single notification endpoint such as an * email address, SMS number, or PagerDuty service. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   OrganizationName name = OrganizationName.of("[ORGANIZATION]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
+   * }
+   * }
+ * * @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 @@ -586,6 +987,18 @@ public final NotificationChannel createNotificationChannel( * Creates a new notification channel, representing a single notification endpoint such as an * email address, SMS number, or PagerDuty service. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   ProjectName name = ProjectName.of("[PROJECT]");
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
+   * }
+   * }
+ * * @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 @@ -610,6 +1023,21 @@ public final NotificationChannel createNotificationChannel( * Creates a new notification channel, representing a single notification endpoint such as an * email address, SMS number, or PagerDuty service. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
+   * }
+   * }
+ * * @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 @@ -634,6 +1062,24 @@ public final NotificationChannel createNotificationChannel( * Creates a new notification channel, representing a single notification endpoint such as an * email address, SMS number, or PagerDuty service. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   CreateNotificationChannelRequest request =
+   *       CreateNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setNotificationChannel(NotificationChannel.newBuilder().build())
+   *           .build();
+   *   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 */ @@ -648,6 +1094,24 @@ public final NotificationChannel createNotificationChannel( * email address, SMS number, or PagerDuty service. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   CreateNotificationChannelRequest request =
+   *       CreateNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setNotificationChannel(NotificationChannel.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient.createNotificationChannelCallable().futureCall(request);
+   *   // Do something.
+   *   NotificationChannel response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createNotificationChannelCallable() { @@ -658,6 +1122,19 @@ public final NotificationChannel createNotificationChannel( /** * Updates a notification channel. Fields not specified in the field mask remain unchanged. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.updateNotificationChannel(
+   *           updateMask, notificationChannel);
+   * }
+   * }
+ * * @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 @@ -678,6 +1155,21 @@ public final NotificationChannel updateNotificationChannel( /** * Updates a notification channel. Fields not specified in the field mask remain unchanged. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   UpdateNotificationChannelRequest request =
+   *       UpdateNotificationChannelRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationChannel(NotificationChannel.newBuilder().build())
+   *           .build();
+   *   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 */ @@ -691,6 +1183,21 @@ public final NotificationChannel updateNotificationChannel( * Updates a notification channel. Fields not specified in the field mask remain unchanged. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   UpdateNotificationChannelRequest request =
+   *       UpdateNotificationChannelRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setNotificationChannel(NotificationChannel.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient.updateNotificationChannelCallable().futureCall(request);
+   *   // Do something.
+   *   NotificationChannel response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateNotificationChannelCallable() { @@ -701,6 +1208,19 @@ public final NotificationChannel updateNotificationChannel( /** * Deletes a notification channel. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   NotificationChannelName name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *           "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   boolean force = true;
+   *   notificationChannelServiceClient.deleteNotificationChannel(name, force);
+   * }
+   * }
+ * * @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 @@ -722,6 +1242,20 @@ public final void deleteNotificationChannel(NotificationChannelName name, boolea /** * Deletes a notification channel. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   boolean force = true;
+   *   notificationChannelServiceClient.deleteNotificationChannel(name, force);
+   * }
+   * }
+ * * @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 @@ -740,6 +1274,23 @@ public final void deleteNotificationChannel(String name, boolean force) { /** * Deletes a notification channel. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   DeleteNotificationChannelRequest request =
+   *       DeleteNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setForce(true)
+   *           .build();
+   *   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 */ @@ -752,6 +1303,24 @@ public final void deleteNotificationChannel(DeleteNotificationChannelRequest req * Deletes a notification channel. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   DeleteNotificationChannelRequest request =
+   *       DeleteNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setForce(true)
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient.deleteNotificationChannelCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteNotificationChannelCallable() { @@ -763,6 +1332,18 @@ public final void deleteNotificationChannel(DeleteNotificationChannelRequest req * Causes a verification code to be delivered to the channel. The code can then be supplied in * `VerifyNotificationChannel` to verify the channel. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   NotificationChannelName name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *           "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(name);
+   * }
+   * }
+ * * @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 */ @@ -779,6 +1360,19 @@ public final void sendNotificationChannelVerificationCode(NotificationChannelNam * Causes a verification code to be delivered to the channel. The code can then be supplied in * `VerifyNotificationChannel` to verify the channel. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   notificationChannelServiceClient.sendNotificationChannelVerificationCode(name);
+   * }
+   * }
+ * * @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 */ @@ -793,6 +1387,22 @@ public final void sendNotificationChannelVerificationCode(String name) { * Causes a verification code to be delivered to the channel. The code can then be supplied in * `VerifyNotificationChannel` to verify the channel. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   SendNotificationChannelVerificationCodeRequest request =
+   *       SendNotificationChannelVerificationCodeRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .build();
+   *   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 */ @@ -807,6 +1417,25 @@ public final void sendNotificationChannelVerificationCode( * `VerifyNotificationChannel` to verify the channel. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   SendNotificationChannelVerificationCodeRequest request =
+   *       SendNotificationChannelVerificationCodeRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient
+   *           .sendNotificationChannelVerificationCodeCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable sendNotificationChannelVerificationCodeCallable() { @@ -832,6 +1461,19 @@ public final void sendNotificationChannelVerificationCode( * 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: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   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. @@ -865,6 +1507,20 @@ public final void sendNotificationChannelVerificationCode( * 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: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   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. @@ -896,6 +1552,24 @@ public final void sendNotificationChannelVerificationCode( * 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: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   GetNotificationChannelVerificationCodeRequest request =
+   *       GetNotificationChannelVerificationCodeRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   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 */ @@ -925,6 +1599,26 @@ public final void sendNotificationChannelVerificationCode( * a much longer, websafe base 64 encoded string that has a longer expiration time. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   GetNotificationChannelVerificationCodeRequest request =
+   *       GetNotificationChannelVerificationCodeRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient
+   *           .getNotificationChannelVerificationCodeCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   GetNotificationChannelVerificationCodeResponse response = future.get();
+   * }
+   * }
*/ public final UnaryCallable< GetNotificationChannelVerificationCodeRequest, @@ -938,6 +1632,20 @@ public final void sendNotificationChannelVerificationCode( * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a * result of calling `SendNotificationChannelVerificationCode`. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   NotificationChannelName name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *           "[PROJECT]", "[NOTIFICATION_CHANNEL]");
+   *   String code = "code3059181";
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.verifyNotificationChannel(name, code);
+   * }
+   * }
+ * * @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 @@ -962,6 +1670,21 @@ public final NotificationChannel verifyNotificationChannel( * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a * result of calling `SendNotificationChannelVerificationCode`. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   String name =
+   *       NotificationChannelName.ofProjectNotificationChannelName(
+   *               "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *           .toString();
+   *   String code = "code3059181";
+   *   NotificationChannel response =
+   *       notificationChannelServiceClient.verifyNotificationChannel(name, code);
+   * }
+   * }
+ * * @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 @@ -982,6 +1705,24 @@ public final NotificationChannel verifyNotificationChannel(String name, String c * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a * result of calling `SendNotificationChannelVerificationCode`. * + *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   VerifyNotificationChannelRequest request =
+   *       VerifyNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setCode("code3059181")
+   *           .build();
+   *   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 */ @@ -996,6 +1737,24 @@ public final NotificationChannel verifyNotificationChannel( * result of calling `SendNotificationChannelVerificationCode`. * *

Sample code: + * + *

{@code
+   * try (NotificationChannelServiceClient notificationChannelServiceClient =
+   *     NotificationChannelServiceClient.create()) {
+   *   VerifyNotificationChannelRequest request =
+   *       VerifyNotificationChannelRequest.newBuilder()
+   *           .setName(
+   *               NotificationChannelName.ofProjectNotificationChannelName(
+   *                       "[PROJECT]", "[NOTIFICATION_CHANNEL]")
+   *                   .toString())
+   *           .setCode("code3059181")
+   *           .build();
+   *   ApiFuture future =
+   *       notificationChannelServiceClient.verifyNotificationChannelCallable().futureCall(request);
+   *   // Do something.
+   *   NotificationChannel response = future.get();
+   * }
+   * }
*/ public final UnaryCallable verifyNotificationChannelCallable() { 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 4ef501d3..b2feb1b5 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 @@ -63,6 +63,15 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+ *     ServiceMonitoringServiceClient.create()) {
+ *   ResourceName parent = ResourceName.of("[FOLDER]");
+ *   Service service = Service.newBuilder().build();
+ *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+ * }
+ * }
+ * *

Note: close() needs to be called on the ServiceMonitoringServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). @@ -171,6 +180,17 @@ public ServiceMonitoringServiceStub getStub() { /** * Create a `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ResourceName parent = ResourceName.of("[FOLDER]");
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent workspace. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param service Required. The `Service` to create. @@ -189,6 +209,17 @@ public final Service createService(ResourceName parent, Service service) { /** * Create a `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent workspace. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param service Required. The `Service` to create. @@ -207,6 +238,17 @@ public final Service createService(OrganizationName parent, Service service) { /** * Create a `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent workspace. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param service Required. The `Service` to create. @@ -225,6 +267,17 @@ public final Service createService(ProjectName parent, Service service) { /** * Create a `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent workspace. The format is: *

projects/[PROJECT_ID_OR_NUMBER] * @param service Required. The `Service` to create. @@ -240,6 +293,21 @@ public final Service createService(String parent, Service service) { /** * Create a `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   CreateServiceRequest request =
+   *       CreateServiceRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setServiceId("serviceId-194185552")
+   *           .setService(Service.newBuilder().build())
+   *           .build();
+   *   Service response = serviceMonitoringServiceClient.createService(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 */ @@ -252,6 +320,22 @@ public final Service createService(CreateServiceRequest request) { * Create a `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   CreateServiceRequest request =
+   *       CreateServiceRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setServiceId("serviceId-194185552")
+   *           .setService(Service.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.createServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createServiceCallable() { return stub.createServiceCallable(); @@ -261,6 +345,16 @@ public final UnaryCallable createServiceCallable( /** * Get the named `Service`. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -275,6 +369,16 @@ public final Service getService(ServiceName name) { /** * Get the named `Service`. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -288,6 +392,19 @@ public final Service getService(String name) { /** * Get the named `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   GetServiceRequest request =
+   *       GetServiceRequest.newBuilder()
+   *           .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .build();
+   *   Service response = serviceMonitoringServiceClient.getService(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 */ @@ -300,6 +417,20 @@ public final Service getService(GetServiceRequest request) { * Get the named `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   GetServiceRequest request =
+   *       GetServiceRequest.newBuilder()
+   *           .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.getServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getServiceCallable() { return stub.getServiceCallable(); @@ -309,6 +440,18 @@ public final UnaryCallable getServiceCallable() { /** * List `Service`s for this workspace. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ResourceName parent = ResourceName.of("[FOLDER]");
+   *   for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent containing the listed services, either a * project or a Monitoring Workspace. The formats are: *

projects/[PROJECT_ID_OR_NUMBER] workspaces/[HOST_PROJECT_ID_OR_NUMBER] @@ -326,6 +469,18 @@ public final ListServicesPagedResponse listServices(ResourceName parent) { /** * List `Service`s for this workspace. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent containing the listed services, either a * project or a Monitoring Workspace. The formats are: *

projects/[PROJECT_ID_OR_NUMBER] workspaces/[HOST_PROJECT_ID_OR_NUMBER] @@ -343,6 +498,18 @@ public final ListServicesPagedResponse listServices(OrganizationName parent) { /** * List `Service`s for this workspace. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent containing the listed services, either a * project or a Monitoring Workspace. The formats are: *

projects/[PROJECT_ID_OR_NUMBER] workspaces/[HOST_PROJECT_ID_OR_NUMBER] @@ -360,6 +527,18 @@ public final ListServicesPagedResponse listServices(ProjectName parent) { /** * List `Service`s for this workspace. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
+   *   for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent containing the listed services, either a * project or a Monitoring Workspace. The formats are: *

projects/[PROJECT_ID_OR_NUMBER] workspaces/[HOST_PROJECT_ID_OR_NUMBER] @@ -374,6 +553,24 @@ public final ListServicesPagedResponse listServices(String parent) { /** * List `Service`s for this workspace. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ListServicesRequest request =
+   *       ListServicesRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Service element : serviceMonitoringServiceClient.listServices(request).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 */ @@ -386,6 +583,25 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request) * List `Service`s for this workspace. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ListServicesRequest request =
+   *       ListServicesRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.listServicesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Service element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listServicesPagedCallable() { @@ -397,6 +613,25 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request) * List `Service`s for this workspace. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   while (true) {
+   *     ListServicesResponse response =
+   *         serviceMonitoringServiceClient.listServicesCallable().call(request);
+   *     for (Service element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listServicesCallable() { return stub.listServicesCallable(); @@ -406,6 +641,16 @@ public final UnaryCallable listServic /** * Update this `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   Service service = Service.newBuilder().build();
+   *   Service response = serviceMonitoringServiceClient.updateService(service);
+   * }
+   * }
+ * * @param service Required. The `Service` to draw updates from. The given `name` specifies the * resource to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -419,6 +664,20 @@ public final Service updateService(Service service) { /** * Update this `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   UpdateServiceRequest request =
+   *       UpdateServiceRequest.newBuilder()
+   *           .setService(Service.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Service response = serviceMonitoringServiceClient.updateService(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 */ @@ -431,6 +690,21 @@ public final Service updateService(UpdateServiceRequest request) { * Update this `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   UpdateServiceRequest request =
+   *       UpdateServiceRequest.newBuilder()
+   *           .setService(Service.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.updateServiceCallable().futureCall(request);
+   *   // Do something.
+   *   Service response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateServiceCallable() { return stub.updateServiceCallable(); @@ -440,6 +714,16 @@ public final UnaryCallable updateServiceCallable( /** * Soft delete this `Service`. * + *

Sample code: + * + *

{@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 @@ -454,6 +738,16 @@ public final void deleteService(ServiceName name) { /** * Soft delete this `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
+   *   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 @@ -467,6 +761,19 @@ public final void deleteService(String name) { /** * Soft delete this `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   DeleteServiceRequest request =
+   *       DeleteServiceRequest.newBuilder()
+   *           .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").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 */ @@ -479,6 +786,20 @@ public final void deleteService(DeleteServiceRequest request) { * Soft delete this `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   DeleteServiceRequest request =
+   *       DeleteServiceRequest.newBuilder()
+   *           .setName(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteServiceCallable() { return stub.deleteServiceCallable(); @@ -488,6 +809,18 @@ public final UnaryCallable deleteServiceCallable() /** * Create a `ServiceLevelObjective` for the given `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent `Service`. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * @param serviceLevelObjective Required. The `ServiceLevelObjective` to create. The provided @@ -508,6 +841,18 @@ public final ServiceLevelObjective createServiceLevelObjective( /** * Create a `ServiceLevelObjective` for the given `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent `Service`. The format is: *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] * @param serviceLevelObjective Required. The `ServiceLevelObjective` to create. The provided @@ -528,6 +873,22 @@ public final ServiceLevelObjective createServiceLevelObjective( /** * Create a `ServiceLevelObjective` for the given `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   CreateServiceLevelObjectiveRequest request =
+   *       CreateServiceLevelObjectiveRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setServiceLevelObjectiveId("serviceLevelObjectiveId-240792859")
+   *           .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
+   *           .build();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.createServiceLevelObjective(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 */ @@ -541,6 +902,22 @@ public final ServiceLevelObjective createServiceLevelObjective( * Create a `ServiceLevelObjective` for the given `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   CreateServiceLevelObjectiveRequest request =
+   *       CreateServiceLevelObjectiveRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setServiceLevelObjectiveId("serviceLevelObjectiveId-240792859")
+   *           .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.createServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something.
+   *   ServiceLevelObjective response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createServiceLevelObjectiveCallable() { @@ -551,6 +928,19 @@ public final ServiceLevelObjective createServiceLevelObjective( /** * Get a `ServiceLevelObjective` by name. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjectiveName name =
+   *       ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *           "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.getServiceLevelObjective(name);
+   * }
+   * }
+ * * @param name Required. Resource name of the `ServiceLevelObjective` to get. 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 @@ -567,6 +957,20 @@ public final ServiceLevelObjective getServiceLevelObjective(ServiceLevelObjectiv /** * Get a `ServiceLevelObjective` by name. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String name =
+   *       ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *               "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
+   *           .toString();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.getServiceLevelObjective(name);
+   * }
+   * }
+ * * @param name Required. Resource name of the `ServiceLevelObjective` to get. 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 @@ -581,6 +985,23 @@ public final ServiceLevelObjective getServiceLevelObjective(String name) { /** * Get a `ServiceLevelObjective` by name. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   GetServiceLevelObjectiveRequest request =
+   *       GetServiceLevelObjectiveRequest.newBuilder()
+   *           .setName(
+   *               ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *                       "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
+   *                   .toString())
+   *           .build();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.getServiceLevelObjective(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 */ @@ -594,6 +1015,23 @@ public final ServiceLevelObjective getServiceLevelObjective( * Get a `ServiceLevelObjective` by name. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   GetServiceLevelObjectiveRequest request =
+   *       GetServiceLevelObjectiveRequest.newBuilder()
+   *           .setName(
+   *               ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *                       "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.getServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something.
+   *   ServiceLevelObjective response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getServiceLevelObjectiveCallable() { @@ -604,6 +1042,19 @@ public final ServiceLevelObjective getServiceLevelObjective( /** * List the `ServiceLevelObjective`s for the given `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+   *   for (ServiceLevelObjective element :
+   *       serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent containing the listed SLOs, either a * project or a Monitoring Workspace. The formats are: *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] @@ -623,6 +1074,19 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( /** * List the `ServiceLevelObjective`s for the given `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString();
+   *   for (ServiceLevelObjective element :
+   *       serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * * @param parent Required. Resource name of the parent containing the listed SLOs, either a * project or a Monitoring Workspace. The formats are: *

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] @@ -639,6 +1103,25 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( /** * List the `ServiceLevelObjective`s for the given `Service`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ListServiceLevelObjectivesRequest request =
+   *       ListServiceLevelObjectivesRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (ServiceLevelObjective element :
+   *       serviceMonitoringServiceClient.listServiceLevelObjectives(request).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 */ @@ -652,6 +1135,27 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( * List the `ServiceLevelObjective`s for the given `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ListServiceLevelObjectivesRequest request =
+   *       ListServiceLevelObjectivesRequest.newBuilder()
+   *           .setParent(ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient
+   *           .listServiceLevelObjectivesPagedCallable()
+   *           .futureCall(request);
+   *   // Do something.
+   *   for (ServiceLevelObjective element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable< ListServiceLevelObjectivesRequest, ListServiceLevelObjectivesPagedResponse> @@ -664,6 +1168,25 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( * List the `ServiceLevelObjective`s for the given `Service`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   while (true) {
+   *     ListServiceLevelObjectivesResponse response =
+   *         serviceMonitoringServiceClient.listServiceLevelObjectivesCallable().call(request);
+   *     for (ServiceLevelObjective element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listServiceLevelObjectivesCallable() { @@ -674,6 +1197,17 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives( /** * Update the given `ServiceLevelObjective`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.updateServiceLevelObjective(serviceLevelObjective);
+   * }
+   * }
+ * * @param serviceLevelObjective Required. The `ServiceLevelObjective` to draw updates from. The * given `name` specifies the resource to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -691,6 +1225,21 @@ public final ServiceLevelObjective updateServiceLevelObjective( /** * Update the given `ServiceLevelObjective`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   UpdateServiceLevelObjectiveRequest request =
+   *       UpdateServiceLevelObjectiveRequest.newBuilder()
+   *           .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ServiceLevelObjective response =
+   *       serviceMonitoringServiceClient.updateServiceLevelObjective(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 */ @@ -704,6 +1253,21 @@ public final ServiceLevelObjective updateServiceLevelObjective( * Update the given `ServiceLevelObjective`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   UpdateServiceLevelObjectiveRequest request =
+   *       UpdateServiceLevelObjectiveRequest.newBuilder()
+   *           .setServiceLevelObjective(ServiceLevelObjective.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.updateServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something.
+   *   ServiceLevelObjective response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateServiceLevelObjectiveCallable() { @@ -714,6 +1278,18 @@ public final ServiceLevelObjective updateServiceLevelObjective( /** * Delete the given `ServiceLevelObjective`. * + *

Sample code: + * + *

{@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 @@ -730,6 +1306,19 @@ public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name) { /** * Delete the given `ServiceLevelObjective`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   String name =
+   *       ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *               "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
+   *           .toString();
+   *   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 @@ -744,6 +1333,22 @@ public final void deleteServiceLevelObjective(String name) { /** * Delete the given `ServiceLevelObjective`. * + *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   DeleteServiceLevelObjectiveRequest request =
+   *       DeleteServiceLevelObjectiveRequest.newBuilder()
+   *           .setName(
+   *               ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *                       "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
+   *                   .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 */ @@ -756,6 +1361,23 @@ public final void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest * Delete the given `ServiceLevelObjective`. * *

Sample code: + * + *

{@code
+   * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+   *     ServiceMonitoringServiceClient.create()) {
+   *   DeleteServiceLevelObjectiveRequest request =
+   *       DeleteServiceLevelObjectiveRequest.newBuilder()
+   *           .setName(
+   *               ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName(
+   *                       "[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteServiceLevelObjectiveCallable() { 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 848c0de6..80c78023 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 @@ -61,6 +61,15 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *

{@code
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ *   UptimeCheckConfigName name =
+ *       UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+ *           "[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
+ * }
+ * }
+ * *

Note: close() needs to be called on the UptimeCheckServiceClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -168,6 +177,18 @@ public UptimeCheckServiceStub getStub() { * Lists the existing valid Uptime check configurations for the project (leaving out any invalid * configurations). * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ResourceName parent = ResourceName.of("[FOLDER]");
+   *   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] @@ -186,6 +207,18 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(Resource * Lists the existing valid Uptime check configurations for the project (leaving out any invalid * configurations). * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   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] @@ -204,6 +237,18 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(Organiza * Lists the existing valid Uptime check configurations for the project (leaving out any invalid * configurations). * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ProjectName 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] @@ -222,6 +267,20 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(ProjectN * Lists the existing valid Uptime check configurations for the project (leaving out any invalid * configurations). * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   String parent =
+   *       UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *           .toString();
+   *   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] @@ -238,6 +297,26 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(String p * Lists the existing valid Uptime check configurations for the project (leaving out any invalid * configurations). * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ListUptimeCheckConfigsRequest request =
+   *       ListUptimeCheckConfigsRequest.newBuilder()
+   *           .setParent(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (UptimeCheckConfig element :
+   *       uptimeCheckServiceClient.listUptimeCheckConfigs(request).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 */ @@ -252,6 +331,26 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs( * configurations). * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ListUptimeCheckConfigsRequest request =
+   *       ListUptimeCheckConfigsRequest.newBuilder()
+   *           .setParent(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       uptimeCheckServiceClient.listUptimeCheckConfigsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (UptimeCheckConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listUptimeCheckConfigsPagedCallable() { @@ -264,6 +363,24 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs( * configurations). * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   while (true) {
+   *     ListUptimeCheckConfigsResponse response =
+   *         uptimeCheckServiceClient.listUptimeCheckConfigsCallable().call(request);
+   *     for (UptimeCheckConfig element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listUptimeCheckConfigsCallable() { @@ -274,6 +391,17 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs( /** * Gets a single Uptime check configuration. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -290,6 +418,17 @@ public final UptimeCheckConfig getUptimeCheckConfig(UptimeCheckConfigName name) /** * Gets a single Uptime check configuration. * + *

Sample code: + * + *

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

projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -304,6 +443,21 @@ public final UptimeCheckConfig getUptimeCheckConfig(String name) { /** * Gets a single Uptime check configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   GetUptimeCheckConfigRequest request =
+   *       GetUptimeCheckConfigRequest.newBuilder()
+   *           .setName(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(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 */ @@ -316,6 +470,22 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest * Gets a single Uptime check configuration. * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   GetUptimeCheckConfigRequest request =
+   *       GetUptimeCheckConfigRequest.newBuilder()
+   *           .setName(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       uptimeCheckServiceClient.getUptimeCheckConfigCallable().futureCall(request);
+   *   // Do something.
+   *   UptimeCheckConfig response = future.get();
+   * }
+   * }
*/ public final UnaryCallable getUptimeCheckConfigCallable() { @@ -326,6 +496,17 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest /** * Creates a new Uptime check configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ResourceName parent = ResourceName.of("[FOLDER]");
+   *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
+   *   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. @@ -345,6 +526,17 @@ public final UptimeCheckConfig createUptimeCheckConfig( /** * Creates a new Uptime check configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
+   *   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. @@ -364,6 +556,17 @@ public final UptimeCheckConfig createUptimeCheckConfig( /** * Creates a new Uptime check configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
+   *   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. @@ -383,6 +586,19 @@ public final UptimeCheckConfig createUptimeCheckConfig( /** * Creates a new Uptime check configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   String parent =
+   *       UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *           .toString();
+   *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
+   *   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. @@ -402,6 +618,22 @@ public final UptimeCheckConfig createUptimeCheckConfig( /** * Creates a new Uptime check configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   CreateUptimeCheckConfigRequest request =
+   *       CreateUptimeCheckConfigRequest.newBuilder()
+   *           .setParent(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .setUptimeCheckConfig(UptimeCheckConfig.newBuilder().build())
+   *           .build();
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.createUptimeCheckConfig(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 */ @@ -414,6 +646,23 @@ public final UptimeCheckConfig createUptimeCheckConfig(CreateUptimeCheckConfigRe * Creates a new Uptime check configuration. * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   CreateUptimeCheckConfigRequest request =
+   *       CreateUptimeCheckConfigRequest.newBuilder()
+   *           .setParent(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .setUptimeCheckConfig(UptimeCheckConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       uptimeCheckServiceClient.createUptimeCheckConfigCallable().futureCall(request);
+   *   // Do something.
+   *   UptimeCheckConfig response = future.get();
+   * }
+   * }
*/ public final UnaryCallable createUptimeCheckConfigCallable() { @@ -426,6 +675,16 @@ public final UptimeCheckConfig createUptimeCheckConfig(CreateUptimeCheckConfigRe * new one or replace only certain fields in the current configuration by specifying the fields to * be updated via `updateMask`. Returns the updated configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfig uptimeCheckConfig = UptimeCheckConfig.newBuilder().build();
+   *   UptimeCheckConfig response =
+   *       uptimeCheckServiceClient.updateUptimeCheckConfig(uptimeCheckConfig);
+   * }
+   * }
+ * * @param uptimeCheckConfig Required. If an `updateMask` has been specified, this field gives the * values for the set of fields mentioned in the `updateMask`. If an `updateMask` has not been * given, this Uptime check configuration replaces the current configuration. If a field is @@ -448,6 +707,19 @@ public final UptimeCheckConfig updateUptimeCheckConfig(UptimeCheckConfig uptimeC * new one or replace only certain fields in the current configuration by specifying the fields to * be updated via `updateMask`. Returns the updated configuration. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UpdateUptimeCheckConfigRequest request =
+   *       UpdateUptimeCheckConfigRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUptimeCheckConfig(UptimeCheckConfig.newBuilder().build())
+   *           .build();
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.updateUptimeCheckConfig(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 */ @@ -462,6 +734,20 @@ public final UptimeCheckConfig updateUptimeCheckConfig(UpdateUptimeCheckConfigRe * be updated via `updateMask`. Returns the updated configuration. * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UpdateUptimeCheckConfigRequest request =
+   *       UpdateUptimeCheckConfigRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setUptimeCheckConfig(UptimeCheckConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       uptimeCheckServiceClient.updateUptimeCheckConfigCallable().futureCall(request);
+   *   // Do something.
+   *   UptimeCheckConfig response = future.get();
+   * }
+   * }
*/ public final UnaryCallable updateUptimeCheckConfigCallable() { @@ -474,6 +760,17 @@ public final UptimeCheckConfig updateUptimeCheckConfig(UpdateUptimeCheckConfigRe * configuration is referenced by an alert policy or other dependent configs that would be * rendered invalid by the deletion. * + *

Sample code: + * + *

{@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 @@ -492,6 +789,17 @@ public final void deleteUptimeCheckConfig(UptimeCheckConfigName name) { * configuration is referenced by an alert policy or other dependent configs that would be * rendered invalid by the deletion. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   String name =
+   *       UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *           .toString();
+   *   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 @@ -508,6 +816,21 @@ public final void deleteUptimeCheckConfig(String name) { * configuration is referenced by an alert policy or other dependent configs that would be * rendered invalid by the deletion. * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   DeleteUptimeCheckConfigRequest request =
+   *       DeleteUptimeCheckConfigRequest.newBuilder()
+   *           .setName(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .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 */ @@ -522,6 +845,22 @@ public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request * rendered invalid by the deletion. * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   DeleteUptimeCheckConfigRequest request =
+   *       DeleteUptimeCheckConfigRequest.newBuilder()
+   *           .setName(
+   *               UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+   *                       "[PROJECT]", "[UPTIME_CHECK_CONFIG]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       uptimeCheckServiceClient.deleteUptimeCheckConfigCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
*/ public final UnaryCallable deleteUptimeCheckConfigCallable() { @@ -532,6 +871,22 @@ public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request /** * Returns the list of IP addresses that checkers run from * + *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ListUptimeCheckIpsRequest request =
+   *       ListUptimeCheckIpsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (UptimeCheckIp element :
+   *       uptimeCheckServiceClient.listUptimeCheckIps(request).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 */ @@ -545,6 +900,22 @@ public final ListUptimeCheckIpsPagedResponse listUptimeCheckIps( * Returns the list of IP addresses that checkers run from * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   ListUptimeCheckIpsRequest request =
+   *       ListUptimeCheckIpsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       uptimeCheckServiceClient.listUptimeCheckIpsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (UptimeCheckIp element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listUptimeCheckIpsPagedCallable() { @@ -556,6 +927,24 @@ public final ListUptimeCheckIpsPagedResponse listUptimeCheckIps( * Returns the list of IP addresses that checkers run from * *

Sample code: + * + *

{@code
+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   while (true) {
+   *     ListUptimeCheckIpsResponse response =
+   *         uptimeCheckServiceClient.listUptimeCheckIpsCallable().call(request);
+   *     for (UptimeCheckIp element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
*/ public final UnaryCallable listUptimeCheckIpsCallable() { 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 9faf2746..228e60bd 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 @@ -28,6 +28,14 @@ * *

Sample for AlertPolicyServiceClient: * + *

{@code
+ * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+ *   AlertPolicyName name =
+ *       AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ *   AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
+ * }
+ * }
+ * *

======================= GroupServiceClient ======================= * *

Service Description: The Group API lets you inspect and manage your @@ -42,6 +50,13 @@ * *

Sample for GroupServiceClient: * + *

{@code
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ *   GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+ *   Group response = groupServiceClient.getGroup(name);
+ * }
+ * }
+ * *

======================= MetricServiceClient ======================= * *

Service Description: Manages metric descriptors, monitored resource descriptors, and time @@ -49,6 +64,16 @@ * *

Sample for MetricServiceClient: * + *

{@code
+ * try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
+ *   MonitoredResourceDescriptorName name =
+ *       MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName(
+ *           "[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ *   MonitoredResourceDescriptor response =
+ *       metricServiceClient.getMonitoredResourceDescriptor(name);
+ * }
+ * }
+ * *

======================= NotificationChannelServiceClient ======================= * *

Service Description: The Notification Channel API provides access to configuration that @@ -56,6 +81,17 @@ * *

Sample for NotificationChannelServiceClient: * + *

{@code
+ * try (NotificationChannelServiceClient notificationChannelServiceClient =
+ *     NotificationChannelServiceClient.create()) {
+ *   NotificationChannelDescriptorName name =
+ *       NotificationChannelDescriptorName.ofProjectChannelDescriptorName(
+ *           "[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+ *   NotificationChannelDescriptor response =
+ *       notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+ * }
+ * }
+ * *

======================= ServiceMonitoringServiceClient ======================= * *

Service Description: The Cloud Monitoring Service-Oriented Monitoring API has endpoints for @@ -64,6 +100,15 @@ * *

Sample for ServiceMonitoringServiceClient: * + *

{@code
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient =
+ *     ServiceMonitoringServiceClient.create()) {
+ *   FolderName parent = FolderName.of("[FOLDER]");
+ *   Service service = Service.newBuilder().build();
+ *   Service response = serviceMonitoringServiceClient.createService(parent, service);
+ * }
+ * }
+ * *

======================= UptimeCheckServiceClient ======================= * *

Service Description: The UptimeCheckService API is used to manage (list, create, delete, edit) @@ -74,6 +119,15 @@ * the left-hand side to navigate to Stackdriver, and then clicking on "Uptime". * *

Sample for UptimeCheckServiceClient: + * + *

{@code
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ *   UptimeCheckConfigName name =
+ *       UptimeCheckConfigName.ofProjectUptimeCheckConfigName(
+ *           "[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.monitoring.v3; diff --git a/synth.metadata b/synth.metadata index 9ab49198..877320e5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-monitoring.git", - "sha": "e3cb4e23d62434a80f87ca603e6fb1df0646c9d4" + "sha": "7e18498926d3c87d5f67b2db5c41be61f0d55084" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ceaaf31b3d13badab7cf9d3b570f5639db5593d9", - "internalRef": "352816749" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {