diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 085021dd..f2dbdee0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -99,7 +99,16 @@ mvn -Penable-samples clean verify
```
2. [Activate](#profile-activation) the profile.
-3. Define your samples in a normal Maven project in the `samples/` directory
+3. Define your samples in a normal Maven project in the `samples/` directory.
+
+### Code Formatting
+
+Code in this repo is formatted with
+[google-java-format](https://github.com/google/google-java-format).
+To run formatting on your project, you can run:
+```
+mvn com.coveo:fmt-maven-plugin:format
+```
### Profile Activation
diff --git a/google-cloud-monitoring/clirr-ignored-differences.xml b/google-cloud-monitoring/clirr-ignored-differences.xml
new file mode 100644
index 00000000..404ca00b
--- /dev/null
+++ b/google-cloud-monitoring/clirr-ignored-differences.xml
@@ -0,0 +1,35 @@
+
+
+
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- * AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ * alertPolicyServiceClient.deleteAlertPolicy(name);
* }
*
*
@@ -169,6 +169,100 @@ public AlertPolicyServiceStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an alerting policy.
+ *
+ * Sample code: + * + *
+ * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ * alertPolicyServiceClient.deleteAlertPolicy(name);
+ * }
+ *
+ *
+ * @param name Required. The alerting policy to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + *
For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAlertPolicy(AlertPolicyName name) { + DeleteAlertPolicyRequest request = + DeleteAlertPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteAlertPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an alerting policy. + * + *
Sample code: + * + *
+ * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ * alertPolicyServiceClient.deleteAlertPolicy(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The alerting policy to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] + *
For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAlertPolicy(String name) { + DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder().setName(name).build(); + deleteAlertPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an alerting policy. + * + *
Sample code: + * + *
+ * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ * DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * alertPolicyServiceClient.deleteAlertPolicy(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) {
+ deleteAlertPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an alerting policy.
+ *
+ * Sample code: + * + *
+ * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
+ * DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name).iterateAll()) {
* // doThingsWith(element);
* }
@@ -192,7 +286,7 @@ public AlertPolicyServiceStub getStub() {
* instead.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListAlertPoliciesPagedResponse listAlertPolicies(ProjectName name) {
+ public final ListAlertPoliciesPagedResponse listAlertPolicies(ResourceName name) {
ListAlertPoliciesRequest request =
ListAlertPoliciesRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -208,7 +302,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ProjectName name)
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (AlertPolicy element : alertPolicyServiceClient.listAlertPolicies(name.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -236,7 +330,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(String name) {
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListAlertPoliciesRequest request = ListAlertPoliciesRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -261,7 +355,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListAlertPoliciesRequest request = ListAlertPoliciesRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -286,7 +380,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListAlertPoliciesRequest request = ListAlertPoliciesRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -318,7 +412,7 @@ public final ListAlertPoliciesPagedResponse listAlertPolicies(ListAlertPoliciesR
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
* }
*
@@ -341,7 +435,7 @@ public final AlertPolicy getAlertPolicy(AlertPolicyName name) {
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name.toString());
* }
*
@@ -363,7 +457,7 @@ public final AlertPolicy getAlertPolicy(String name) {
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* GetAlertPolicyRequest request = GetAlertPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -386,7 +480,7 @@ public final AlertPolicy getAlertPolicy(GetAlertPolicyRequest request) {
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
+ * AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* GetAlertPolicyRequest request = GetAlertPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -408,7 +502,7 @@ public final UnaryCallable getAlertPolicyCal
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
* AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name, alertPolicy);
* }
@@ -425,7 +519,7 @@ public final UnaryCallable getAlertPolicyCal
* `[ALERT_POLICY_ID]` value.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPolicy) {
+ public final AlertPolicy createAlertPolicy(ResourceName name, AlertPolicy alertPolicy) {
CreateAlertPolicyRequest request =
CreateAlertPolicyRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -442,7 +536,7 @@ public final AlertPolicy createAlertPolicy(ProjectName name, AlertPolicy alertPo
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
* AlertPolicy response = alertPolicyServiceClient.createAlertPolicy(name.toString(), alertPolicy);
* }
@@ -473,7 +567,7 @@ public final AlertPolicy createAlertPolicy(String name, AlertPolicy alertPolicy)
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
* CreateAlertPolicyRequest request = CreateAlertPolicyRequest.newBuilder()
* .setName(name.toString())
@@ -498,7 +592,7 @@ public final AlertPolicy createAlertPolicy(CreateAlertPolicyRequest request) {
*
*
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* AlertPolicy alertPolicy = AlertPolicy.newBuilder().build();
* CreateAlertPolicyRequest request = CreateAlertPolicyRequest.newBuilder()
* .setName(name.toString())
@@ -514,100 +608,6 @@ public final UnaryCallable createAlertPol
return stub.createAlertPolicyCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an alerting policy.
- *
- * Sample code:
- *
- *
- * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- * alertPolicyServiceClient.deleteAlertPolicy(name);
- * }
- *
- *
- * @param name Required. The alerting policy to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
- *
For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteAlertPolicy(AlertPolicyName name) {
- DeleteAlertPolicyRequest request =
- DeleteAlertPolicyRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- deleteAlertPolicy(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an alerting policy.
- *
- *
Sample code:
- *
- *
- * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- * alertPolicyServiceClient.deleteAlertPolicy(name.toString());
- * }
- *
- *
- * @param name Required. The alerting policy to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
- *
For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteAlertPolicy(String name) {
- DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder().setName(name).build();
- deleteAlertPolicy(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an alerting policy.
- *
- *
Sample code:
- *
- *
- * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- * DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * alertPolicyServiceClient.deleteAlertPolicy(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) {
- deleteAlertPolicyCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an alerting policy.
- *
- * Sample code:
- *
- *
- * try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
- * AlertPolicyName name = AlertPolicyName.of("[PROJECT]", "[ALERT_POLICY]");
- * DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteAlertPolicyCallable() {
- return stub.deleteAlertPolicyCallable();
- }
-
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates an alerting policy. You can either replace the entire policy with a new one or replace
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java
index 193bac9d..fd6a5655 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java
@@ -56,16 +56,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of getAlertPolicy to 30 seconds:
+ *
For example, to set the total timeout of deleteAlertPolicy to 30 seconds:
*
*
*
* AlertPolicyServiceSettings.Builder alertPolicyServiceSettingsBuilder =
* AlertPolicyServiceSettings.newBuilder();
* alertPolicyServiceSettingsBuilder
- * .getAlertPolicySettings()
+ * .deleteAlertPolicySettings()
* .setRetrySettings(
- * alertPolicyServiceSettingsBuilder.getAlertPolicySettings().getRetrySettings().toBuilder()
+ * alertPolicyServiceSettingsBuilder.deleteAlertPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AlertPolicyServiceSettings alertPolicyServiceSettings = alertPolicyServiceSettingsBuilder.build();
@@ -74,6 +74,11 @@
*/
@Generated("by gapic-generator")
public class AlertPolicyServiceSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteAlertPolicy. */
+ public UnaryCallSettings deleteAlertPolicySettings() {
+ return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
+ }
+
/** Returns the object with the settings used for calls to listAlertPolicies. */
public PagedCallSettings<
ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -91,11 +96,6 @@ public UnaryCallSettings createAlertPolic
return ((AlertPolicyServiceStubSettings) getStubSettings()).createAlertPolicySettings();
}
- /** Returns the object with the settings used for calls to deleteAlertPolicy. */
- public UnaryCallSettings deleteAlertPolicySettings() {
- return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
- }
-
/** Returns the object with the settings used for calls to updateAlertPolicy. */
public UnaryCallSettings updateAlertPolicySettings() {
return ((AlertPolicyServiceStubSettings) getStubSettings()).updateAlertPolicySettings();
@@ -198,6 +198,11 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteAlertPolicy. */
+ public UnaryCallSettings.Builder deleteAlertPolicySettings() {
+ return getStubSettingsBuilder().deleteAlertPolicySettings();
+ }
+
/** Returns the builder for the settings used for calls to listAlertPolicies. */
public PagedCallSettings.Builder<
ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -216,11 +221,6 @@ public UnaryCallSettings.Builder getAlertPol
return getStubSettingsBuilder().createAlertPolicySettings();
}
- /** Returns the builder for the settings used for calls to deleteAlertPolicy. */
- public UnaryCallSettings.Builder deleteAlertPolicySettings() {
- return getStubSettingsBuilder().deleteAlertPolicySettings();
- }
-
/** Returns the builder for the settings used for calls to updateAlertPolicy. */
public UnaryCallSettings.Builder
updateAlertPolicySettings() {
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java
index 37ceebef..b80b2098 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceClient.java
@@ -26,6 +26,7 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
import com.google.cloud.monitoring.v3.stub.GroupServiceStub;
import com.google.cloud.monitoring.v3.stub.GroupServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -38,7 +39,6 @@
import com.google.monitoring.v3.ListGroupMembersResponse;
import com.google.monitoring.v3.ListGroupsRequest;
import com.google.monitoring.v3.ListGroupsResponse;
-import com.google.monitoring.v3.ProjectName;
import com.google.monitoring.v3.UpdateGroupRequest;
import com.google.protobuf.Empty;
import java.io.IOException;
@@ -64,8 +64,8 @@
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- * Group response = groupServiceClient.getGroup(name);
+ * Group group = Group.newBuilder().build();
+ * Group response = groupServiceClient.updateGroup(group);
* }
*
*
@@ -172,6 +172,163 @@ public GroupServiceStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an existing group. You can change any group attributes except `name`.
+ *
+ * Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * Group group = Group.newBuilder().build();
+ * Group response = groupServiceClient.updateGroup(group);
+ * }
+ *
+ *
+ * @param group Required. The new definition of the group. All fields of the existing group,
+ * excepting `name`, are replaced with the corresponding fields of this group.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Group updateGroup(Group group) {
+ UpdateGroupRequest request = UpdateGroupRequest.newBuilder().setGroup(group).build();
+ return updateGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an existing group. You can change any group attributes except `name`.
+ *
+ * Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * Group group = Group.newBuilder().build();
+ * UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
+ * .setGroup(group)
+ * .build();
+ * Group response = groupServiceClient.updateGroup(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Group updateGroup(UpdateGroupRequest request) {
+ return updateGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Updates an existing group. You can change any group attributes except `name`.
+ *
+ * Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * Group group = Group.newBuilder().build();
+ * UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
+ * .setGroup(group)
+ * .build();
+ * ApiFuture<Group> future = groupServiceClient.updateGroupCallable().futureCall(request);
+ * // Do something
+ * Group response = future.get();
+ * }
+ *
+ */
+ public final UnaryCallable updateGroupCallable() {
+ return stub.updateGroupCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group.
+ *
+ * Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+ * groupServiceClient.deleteGroup(name);
+ * }
+ *
+ *
+ * @param name Required. The group to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteGroup(GroupName name) {
+ DeleteGroupRequest request =
+ DeleteGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group.
+ *
+ *
Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+ * groupServiceClient.deleteGroup(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The group to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteGroup(String name) {
+ DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setName(name).build();
+ deleteGroup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group.
+ *
+ *
Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+ * DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * groupServiceClient.deleteGroup(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteGroup(DeleteGroupRequest request) {
+ deleteGroupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an existing group.
+ *
+ * Sample code:
+ *
+ *
+ * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
+ * DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = groupServiceClient.deleteGroupCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable deleteGroupCallable() {
+ return stub.deleteGroupCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists the existing groups.
@@ -180,7 +337,7 @@ public GroupServiceStub getStub() {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (Group element : groupServiceClient.listGroups(name).iterateAll()) {
* // doThingsWith(element);
* }
@@ -191,7 +348,7 @@ public GroupServiceStub getStub() {
* projects/[PROJECT_ID_OR_NUMBER]
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListGroupsPagedResponse listGroups(ProjectName name) {
+ public final ListGroupsPagedResponse listGroups(ResourceName name) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return listGroups(request);
@@ -205,7 +362,7 @@ public final ListGroupsPagedResponse listGroups(ProjectName name) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (Group element : groupServiceClient.listGroups(name.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -229,7 +386,7 @@ public final ListGroupsPagedResponse listGroups(String name) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListGroupsRequest request = ListGroupsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -254,7 +411,7 @@ public final ListGroupsPagedResponse listGroups(ListGroupsRequest request) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListGroupsRequest request = ListGroupsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -278,7 +435,7 @@ public final UnaryCallable listGroup
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListGroupsRequest request = ListGroupsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -309,7 +466,7 @@ public final UnaryCallable listGroupsCall
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* Group response = groupServiceClient.getGroup(name);
* }
*
@@ -332,7 +489,7 @@ public final Group getGroup(GroupName name) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* Group response = groupServiceClient.getGroup(name.toString());
* }
*
@@ -354,7 +511,7 @@ public final Group getGroup(String name) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* GetGroupRequest request = GetGroupRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -377,7 +534,7 @@ public final Group getGroup(GetGroupRequest request) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* GetGroupRequest request = GetGroupRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -399,7 +556,7 @@ public final UnaryCallable getGroupCallable() {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* Group group = Group.newBuilder().build();
* Group response = groupServiceClient.createGroup(name, group);
* }
@@ -411,7 +568,7 @@ public final UnaryCallable getGroupCallable() {
* the system assigns the name.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Group createGroup(ProjectName name, Group group) {
+ public final Group createGroup(ResourceName name, Group group) {
CreateGroupRequest request =
CreateGroupRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -428,7 +585,7 @@ public final Group createGroup(ProjectName name, Group group) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* Group group = Group.newBuilder().build();
* Group response = groupServiceClient.createGroup(name.toString(), group);
* }
@@ -454,7 +611,7 @@ public final Group createGroup(String name, Group group) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* Group group = Group.newBuilder().build();
* CreateGroupRequest request = CreateGroupRequest.newBuilder()
* .setName(name.toString())
@@ -479,7 +636,7 @@ public final Group createGroup(CreateGroupRequest request) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* Group group = Group.newBuilder().build();
* CreateGroupRequest request = CreateGroupRequest.newBuilder()
* .setName(name.toString())
@@ -495,163 +652,6 @@ public final UnaryCallable createGroupCallable() {
return stub.createGroupCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates an existing group. You can change any group attributes except `name`.
- *
- * Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * Group group = Group.newBuilder().build();
- * Group response = groupServiceClient.updateGroup(group);
- * }
- *
- *
- * @param group Required. The new definition of the group. All fields of the existing group,
- * excepting `name`, are replaced with the corresponding fields of this group.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Group updateGroup(Group group) {
- UpdateGroupRequest request = UpdateGroupRequest.newBuilder().setGroup(group).build();
- return updateGroup(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates an existing group. You can change any group attributes except `name`.
- *
- * Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * Group group = Group.newBuilder().build();
- * UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
- * .setGroup(group)
- * .build();
- * Group response = groupServiceClient.updateGroup(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final Group updateGroup(UpdateGroupRequest request) {
- return updateGroupCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Updates an existing group. You can change any group attributes except `name`.
- *
- * Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * Group group = Group.newBuilder().build();
- * UpdateGroupRequest request = UpdateGroupRequest.newBuilder()
- * .setGroup(group)
- * .build();
- * ApiFuture<Group> future = groupServiceClient.updateGroupCallable().futureCall(request);
- * // Do something
- * Group response = future.get();
- * }
- *
- */
- public final UnaryCallable updateGroupCallable() {
- return stub.updateGroupCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an existing group.
- *
- * Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- * groupServiceClient.deleteGroup(name);
- * }
- *
- *
- * @param name Required. The group to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteGroup(GroupName name) {
- DeleteGroupRequest request =
- DeleteGroupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteGroup(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an existing group.
- *
- *
Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- * groupServiceClient.deleteGroup(name.toString());
- * }
- *
- *
- * @param name Required. The group to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteGroup(String name) {
- DeleteGroupRequest request = DeleteGroupRequest.newBuilder().setName(name).build();
- deleteGroup(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an existing group.
- *
- *
Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- * DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * groupServiceClient.deleteGroup(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteGroup(DeleteGroupRequest request) {
- deleteGroupCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Deletes an existing group.
- *
- * Sample code:
- *
- *
- * try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
- * DeleteGroupRequest request = DeleteGroupRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = groupServiceClient.deleteGroupCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteGroupCallable() {
- return stub.deleteGroupCallable();
- }
-
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists the monitored resources that are members of a group.
@@ -660,7 +660,7 @@ public final UnaryCallable deleteGroupCallable() {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* for (MonitoredResource element : groupServiceClient.listGroupMembers(name).iterateAll()) {
* // doThingsWith(element);
* }
@@ -685,7 +685,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(GroupName name) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* for (MonitoredResource element : groupServiceClient.listGroupMembers(name.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -709,7 +709,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(String name) {
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* ListGroupMembersRequest request = ListGroupMembersRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -734,7 +734,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(ListGroupMembersRequ
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* ListGroupMembersRequest request = ListGroupMembersRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -759,7 +759,7 @@ public final ListGroupMembersPagedResponse listGroupMembers(ListGroupMembersRequ
*
*
* try (GroupServiceClient groupServiceClient = GroupServiceClient.create()) {
- * GroupName name = GroupName.of("[PROJECT]", "[GROUP]");
+ * GroupName name = GroupName.ofProjectGroupName("[PROJECT]", "[GROUP]");
* ListGroupMembersRequest request = ListGroupMembersRequest.newBuilder()
* .setName(name.toString())
* .build();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java
index 790fb8be..e121343c 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/GroupServiceSettings.java
@@ -59,16 +59,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of getGroup to 30 seconds:
+ *
For example, to set the total timeout of updateGroup to 30 seconds:
*
*
*
* GroupServiceSettings.Builder groupServiceSettingsBuilder =
* GroupServiceSettings.newBuilder();
* groupServiceSettingsBuilder
- * .getGroupSettings()
+ * .updateGroupSettings()
* .setRetrySettings(
- * groupServiceSettingsBuilder.getGroupSettings().getRetrySettings().toBuilder()
+ * groupServiceSettingsBuilder.updateGroupSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* GroupServiceSettings groupServiceSettings = groupServiceSettingsBuilder.build();
@@ -77,6 +77,16 @@
*/
@Generated("by gapic-generator")
public class GroupServiceSettings extends ClientSettings {
+ /** Returns the object with the settings used for calls to updateGroup. */
+ public UnaryCallSettings updateGroupSettings() {
+ return ((GroupServiceStubSettings) getStubSettings()).updateGroupSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteGroup. */
+ public UnaryCallSettings deleteGroupSettings() {
+ return ((GroupServiceStubSettings) getStubSettings()).deleteGroupSettings();
+ }
+
/** Returns the object with the settings used for calls to listGroups. */
public PagedCallSettings
listGroupsSettings() {
@@ -93,16 +103,6 @@ public UnaryCallSettings createGroupSettings() {
return ((GroupServiceStubSettings) getStubSettings()).createGroupSettings();
}
- /** Returns the object with the settings used for calls to updateGroup. */
- public UnaryCallSettings updateGroupSettings() {
- return ((GroupServiceStubSettings) getStubSettings()).updateGroupSettings();
- }
-
- /** Returns the object with the settings used for calls to deleteGroup. */
- public UnaryCallSettings deleteGroupSettings() {
- return ((GroupServiceStubSettings) getStubSettings()).deleteGroupSettings();
- }
-
/** Returns the object with the settings used for calls to listGroupMembers. */
public PagedCallSettings<
ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
@@ -207,6 +207,16 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to updateGroup. */
+ public UnaryCallSettings.Builder updateGroupSettings() {
+ return getStubSettingsBuilder().updateGroupSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteGroup. */
+ public UnaryCallSettings.Builder deleteGroupSettings() {
+ return getStubSettingsBuilder().deleteGroupSettings();
+ }
+
/** Returns the builder for the settings used for calls to listGroups. */
public PagedCallSettings.Builder
listGroupsSettings() {
@@ -223,16 +233,6 @@ public UnaryCallSettings.Builder createGroupSettings(
return getStubSettingsBuilder().createGroupSettings();
}
- /** Returns the builder for the settings used for calls to updateGroup. */
- public UnaryCallSettings.Builder updateGroupSettings() {
- return getStubSettingsBuilder().updateGroupSettings();
- }
-
- /** Returns the builder for the settings used for calls to deleteGroup. */
- public UnaryCallSettings.Builder deleteGroupSettings() {
- return getStubSettingsBuilder().deleteGroupSettings();
- }
-
/** Returns the builder for the settings used for calls to listGroupMembers. */
public PagedCallSettings.Builder<
ListGroupMembersRequest, ListGroupMembersResponse, ListGroupMembersPagedResponse>
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java
index aebda72b..1c98fc62 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java
@@ -27,6 +27,7 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
import com.google.cloud.monitoring.v3.stub.MetricServiceStub;
import com.google.cloud.monitoring.v3.stub.MetricServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -63,7 +64,7 @@
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
* MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name);
* }
*
@@ -181,7 +182,7 @@ public MetricServiceStub getStub() {
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (MonitoredResourceDescriptor element : metricServiceClient.listMonitoredResourceDescriptors(name).iterateAll()) {
* // doThingsWith(element);
* }
@@ -193,7 +194,7 @@ public MetricServiceStub getStub() {
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors(
- ProjectName name) {
+ ResourceName name) {
ListMonitoredResourceDescriptorsRequest request =
ListMonitoredResourceDescriptorsRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -210,7 +211,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (MonitoredResourceDescriptor element : metricServiceClient.listMonitoredResourceDescriptors(name.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -237,7 +238,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -264,7 +265,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -291,7 +292,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListMonitoredResourceDescriptorsRequest request = ListMonitoredResourceDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -324,7 +325,7 @@ public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResource
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
* MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name);
* }
*
@@ -351,7 +352,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
* MonitoredResourceDescriptor response = metricServiceClient.getMonitoredResourceDescriptor(name.toString());
* }
*
@@ -375,7 +376,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(String n
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
* GetMonitoredResourceDescriptorRequest request = GetMonitoredResourceDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -399,7 +400,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.of("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
+ * MonitoredResourceDescriptorName name = MonitoredResourceDescriptorName.ofProjectMonitoredResourceDescriptorName("[PROJECT]", "[MONITORED_RESOURCE_DESCRIPTOR]");
* GetMonitoredResourceDescriptorRequest request = GetMonitoredResourceDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -422,7 +423,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (MetricDescriptor element : metricServiceClient.listMetricDescriptors(name).iterateAll()) {
* // doThingsWith(element);
* }
@@ -433,7 +434,7 @@ public final MonitoredResourceDescriptor getMonitoredResourceDescriptor(
* projects/[PROJECT_ID_OR_NUMBER]
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectName name) {
+ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ResourceName name) {
ListMetricDescriptorsRequest request =
ListMetricDescriptorsRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -449,7 +450,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(ProjectNam
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* for (MetricDescriptor element : metricServiceClient.listMetricDescriptors(name.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -474,7 +475,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(String nam
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -500,7 +501,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -525,7 +526,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* ListMetricDescriptorsRequest request = ListMetricDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -557,7 +558,7 @@ public final ListMetricDescriptorsPagedResponse listMetricDescriptors(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* MetricDescriptor response = metricServiceClient.getMetricDescriptor(name);
* }
*
@@ -584,7 +585,7 @@ public final MetricDescriptor getMetricDescriptor(MetricDescriptorName name) {
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* MetricDescriptor response = metricServiceClient.getMetricDescriptor(name.toString());
* }
*
@@ -609,7 +610,7 @@ public final MetricDescriptor getMetricDescriptor(String name) {
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -632,7 +633,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* GetMetricDescriptorRequest request = GetMetricDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -656,7 +657,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
* MetricDescriptor response = metricServiceClient.createMetricDescriptor(name, metricDescriptor);
* }
@@ -669,7 +670,7 @@ public final MetricDescriptor getMetricDescriptor(GetMetricDescriptorRequest req
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final MetricDescriptor createMetricDescriptor(
- ProjectName name, MetricDescriptor metricDescriptor) {
+ ResourceName name, MetricDescriptor metricDescriptor) {
CreateMetricDescriptorRequest request =
CreateMetricDescriptorRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -687,7 +688,7 @@ public final MetricDescriptor createMetricDescriptor(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
* MetricDescriptor response = metricServiceClient.createMetricDescriptor(name.toString(), metricDescriptor);
* }
@@ -718,7 +719,7 @@ public final MetricDescriptor createMetricDescriptor(
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
* CreateMetricDescriptorRequest request = CreateMetricDescriptorRequest.newBuilder()
* .setName(name.toString())
@@ -744,7 +745,7 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
+ * ResourceName name = ProjectName.of("[PROJECT]");
* MetricDescriptor metricDescriptor = MetricDescriptor.newBuilder().build();
* CreateMetricDescriptorRequest request = CreateMetricDescriptorRequest.newBuilder()
* .setName(name.toString())
@@ -770,7 +771,7 @@ public final MetricDescriptor createMetricDescriptor(CreateMetricDescriptorReque
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* metricServiceClient.deleteMetricDescriptor(name);
* }
*
@@ -797,7 +798,7 @@ public final void deleteMetricDescriptor(MetricDescriptorName name) {
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* metricServiceClient.deleteMetricDescriptor(name.toString());
* }
*
@@ -822,7 +823,7 @@ public final void deleteMetricDescriptor(String name) {
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* DeleteMetricDescriptorRequest request = DeleteMetricDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -846,7 +847,7 @@ public final void deleteMetricDescriptor(DeleteMetricDescriptorRequest request)
*
*
* try (MetricServiceClient metricServiceClient = MetricServiceClient.create()) {
- * MetricDescriptorName name = MetricDescriptorName.of("[PROJECT]", "[METRIC_DESCRIPTOR]");
+ * MetricDescriptorName name = MetricDescriptorName.ofProjectMetricDescriptorName("[PROJECT]", "[METRIC_DESCRIPTOR]");
* DeleteMetricDescriptorRequest request = DeleteMetricDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
index 90ba9f67..304c64ac 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java
@@ -25,6 +25,7 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
import com.google.cloud.monitoring.v3.stub.NotificationChannelServiceStub;
import com.google.cloud.monitoring.v3.stub.NotificationChannelServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -42,7 +43,6 @@
import com.google.monitoring.v3.NotificationChannelDescriptor;
import com.google.monitoring.v3.NotificationChannelDescriptorName;
import com.google.monitoring.v3.NotificationChannelName;
-import com.google.monitoring.v3.ProjectName;
import com.google.monitoring.v3.SendNotificationChannelVerificationCodeRequest;
import com.google.monitoring.v3.UpdateNotificationChannelRequest;
import com.google.monitoring.v3.VerifyNotificationChannelRequest;
@@ -64,8 +64,9 @@
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * boolean force = false;
+ * notificationChannelServiceClient.deleteNotificationChannel(name, force);
* }
*
*
@@ -178,332 +179,468 @@ public NotificationChannelServiceStub getStub() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
- * new channel types to be dynamically added.
+ * Deletes a notification channel.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * boolean force = false;
+ * notificationChannelServiceClient.deleteNotificationChannel(name, force);
* }
*
*
- * @param name Required. The REST resource name of the parent from which to retrieve the
- * notification channel descriptors. The expected syntax is:
- * projects/[PROJECT_ID_OR_NUMBER]
- *
Note that this names the parent container in which to look for the descriptors; to
- * retrieve a single descriptor by name, use the
- * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor]
- * operation, instead.
+ * @param name Required. The channel for which to execute the request. The format is:
+ *
projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+ * @param force If true, the notification channel will be deleted regardless of its use in alert
+ * policies (the policies will be updated to remove the channel). If false, channels that are
+ * still referenced by an existing alerting policy will fail to be deleted in a delete
+ * operation.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
- ProjectName name) {
- ListNotificationChannelDescriptorsRequest request =
- ListNotificationChannelDescriptorsRequest.newBuilder()
+ public final void deleteNotificationChannel(NotificationChannelName name, boolean force) {
+ DeleteNotificationChannelRequest request =
+ DeleteNotificationChannelRequest.newBuilder()
.setName(name == null ? null : name.toString())
+ .setForce(force)
.build();
- return listNotificationChannelDescriptors(request);
+ deleteNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
- * new channel types to be dynamically added.
+ * Deletes a notification channel.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name.toString()).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * boolean force = false;
+ * notificationChannelServiceClient.deleteNotificationChannel(name.toString(), force);
* }
*
*
- * @param name Required. The REST resource name of the parent from which to retrieve the
- * notification channel descriptors. The expected syntax is:
- * projects/[PROJECT_ID_OR_NUMBER]
- *
Note that this names the parent container in which to look for the descriptors; to
- * retrieve a single descriptor by name, use the
- * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor]
- * operation, instead.
+ * @param name Required. The channel for which to execute the request. The format is:
+ *
projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+ * @param force If true, the notification channel will be deleted regardless of its use in alert
+ * policies (the policies will be updated to remove the channel). If false, channels that are
+ * still referenced by an existing alerting policy will fail to be deleted in a delete
+ * operation.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
- String name) {
- ListNotificationChannelDescriptorsRequest request =
- ListNotificationChannelDescriptorsRequest.newBuilder().setName(name).build();
- return listNotificationChannelDescriptors(request);
+ public final void deleteNotificationChannel(String name, boolean force) {
+ DeleteNotificationChannelRequest request =
+ DeleteNotificationChannelRequest.newBuilder().setName(name).setForce(force).build();
+ deleteNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
- * new channel types to be dynamically added.
+ * Deletes a notification channel.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
* .setName(name.toString())
* .build();
- * for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(request).iterateAll()) {
- * // doThingsWith(element);
- * }
+ * notificationChannelServiceClient.deleteNotificationChannel(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
- ListNotificationChannelDescriptorsRequest request) {
- return listNotificationChannelDescriptorsPagedCallable().call(request);
+ public final void deleteNotificationChannel(DeleteNotificationChannelRequest request) {
+ deleteNotificationChannelCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
- * new channel types to be dynamically added.
+ * Deletes a notification channel.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<ListNotificationChannelDescriptorsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelDescriptorsPagedCallable().futureCall(request);
+ * ApiFuture<Void> future = notificationChannelServiceClient.deleteNotificationChannelCallable().futureCall(request);
* // Do something
- * for (NotificationChannelDescriptor element : future.get().iterateAll()) {
- * // doThingsWith(element);
- * }
+ * future.get();
* }
*
*/
- public final UnaryCallable<
- ListNotificationChannelDescriptorsRequest,
- ListNotificationChannelDescriptorsPagedResponse>
- listNotificationChannelDescriptorsPagedCallable() {
- return stub.listNotificationChannelDescriptorsPagedCallable();
+ public final UnaryCallable
+ deleteNotificationChannelCallable() {
+ return stub.deleteNotificationChannelCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
- * new channel types to be dynamically added.
+ * Requests a verification code for an already verified channel that can then be used in a call to
+ * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
+ * in a different project. This makes it possible to copy a channel between projects without
+ * requiring manual reverification of the channel. If the channel is not in the verified state,
+ * this method will fail (in other words, this may only be used if the
+ * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
+ * used to put the given channel into the verified state).
+ *
+ * There is no guarantee that the verification codes returned by this method will be of a
+ * similar structure or form as the ones that are delivered to the channel via
+ * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
+ * the codes delivered via SendNotificationChannelVerificationCode() and returned from
+ * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
+ * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
+ * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
+ * a much longer, websafe base 64 encoded string that has a longer expiration time.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name);
+ * }
+ *
+ *
+ * @param name Required. The notification channel for which a verification code is to be generated
+ * and retrieved. This must name a channel that is already verified; if the specified channel
+ * is not verified, the request will fail.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GetNotificationChannelVerificationCodeResponse
+ getNotificationChannelVerificationCode(NotificationChannelName name) {
+ GetNotificationChannelVerificationCodeRequest request =
+ GetNotificationChannelVerificationCodeRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getNotificationChannelVerificationCode(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Requests a verification code for an already verified channel that can then be used in a call to
+ * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
+ * in a different project. This makes it possible to copy a channel between projects without
+ * requiring manual reverification of the channel. If the channel is not in the verified state,
+ * this method will fail (in other words, this may only be used if the
+ * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
+ * used to put the given channel into the verified state).
+ *
+ * There is no guarantee that the verification codes returned by this method will be of a
+ * similar structure or form as the ones that are delivered to the channel via
+ * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
+ * the codes delivered via SendNotificationChannelVerificationCode() and returned from
+ * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
+ * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
+ * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
+ * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ *
+ *
Sample code:
+ *
+ *
+ * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The notification channel for which a verification code is to be generated
+ * and retrieved. This must name a channel that is already verified; if the specified channel
+ * is not verified, the request will fail.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GetNotificationChannelVerificationCodeResponse
+ getNotificationChannelVerificationCode(String name) {
+ GetNotificationChannelVerificationCodeRequest request =
+ GetNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build();
+ return getNotificationChannelVerificationCode(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Requests a verification code for an already verified channel that can then be used in a call to
+ * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
+ * in a different project. This makes it possible to copy a channel between projects without
+ * requiring manual reverification of the channel. If the channel is not in the verified state,
+ * this method will fail (in other words, this may only be used if the
+ * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
+ * used to put the given channel into the verified state).
+ *
+ * There is no guarantee that the verification codes returned by this method will be of a
+ * similar structure or form as the ones that are delivered to the channel via
+ * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
+ * the codes delivered via SendNotificationChannelVerificationCode() and returned from
+ * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
+ * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
+ * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
+ * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ *
+ *
Sample code:
+ *
+ *
+ * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
* .setName(name.toString())
* .build();
- * while (true) {
- * ListNotificationChannelDescriptorsResponse response = notificationChannelServiceClient.listNotificationChannelDescriptorsCallable().call(request);
- * for (NotificationChannelDescriptor element : response.getChannelDescriptorsList()) {
- * // doThingsWith(element);
- * }
- * String nextPageToken = response.getNextPageToken();
- * if (!Strings.isNullOrEmpty(nextPageToken)) {
- * request = request.toBuilder().setPageToken(nextPageToken).build();
- * } else {
- * break;
- * }
- * }
+ * GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final GetNotificationChannelVerificationCodeResponse
+ getNotificationChannelVerificationCode(
+ GetNotificationChannelVerificationCodeRequest request) {
+ return getNotificationChannelVerificationCodeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Requests a verification code for an already verified channel that can then be used in a call to
+ * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
+ * in a different project. This makes it possible to copy a channel between projects without
+ * requiring manual reverification of the channel. If the channel is not in the verified state,
+ * this method will fail (in other words, this may only be used if the
+ * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
+ * used to put the given channel into the verified state).
+ *
+ * There is no guarantee that the verification codes returned by this method will be of a
+ * similar structure or form as the ones that are delivered to the channel via
+ * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
+ * the codes delivered via SendNotificationChannelVerificationCode() and returned from
+ * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
+ * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
+ * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
+ * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ *
+ *
Sample code:
+ *
+ *
+ * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<GetNotificationChannelVerificationCodeResponse> future = notificationChannelServiceClient.getNotificationChannelVerificationCodeCallable().futureCall(request);
+ * // Do something
+ * GetNotificationChannelVerificationCodeResponse response = future.get();
* }
*
*/
public final UnaryCallable<
- ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse>
- listNotificationChannelDescriptorsCallable() {
- return stub.listNotificationChannelDescriptorsCallable();
+ GetNotificationChannelVerificationCodeRequest,
+ GetNotificationChannelVerificationCodeResponse>
+ getNotificationChannelVerificationCodeCallable() {
+ return stub.getNotificationChannelVerificationCodeCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single channel descriptor. The descriptor indicates which fields are expected /
- * permitted for a notification channel of the given type.
+ * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
+ * result of calling `SendNotificationChannelVerificationCode`.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * String code = "";
+ * NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name, code);
* }
*
*
- * @param name Required. The channel type for which to execute the request. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE]
+ * @param name Required. The notification channel to verify.
+ * @param code Required. The verification code that was delivered to the channel as a result of
+ * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved
+ * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one
+ * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that
+ * the code is valid UTF-8; one should not make any assumptions regarding the structure or
+ * format of the code).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannelDescriptor getNotificationChannelDescriptor(
- NotificationChannelDescriptorName name) {
- GetNotificationChannelDescriptorRequest request =
- GetNotificationChannelDescriptorRequest.newBuilder()
+ public final NotificationChannel verifyNotificationChannel(
+ NotificationChannelName name, String code) {
+ VerifyNotificationChannelRequest request =
+ VerifyNotificationChannelRequest.newBuilder()
.setName(name == null ? null : name.toString())
+ .setCode(code)
.build();
- return getNotificationChannelDescriptor(request);
+ return verifyNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single channel descriptor. The descriptor indicates which fields are expected /
- * permitted for a notification channel of the given type.
+ * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
+ * result of calling `SendNotificationChannelVerificationCode`.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name.toString());
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * String code = "";
+ * NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name.toString(), code);
* }
*
*
- * @param name Required. The channel type for which to execute the request. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE]
+ * @param name Required. The notification channel to verify.
+ * @param code Required. The verification code that was delivered to the channel as a result of
+ * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved
+ * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one
+ * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that
+ * the code is valid UTF-8; one should not make any assumptions regarding the structure or
+ * format of the code).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannelDescriptor getNotificationChannelDescriptor(String name) {
- GetNotificationChannelDescriptorRequest request =
- GetNotificationChannelDescriptorRequest.newBuilder().setName(name).build();
- return getNotificationChannelDescriptor(request);
+ public final NotificationChannel verifyNotificationChannel(String name, String code) {
+ VerifyNotificationChannelRequest request =
+ VerifyNotificationChannelRequest.newBuilder().setName(name).setCode(code).build();
+ return verifyNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single channel descriptor. The descriptor indicates which fields are expected /
- * permitted for a notification channel of the given type.
+ * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
+ * result of calling `SendNotificationChannelVerificationCode`.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- * GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * String code = "";
+ * VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
* .setName(name.toString())
+ * .setCode(code)
* .build();
- * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(request);
+ * NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannelDescriptor getNotificationChannelDescriptor(
- GetNotificationChannelDescriptorRequest request) {
- return getNotificationChannelDescriptorCallable().call(request);
+ public final NotificationChannel verifyNotificationChannel(
+ VerifyNotificationChannelRequest request) {
+ return verifyNotificationChannelCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single channel descriptor. The descriptor indicates which fields are expected /
- * permitted for a notification channel of the given type.
+ * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
+ * result of calling `SendNotificationChannelVerificationCode`.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.of("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
- * GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * String code = "";
+ * VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
* .setName(name.toString())
+ * .setCode(code)
* .build();
- * ApiFuture<NotificationChannelDescriptor> future = notificationChannelServiceClient.getNotificationChannelDescriptorCallable().futureCall(request);
+ * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.verifyNotificationChannelCallable().futureCall(request);
* // Do something
- * NotificationChannelDescriptor response = future.get();
+ * NotificationChannel response = future.get();
* }
*
*/
- public final UnaryCallable
- getNotificationChannelDescriptorCallable() {
- return stub.getNotificationChannelDescriptorCallable();
+ public final UnaryCallable
+ verifyNotificationChannelCallable() {
+ return stub.verifyNotificationChannelCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the notification channels that have been created for the project.
+ * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
+ * new channel types to be dynamically added.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name).iterateAll()) {
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name).iterateAll()) {
* // doThingsWith(element);
* }
* }
*
*
- * @param name Required. The project on which to execute the request. The format is:
+ * @param name Required. The REST resource name of the parent from which to retrieve the
+ * notification channel descriptors. The expected syntax is:
* projects/[PROJECT_ID_OR_NUMBER]
- *
This names the container in which to look for the notification channels; it does not
- * name a specific channel. To query a specific channel by REST resource name, use the
- * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel]
- * operation.
+ *
Note that this names the parent container in which to look for the descriptors; to
+ * retrieve a single descriptor by name, use the
+ * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor]
+ * operation, instead.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListNotificationChannelsPagedResponse listNotificationChannels(ProjectName name) {
- ListNotificationChannelsRequest request =
- ListNotificationChannelsRequest.newBuilder()
+ public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
+ ResourceName name) {
+ ListNotificationChannelDescriptorsRequest request =
+ ListNotificationChannelDescriptorsRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
- return listNotificationChannels(request);
+ return listNotificationChannelDescriptors(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the notification channels that have been created for the project.
+ * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
+ * new channel types to be dynamically added.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name.toString()).iterateAll()) {
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(name.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
*
*
- * @param name Required. The project on which to execute the request. The format is:
+ * @param name Required. The REST resource name of the parent from which to retrieve the
+ * notification channel descriptors. The expected syntax is:
* projects/[PROJECT_ID_OR_NUMBER]
- *
This names the container in which to look for the notification channels; it does not
- * name a specific channel. To query a specific channel by REST resource name, use the
- * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel]
- * operation.
+ *
Note that this names the parent container in which to look for the descriptors; to
+ * retrieve a single descriptor by name, use the
+ * [GetNotificationChannelDescriptor][google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor]
+ * operation, instead.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListNotificationChannelsPagedResponse listNotificationChannels(String name) {
- ListNotificationChannelsRequest request =
- ListNotificationChannelsRequest.newBuilder().setName(name).build();
- return listNotificationChannels(request);
+ public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
+ String name) {
+ ListNotificationChannelDescriptorsRequest request =
+ ListNotificationChannelDescriptorsRequest.newBuilder().setName(name).build();
+ return listNotificationChannelDescriptors(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the notification channels that have been created for the project.
+ * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
+ * new channel types to be dynamically added.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
- * for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(request).iterateAll()) {
+ * for (NotificationChannelDescriptor element : notificationChannelServiceClient.listNotificationChannelDescriptors(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -512,51 +649,55 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(Stri
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListNotificationChannelsPagedResponse listNotificationChannels(
- ListNotificationChannelsRequest request) {
- return listNotificationChannelsPagedCallable().call(request);
+ public final ListNotificationChannelDescriptorsPagedResponse listNotificationChannelDescriptors(
+ ListNotificationChannelDescriptorsRequest request) {
+ return listNotificationChannelDescriptorsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the notification channels that have been created for the project.
+ * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
+ * new channel types to be dynamically added.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<ListNotificationChannelsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelsPagedCallable().futureCall(request);
+ * ApiFuture<ListNotificationChannelDescriptorsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelDescriptorsPagedCallable().futureCall(request);
* // Do something
- * for (NotificationChannel element : future.get().iterateAll()) {
+ * for (NotificationChannelDescriptor element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
*
*/
- public final UnaryCallable
- listNotificationChannelsPagedCallable() {
- return stub.listNotificationChannelsPagedCallable();
+ public final UnaryCallable<
+ ListNotificationChannelDescriptorsRequest,
+ ListNotificationChannelDescriptorsPagedResponse>
+ listNotificationChannelDescriptorsPagedCallable() {
+ return stub.listNotificationChannelDescriptorsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Lists the notification channels that have been created for the project.
+ * Lists the descriptors for supported channel types. The use of descriptors makes it possible for
+ * new channel types to be dynamically added.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * ListNotificationChannelDescriptorsRequest request = ListNotificationChannelDescriptorsRequest.newBuilder()
* .setName(name.toString())
* .build();
* while (true) {
- * ListNotificationChannelsResponse response = notificationChannelServiceClient.listNotificationChannelsCallable().call(request);
- * for (NotificationChannel element : response.getNotificationChannelsList()) {
+ * ListNotificationChannelDescriptorsResponse response = notificationChannelServiceClient.listNotificationChannelDescriptorsCallable().call(request);
+ * for (NotificationChannelDescriptor element : response.getChannelDescriptorsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -569,794 +710,654 @@ public final ListNotificationChannelsPagedResponse listNotificationChannels(
* }
*
*/
- public final UnaryCallable
- listNotificationChannelsCallable() {
- return stub.listNotificationChannelsCallable();
+ public final UnaryCallable<
+ ListNotificationChannelDescriptorsRequest, ListNotificationChannelDescriptorsResponse>
+ listNotificationChannelDescriptorsCallable() {
+ return stub.listNotificationChannelDescriptorsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single notification channel. The channel includes the relevant configuration details
- * with which the channel was created. However, the response may truncate or omit passwords, API
- * keys, or other private key matter and thus the response may not be 100% identical to the
- * information that was supplied in the call to the create method.
+ * Gets a single channel descriptor. The descriptor indicates which fields are expected /
+ * permitted for a notification channel of the given type.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name);
+ * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+ * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name);
* }
*
*
- * @param name Required. The channel for which to execute the request. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+ * @param name Required. The channel type for which to execute the request. The format is:
+ *
projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE]
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel getNotificationChannel(NotificationChannelName name) {
- GetNotificationChannelRequest request =
- GetNotificationChannelRequest.newBuilder()
+ public final NotificationChannelDescriptor getNotificationChannelDescriptor(
+ NotificationChannelDescriptorName name) {
+ GetNotificationChannelDescriptorRequest request =
+ GetNotificationChannelDescriptorRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
- return getNotificationChannel(request);
+ return getNotificationChannelDescriptor(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single notification channel. The channel includes the relevant configuration details
- * with which the channel was created. However, the response may truncate or omit passwords, API
- * keys, or other private key matter and thus the response may not be 100% identical to the
- * information that was supplied in the call to the create method.
+ * Gets a single channel descriptor. The descriptor indicates which fields are expected /
+ * permitted for a notification channel of the given type.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name.toString());
+ * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+ * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(name.toString());
* }
*
*
- * @param name Required. The channel for which to execute the request. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
+ * @param name Required. The channel type for which to execute the request. The format is:
+ *
projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE]
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel getNotificationChannel(String name) {
- GetNotificationChannelRequest request =
- GetNotificationChannelRequest.newBuilder().setName(name).build();
- return getNotificationChannel(request);
+ public final NotificationChannelDescriptor getNotificationChannelDescriptor(String name) {
+ GetNotificationChannelDescriptorRequest request =
+ GetNotificationChannelDescriptorRequest.newBuilder().setName(name).build();
+ return getNotificationChannelDescriptor(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single notification channel. The channel includes the relevant configuration details
- * with which the channel was created. However, the response may truncate or omit passwords, API
- * keys, or other private key matter and thus the response may not be 100% identical to the
- * information that was supplied in the call to the create method.
+ * Gets a single channel descriptor. The descriptor indicates which fields are expected /
+ * permitted for a notification channel of the given type.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
+ * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+ * GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
- * NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(request);
+ * NotificationChannelDescriptor response = notificationChannelServiceClient.getNotificationChannelDescriptor(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel getNotificationChannel(GetNotificationChannelRequest request) {
- return getNotificationChannelCallable().call(request);
+ public final NotificationChannelDescriptor getNotificationChannelDescriptor(
+ GetNotificationChannelDescriptorRequest request) {
+ return getNotificationChannelDescriptorCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Gets a single notification channel. The channel includes the relevant configuration details
- * with which the channel was created. However, the response may truncate or omit passwords, API
- * keys, or other private key matter and thus the response may not be 100% identical to the
- * information that was supplied in the call to the create method.
+ * Gets a single channel descriptor. The descriptor indicates which fields are expected /
+ * permitted for a notification channel of the given type.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
+ * NotificationChannelDescriptorName name = NotificationChannelDescriptorName.ofProjectChannelDescriptorName("[PROJECT]", "[CHANNEL_DESCRIPTOR]");
+ * GetNotificationChannelDescriptorRequest request = GetNotificationChannelDescriptorRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.getNotificationChannelCallable().futureCall(request);
+ * ApiFuture<NotificationChannelDescriptor> future = notificationChannelServiceClient.getNotificationChannelDescriptorCallable().futureCall(request);
* // Do something
- * NotificationChannel response = future.get();
- * }
- *
- */
- public final UnaryCallable
- getNotificationChannelCallable() {
- return stub.getNotificationChannelCallable();
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new notification channel, representing a single notification endpoint such as an
- * email address, SMS number, or PagerDuty service.
- *
- * Sample code:
- *
- *
- * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
+ * NotificationChannelDescriptor response = future.get();
* }
*
- *
- * @param name Required. The project on which to execute the request. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]
- *
This names the container into which the channel will be written, this does not name the
- * newly created channel. The resulting channel's name will have a normalized version of this
- * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the
- * channel.
- * @param notificationChannel Required. The definition of the `NotificationChannel` to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel createNotificationChannel(
- ProjectName name, NotificationChannel notificationChannel) {
- CreateNotificationChannelRequest request =
- CreateNotificationChannelRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .setNotificationChannel(notificationChannel)
- .build();
- return createNotificationChannel(request);
+ public final UnaryCallable
+ getNotificationChannelDescriptorCallable() {
+ return stub.getNotificationChannelDescriptorCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates a new notification channel, representing a single notification endpoint such as an
- * email address, SMS number, or PagerDuty service.
+ * Lists the notification channels that have been created for the project.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name.toString(), notificationChannel);
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
* @param name Required. The project on which to execute the request. The format is:
* projects/[PROJECT_ID_OR_NUMBER]
- *
This names the container into which the channel will be written, this does not name the
- * newly created channel. The resulting channel's name will have a normalized version of this
- * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the
- * channel.
- * @param notificationChannel Required. The definition of the `NotificationChannel` to create.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final NotificationChannel createNotificationChannel(
- String name, NotificationChannel notificationChannel) {
- CreateNotificationChannelRequest request =
- CreateNotificationChannelRequest.newBuilder()
- .setName(name)
- .setNotificationChannel(notificationChannel)
- .build();
- return createNotificationChannel(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Creates a new notification channel, representing a single notification endpoint such as an
- * email address, SMS number, or PagerDuty service.
- *
- *
Sample code:
- *
- *
- * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
- * .setName(name.toString())
- * .setNotificationChannel(notificationChannel)
- * .build();
- * NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
+ * This names the container in which to look for the notification channels; it does not
+ * name a specific channel. To query a specific channel by REST resource name, use the
+ * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel]
+ * operation.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel createNotificationChannel(
- CreateNotificationChannelRequest request) {
- return createNotificationChannelCallable().call(request);
+ public final ListNotificationChannelsPagedResponse listNotificationChannels(ResourceName name) {
+ ListNotificationChannelsRequest request =
+ ListNotificationChannelsRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return listNotificationChannels(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Creates a new notification channel, representing a single notification endpoint such as an
- * email address, SMS number, or PagerDuty service.
+ * Lists the notification channels that have been created for the project.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * ProjectName name = ProjectName.of("[PROJECT]");
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
- * .setName(name.toString())
- * .setNotificationChannel(notificationChannel)
- * .build();
- * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.createNotificationChannelCallable().futureCall(request);
- * // Do something
- * NotificationChannel response = future.get();
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(name.toString()).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
+ *
+ * @param name Required. The project on which to execute the request. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]
+ *
This names the container in which to look for the notification channels; it does not
+ * name a specific channel. To query a specific channel by REST resource name, use the
+ * [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel]
+ * operation.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable
- createNotificationChannelCallable() {
- return stub.createNotificationChannelCallable();
+ public final ListNotificationChannelsPagedResponse listNotificationChannels(String name) {
+ ListNotificationChannelsRequest request =
+ ListNotificationChannelsRequest.newBuilder().setName(name).build();
+ return listNotificationChannels(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a notification channel. Fields not specified in the field mask remain unchanged.
+ * Lists the notification channels that have been created for the project.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * FieldMask updateMask = FieldMask.newBuilder().build();
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(updateMask, notificationChannel);
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * for (NotificationChannel element : notificationChannelServiceClient.listNotificationChannels(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
*
- * @param updateMask The fields to update.
- * @param notificationChannel Required. A description of the changes to be applied to the
- * specified notification channel. The description must provide a definition for fields to be
- * updated; the names of these fields should also be included in the `update_mask`.
+ * @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel updateNotificationChannel(
- FieldMask updateMask, NotificationChannel notificationChannel) {
- UpdateNotificationChannelRequest request =
- UpdateNotificationChannelRequest.newBuilder()
- .setUpdateMask(updateMask)
- .setNotificationChannel(notificationChannel)
- .build();
- return updateNotificationChannel(request);
+ public final ListNotificationChannelsPagedResponse listNotificationChannels(
+ ListNotificationChannelsRequest request) {
+ return listNotificationChannelsPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a notification channel. Fields not specified in the field mask remain unchanged.
+ * Lists the notification channels that have been created for the project.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
- * .setNotificationChannel(notificationChannel)
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(request);
+ * ApiFuture<ListNotificationChannelsPagedResponse> future = notificationChannelServiceClient.listNotificationChannelsPagedCallable().futureCall(request);
+ * // Do something
+ * for (NotificationChannel element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
* }
*
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel updateNotificationChannel(
- UpdateNotificationChannelRequest request) {
- return updateNotificationChannelCallable().call(request);
+ public final UnaryCallable
+ listNotificationChannelsPagedCallable() {
+ return stub.listNotificationChannelsPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Updates a notification channel. Fields not specified in the field mask remain unchanged.
+ * Lists the notification channels that have been created for the project.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
- * UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
- * .setNotificationChannel(notificationChannel)
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * ListNotificationChannelsRequest request = ListNotificationChannelsRequest.newBuilder()
+ * .setName(name.toString())
* .build();
- * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.updateNotificationChannelCallable().futureCall(request);
- * // Do something
- * NotificationChannel response = future.get();
+ * while (true) {
+ * ListNotificationChannelsResponse response = notificationChannelServiceClient.listNotificationChannelsCallable().call(request);
+ * for (NotificationChannel element : response.getNotificationChannelsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
* }
*
*/
- public final UnaryCallable
- updateNotificationChannelCallable() {
- return stub.updateNotificationChannelCallable();
+ public final UnaryCallable
+ listNotificationChannelsCallable() {
+ return stub.listNotificationChannelsCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a notification channel.
+ * Gets a single notification channel. The channel includes the relevant configuration details
+ * with which the channel was created. However, the response may truncate or omit passwords, API
+ * keys, or other private key matter and thus the response may not be 100% identical to the
+ * information that was supplied in the call to the create method.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * boolean force = false;
- * notificationChannelServiceClient.deleteNotificationChannel(name, force);
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name);
* }
*
*
* @param name Required. The channel for which to execute the request. The format is:
* projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
- * @param force If true, the notification channel will be deleted regardless of its use in alert
- * policies (the policies will be updated to remove the channel). If false, channels that are
- * still referenced by an existing alerting policy will fail to be deleted in a delete
- * operation.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteNotificationChannel(NotificationChannelName name, boolean force) {
- DeleteNotificationChannelRequest request =
- DeleteNotificationChannelRequest.newBuilder()
+ public final NotificationChannel getNotificationChannel(NotificationChannelName name) {
+ GetNotificationChannelRequest request =
+ GetNotificationChannelRequest.newBuilder()
.setName(name == null ? null : name.toString())
- .setForce(force)
.build();
- deleteNotificationChannel(request);
+ return getNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a notification channel.
+ * Gets a single notification channel. The channel includes the relevant configuration details
+ * with which the channel was created. However, the response may truncate or omit passwords, API
+ * keys, or other private key matter and thus the response may not be 100% identical to the
+ * information that was supplied in the call to the create method.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * boolean force = false;
- * notificationChannelServiceClient.deleteNotificationChannel(name.toString(), force);
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(name.toString());
* }
*
*
* @param name Required. The channel for which to execute the request. The format is:
* projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
- * @param force If true, the notification channel will be deleted regardless of its use in alert
- * policies (the policies will be updated to remove the channel). If false, channels that are
- * still referenced by an existing alerting policy will fail to be deleted in a delete
- * operation.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteNotificationChannel(String name, boolean force) {
- DeleteNotificationChannelRequest request =
- DeleteNotificationChannelRequest.newBuilder().setName(name).setForce(force).build();
- deleteNotificationChannel(request);
+ public final NotificationChannel getNotificationChannel(String name) {
+ GetNotificationChannelRequest request =
+ GetNotificationChannelRequest.newBuilder().setName(name).build();
+ return getNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a notification channel.
+ * Gets a single notification channel. The channel includes the relevant configuration details
+ * with which the channel was created. However, the response may truncate or omit passwords, API
+ * keys, or other private key matter and thus the response may not be 100% identical to the
+ * information that was supplied in the call to the create method.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
* .setName(name.toString())
* .build();
- * notificationChannelServiceClient.deleteNotificationChannel(request);
+ * NotificationChannel response = notificationChannelServiceClient.getNotificationChannel(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteNotificationChannel(DeleteNotificationChannelRequest request) {
- deleteNotificationChannelCallable().call(request);
+ public final NotificationChannel getNotificationChannel(GetNotificationChannelRequest request) {
+ return getNotificationChannelCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Deletes a notification channel.
+ * Gets a single notification channel. The channel includes the relevant configuration details
+ * with which the channel was created. However, the response may truncate or omit passwords, API
+ * keys, or other private key matter and thus the response may not be 100% identical to the
+ * information that was supplied in the call to the create method.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * DeleteNotificationChannelRequest request = DeleteNotificationChannelRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * GetNotificationChannelRequest request = GetNotificationChannelRequest.newBuilder()
* .setName(name.toString())
* .build();
- * ApiFuture<Void> future = notificationChannelServiceClient.deleteNotificationChannelCallable().futureCall(request);
+ * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.getNotificationChannelCallable().futureCall(request);
* // Do something
- * future.get();
+ * NotificationChannel response = future.get();
* }
*
*/
- public final UnaryCallable
- deleteNotificationChannelCallable() {
- return stub.deleteNotificationChannelCallable();
+ public final UnaryCallable
+ getNotificationChannelCallable() {
+ return stub.getNotificationChannelCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Causes a verification code to be delivered to the channel. The code can then be supplied in
- * `VerifyNotificationChannel` to verify the channel.
+ * Creates a new notification channel, representing a single notification endpoint such as an
+ * email address, SMS number, or PagerDuty service.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * notificationChannelServiceClient.sendNotificationChannelVerificationCode(name);
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name, notificationChannel);
* }
*
*
- * @param name Required. The notification channel to which to send a verification code.
+ * @param name Required. The project on which to execute the request. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]
+ *
This names the container into which the channel will be written, this does not name the
+ * newly created channel. The resulting channel's name will have a normalized version of this
+ * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the
+ * channel.
+ * @param notificationChannel Required. The definition of the `NotificationChannel` to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void sendNotificationChannelVerificationCode(NotificationChannelName name) {
- SendNotificationChannelVerificationCodeRequest request =
- SendNotificationChannelVerificationCodeRequest.newBuilder()
+ public final NotificationChannel createNotificationChannel(
+ ResourceName name, NotificationChannel notificationChannel) {
+ CreateNotificationChannelRequest request =
+ CreateNotificationChannelRequest.newBuilder()
.setName(name == null ? null : name.toString())
+ .setNotificationChannel(notificationChannel)
.build();
- sendNotificationChannelVerificationCode(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Causes a verification code to be delivered to the channel. The code can then be supplied in
- * `VerifyNotificationChannel` to verify the channel.
- *
- *
Sample code:
- *
- *
- * try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * notificationChannelServiceClient.sendNotificationChannelVerificationCode(name.toString());
- * }
- *
- *
- * @param name Required. The notification channel to which to send a verification code.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void sendNotificationChannelVerificationCode(String name) {
- SendNotificationChannelVerificationCodeRequest request =
- SendNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build();
- sendNotificationChannelVerificationCode(request);
+ return createNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Causes a verification code to be delivered to the channel. The code can then be supplied in
- * `VerifyNotificationChannel` to verify the channel.
+ * Creates a new notification channel, representing a single notification endpoint such as an
+ * email address, SMS number, or PagerDuty service.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * notificationChannelServiceClient.sendNotificationChannelVerificationCode(request);
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(name.toString(), notificationChannel);
* }
*
*
- * @param request The request object containing all of the parameters for the API call.
+ * @param name Required. The project on which to execute the request. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]
+ *
This names the container into which the channel will be written, this does not name the
+ * newly created channel. The resulting channel's name will have a normalized version of this
+ * field as a prefix, but will add `/notificationChannels/[CHANNEL_ID]` to identify the
+ * channel.
+ * @param notificationChannel Required. The definition of the `NotificationChannel` to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void sendNotificationChannelVerificationCode(
- SendNotificationChannelVerificationCodeRequest request) {
- sendNotificationChannelVerificationCodeCallable().call(request);
+ public final NotificationChannel createNotificationChannel(
+ String name, NotificationChannel notificationChannel) {
+ CreateNotificationChannelRequest request =
+ CreateNotificationChannelRequest.newBuilder()
+ .setName(name)
+ .setNotificationChannel(notificationChannel)
+ .build();
+ return createNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Causes a verification code to be delivered to the channel. The code can then be supplied in
- * `VerifyNotificationChannel` to verify the channel.
+ * Creates a new notification channel, representing a single notification endpoint such as an
+ * email address, SMS number, or PagerDuty service.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
* .setName(name.toString())
+ * .setNotificationChannel(notificationChannel)
* .build();
- * ApiFuture<Void> future = notificationChannelServiceClient.sendNotificationChannelVerificationCodeCallable().futureCall(request);
- * // Do something
- * future.get();
+ * NotificationChannel response = notificationChannelServiceClient.createNotificationChannel(request);
* }
*
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final UnaryCallable
- sendNotificationChannelVerificationCodeCallable() {
- return stub.sendNotificationChannelVerificationCodeCallable();
+ public final NotificationChannel createNotificationChannel(
+ CreateNotificationChannelRequest request) {
+ return createNotificationChannelCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Requests a verification code for an already verified channel that can then be used in a call to
- * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
- * in a different project. This makes it possible to copy a channel between projects without
- * requiring manual reverification of the channel. If the channel is not in the verified state,
- * this method will fail (in other words, this may only be used if the
- * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
- * used to put the given channel into the verified state).
- *
- * There is no guarantee that the verification codes returned by this method will be of a
- * similar structure or form as the ones that are delivered to the channel via
- * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
- * the codes delivered via SendNotificationChannelVerificationCode() and returned from
- * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
- * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
- * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
- * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ * Creates a new notification channel, representing a single notification endpoint such as an
+ * email address, SMS number, or PagerDuty service.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name);
+ * ResourceName name = ProjectName.of("[PROJECT]");
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * CreateNotificationChannelRequest request = CreateNotificationChannelRequest.newBuilder()
+ * .setName(name.toString())
+ * .setNotificationChannel(notificationChannel)
+ * .build();
+ * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.createNotificationChannelCallable().futureCall(request);
+ * // Do something
+ * NotificationChannel response = future.get();
* }
*
- *
- * @param name Required. The notification channel for which a verification code is to be generated
- * and retrieved. This must name a channel that is already verified; if the specified channel
- * is not verified, the request will fail.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final GetNotificationChannelVerificationCodeResponse
- getNotificationChannelVerificationCode(NotificationChannelName name) {
- GetNotificationChannelVerificationCodeRequest request =
- GetNotificationChannelVerificationCodeRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- return getNotificationChannelVerificationCode(request);
+ public final UnaryCallable
+ createNotificationChannelCallable() {
+ return stub.createNotificationChannelCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Requests a verification code for an already verified channel that can then be used in a call to
- * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
- * in a different project. This makes it possible to copy a channel between projects without
- * requiring manual reverification of the channel. If the channel is not in the verified state,
- * this method will fail (in other words, this may only be used if the
- * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
- * used to put the given channel into the verified state).
- *
- * There is no guarantee that the verification codes returned by this method will be of a
- * similar structure or form as the ones that are delivered to the channel via
- * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
- * the codes delivered via SendNotificationChannelVerificationCode() and returned from
- * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
- * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
- * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
- * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ * Updates a notification channel. Fields not specified in the field mask remain unchanged.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(name.toString());
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(updateMask, notificationChannel);
* }
*
*
- * @param name Required. The notification channel for which a verification code is to be generated
- * and retrieved. This must name a channel that is already verified; if the specified channel
- * is not verified, the request will fail.
+ * @param updateMask The fields to update.
+ * @param notificationChannel Required. A description of the changes to be applied to the
+ * specified notification channel. The description must provide a definition for fields to be
+ * updated; the names of these fields should also be included in the `update_mask`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final GetNotificationChannelVerificationCodeResponse
- getNotificationChannelVerificationCode(String name) {
- GetNotificationChannelVerificationCodeRequest request =
- GetNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build();
- return getNotificationChannelVerificationCode(request);
+ public final NotificationChannel updateNotificationChannel(
+ FieldMask updateMask, NotificationChannel notificationChannel) {
+ UpdateNotificationChannelRequest request =
+ UpdateNotificationChannelRequest.newBuilder()
+ .setUpdateMask(updateMask)
+ .setNotificationChannel(notificationChannel)
+ .build();
+ return updateNotificationChannel(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Requests a verification code for an already verified channel that can then be used in a call to
- * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
- * in a different project. This makes it possible to copy a channel between projects without
- * requiring manual reverification of the channel. If the channel is not in the verified state,
- * this method will fail (in other words, this may only be used if the
- * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
- * used to put the given channel into the verified state).
- *
- * There is no guarantee that the verification codes returned by this method will be of a
- * similar structure or form as the ones that are delivered to the channel via
- * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
- * the codes delivered via SendNotificationChannelVerificationCode() and returned from
- * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
- * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
- * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
- * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ * Updates a notification channel. Fields not specified in the field mask remain unchanged.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
- * .setName(name.toString())
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
+ * .setNotificationChannel(notificationChannel)
* .build();
- * GetNotificationChannelVerificationCodeResponse response = notificationChannelServiceClient.getNotificationChannelVerificationCode(request);
+ * NotificationChannel response = notificationChannelServiceClient.updateNotificationChannel(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final GetNotificationChannelVerificationCodeResponse
- getNotificationChannelVerificationCode(
- GetNotificationChannelVerificationCodeRequest request) {
- return getNotificationChannelVerificationCodeCallable().call(request);
+ public final NotificationChannel updateNotificationChannel(
+ UpdateNotificationChannelRequest request) {
+ return updateNotificationChannelCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Requests a verification code for an already verified channel that can then be used in a call to
- * VerifyNotificationChannel() on a different channel with an equivalent identity in the same or
- * in a different project. This makes it possible to copy a channel between projects without
- * requiring manual reverification of the channel. If the channel is not in the verified state,
- * this method will fail (in other words, this may only be used if the
- * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been
- * used to put the given channel into the verified state).
- *
- * There is no guarantee that the verification codes returned by this method will be of a
- * similar structure or form as the ones that are delivered to the channel via
- * SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both
- * the codes delivered via SendNotificationChannelVerificationCode() and returned from
- * GetNotificationChannelVerificationCode(), it is typically the case that the verification codes
- * delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter
- * expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return
- * a much longer, websafe base 64 encoded string that has a longer expiration time.
+ * Updates a notification channel. Fields not specified in the field mask remain unchanged.
*
*
Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * GetNotificationChannelVerificationCodeRequest request = GetNotificationChannelVerificationCodeRequest.newBuilder()
- * .setName(name.toString())
+ * NotificationChannel notificationChannel = NotificationChannel.newBuilder().build();
+ * UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder()
+ * .setNotificationChannel(notificationChannel)
* .build();
- * ApiFuture<GetNotificationChannelVerificationCodeResponse> future = notificationChannelServiceClient.getNotificationChannelVerificationCodeCallable().futureCall(request);
+ * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.updateNotificationChannelCallable().futureCall(request);
* // Do something
- * GetNotificationChannelVerificationCodeResponse response = future.get();
+ * NotificationChannel response = future.get();
* }
*
*/
- public final UnaryCallable<
- GetNotificationChannelVerificationCodeRequest,
- GetNotificationChannelVerificationCodeResponse>
- getNotificationChannelVerificationCodeCallable() {
- return stub.getNotificationChannelVerificationCodeCallable();
+ public final UnaryCallable
+ updateNotificationChannelCallable() {
+ return stub.updateNotificationChannelCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
- * result of calling `SendNotificationChannelVerificationCode`.
+ * Causes a verification code to be delivered to the channel. The code can then be supplied in
+ * `VerifyNotificationChannel` to verify the channel.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * String code = "";
- * NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name, code);
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * notificationChannelServiceClient.sendNotificationChannelVerificationCode(name);
* }
*
*
- * @param name Required. The notification channel to verify.
- * @param code Required. The verification code that was delivered to the channel as a result of
- * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved
- * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one
- * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that
- * the code is valid UTF-8; one should not make any assumptions regarding the structure or
- * format of the code).
+ * @param name Required. The notification channel to which to send a verification code.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel verifyNotificationChannel(
- NotificationChannelName name, String code) {
- VerifyNotificationChannelRequest request =
- VerifyNotificationChannelRequest.newBuilder()
+ public final void sendNotificationChannelVerificationCode(NotificationChannelName name) {
+ SendNotificationChannelVerificationCodeRequest request =
+ SendNotificationChannelVerificationCodeRequest.newBuilder()
.setName(name == null ? null : name.toString())
- .setCode(code)
.build();
- return verifyNotificationChannel(request);
+ sendNotificationChannelVerificationCode(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
- * result of calling `SendNotificationChannelVerificationCode`.
+ * Causes a verification code to be delivered to the channel. The code can then be supplied in
+ * `VerifyNotificationChannel` to verify the channel.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * String code = "";
- * NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(name.toString(), code);
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * notificationChannelServiceClient.sendNotificationChannelVerificationCode(name.toString());
* }
*
*
- * @param name Required. The notification channel to verify.
- * @param code Required. The verification code that was delivered to the channel as a result of
- * invoking the `SendNotificationChannelVerificationCode` API method or that was retrieved
- * from a verified channel via `GetNotificationChannelVerificationCode`. For example, one
- * might have "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed that
- * the code is valid UTF-8; one should not make any assumptions regarding the structure or
- * format of the code).
+ * @param name Required. The notification channel to which to send a verification code.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel verifyNotificationChannel(String name, String code) {
- VerifyNotificationChannelRequest request =
- VerifyNotificationChannelRequest.newBuilder().setName(name).setCode(code).build();
- return verifyNotificationChannel(request);
+ public final void sendNotificationChannelVerificationCode(String name) {
+ SendNotificationChannelVerificationCodeRequest request =
+ SendNotificationChannelVerificationCodeRequest.newBuilder().setName(name).build();
+ sendNotificationChannelVerificationCode(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
- * result of calling `SendNotificationChannelVerificationCode`.
+ * Causes a verification code to be delivered to the channel. The code can then be supplied in
+ * `VerifyNotificationChannel` to verify the channel.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * String code = "";
- * VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
* .setName(name.toString())
- * .setCode(code)
* .build();
- * NotificationChannel response = notificationChannelServiceClient.verifyNotificationChannel(request);
+ * notificationChannelServiceClient.sendNotificationChannelVerificationCode(request);
* }
*
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final NotificationChannel verifyNotificationChannel(
- VerifyNotificationChannelRequest request) {
- return verifyNotificationChannelCallable().call(request);
+ public final void sendNotificationChannelVerificationCode(
+ SendNotificationChannelVerificationCodeRequest request) {
+ sendNotificationChannelVerificationCodeCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
- * Verifies a `NotificationChannel` by proving receipt of the code delivered to the channel as a
- * result of calling `SendNotificationChannelVerificationCode`.
+ * Causes a verification code to be delivered to the channel. The code can then be supplied in
+ * `VerifyNotificationChannel` to verify the channel.
*
* Sample code:
*
*
* try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
- * NotificationChannelName name = NotificationChannelName.of("[PROJECT]", "[NOTIFICATION_CHANNEL]");
- * String code = "";
- * VerifyNotificationChannelRequest request = VerifyNotificationChannelRequest.newBuilder()
+ * NotificationChannelName name = NotificationChannelName.ofProjectNotificationChannelName("[PROJECT]", "[NOTIFICATION_CHANNEL]");
+ * SendNotificationChannelVerificationCodeRequest request = SendNotificationChannelVerificationCodeRequest.newBuilder()
* .setName(name.toString())
- * .setCode(code)
* .build();
- * ApiFuture<NotificationChannel> future = notificationChannelServiceClient.verifyNotificationChannelCallable().futureCall(request);
+ * ApiFuture<Void> future = notificationChannelServiceClient.sendNotificationChannelVerificationCodeCallable().futureCall(request);
* // Do something
- * NotificationChannel response = future.get();
+ * future.get();
* }
*
*/
- public final UnaryCallable
- verifyNotificationChannelCallable() {
- return stub.verifyNotificationChannelCallable();
+ public final UnaryCallable
+ sendNotificationChannelVerificationCodeCallable() {
+ return stub.sendNotificationChannelVerificationCodeCallable();
}
@Override
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java
index 27781e95..5e93ad36 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceSettings.java
@@ -65,16 +65,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of getNotificationChannelDescriptor to 30 seconds:
+ *
For example, to set the total timeout of deleteNotificationChannel to 30 seconds:
*
*
*
* NotificationChannelServiceSettings.Builder notificationChannelServiceSettingsBuilder =
* NotificationChannelServiceSettings.newBuilder();
* notificationChannelServiceSettingsBuilder
- * .getNotificationChannelDescriptorSettings()
+ * .deleteNotificationChannelSettings()
* .setRetrySettings(
- * notificationChannelServiceSettingsBuilder.getNotificationChannelDescriptorSettings().getRetrySettings().toBuilder()
+ * notificationChannelServiceSettingsBuilder.deleteNotificationChannelSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* NotificationChannelServiceSettings notificationChannelServiceSettings = notificationChannelServiceSettingsBuilder.build();
@@ -84,6 +84,31 @@
@Generated("by gapic-generator")
public class NotificationChannelServiceSettings
extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteNotificationChannel. */
+ public UnaryCallSettings
+ deleteNotificationChannelSettings() {
+ return ((NotificationChannelServiceStubSettings) getStubSettings())
+ .deleteNotificationChannelSettings();
+ }
+
+ /**
+ * Returns the object with the settings used for calls to getNotificationChannelVerificationCode.
+ */
+ public UnaryCallSettings<
+ GetNotificationChannelVerificationCodeRequest,
+ GetNotificationChannelVerificationCodeResponse>
+ getNotificationChannelVerificationCodeSettings() {
+ return ((NotificationChannelServiceStubSettings) getStubSettings())
+ .getNotificationChannelVerificationCodeSettings();
+ }
+
+ /** Returns the object with the settings used for calls to verifyNotificationChannel. */
+ public UnaryCallSettings
+ verifyNotificationChannelSettings() {
+ return ((NotificationChannelServiceStubSettings) getStubSettings())
+ .verifyNotificationChannelSettings();
+ }
+
/** Returns the object with the settings used for calls to listNotificationChannelDescriptors. */
public PagedCallSettings<
ListNotificationChannelDescriptorsRequest,
@@ -132,13 +157,6 @@ public class NotificationChannelServiceSettings
.updateNotificationChannelSettings();
}
- /** Returns the object with the settings used for calls to deleteNotificationChannel. */
- public UnaryCallSettings
- deleteNotificationChannelSettings() {
- return ((NotificationChannelServiceStubSettings) getStubSettings())
- .deleteNotificationChannelSettings();
- }
-
/**
* Returns the object with the settings used for calls to sendNotificationChannelVerificationCode.
*/
@@ -148,24 +166,6 @@ public class NotificationChannelServiceSettings
.sendNotificationChannelVerificationCodeSettings();
}
- /**
- * Returns the object with the settings used for calls to getNotificationChannelVerificationCode.
- */
- public UnaryCallSettings<
- GetNotificationChannelVerificationCodeRequest,
- GetNotificationChannelVerificationCodeResponse>
- getNotificationChannelVerificationCodeSettings() {
- return ((NotificationChannelServiceStubSettings) getStubSettings())
- .getNotificationChannelVerificationCodeSettings();
- }
-
- /** Returns the object with the settings used for calls to verifyNotificationChannel. */
- public UnaryCallSettings
- verifyNotificationChannelSettings() {
- return ((NotificationChannelServiceStubSettings) getStubSettings())
- .verifyNotificationChannelSettings();
- }
-
public static final NotificationChannelServiceSettings create(
NotificationChannelServiceStubSettings stub) throws IOException {
return new NotificationChannelServiceSettings.Builder(stub.toBuilder()).build();
@@ -264,6 +264,29 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteNotificationChannel. */
+ public UnaryCallSettings.Builder
+ deleteNotificationChannelSettings() {
+ return getStubSettingsBuilder().deleteNotificationChannelSettings();
+ }
+
+ /**
+ * Returns the builder for the settings used for calls to
+ * getNotificationChannelVerificationCode.
+ */
+ public UnaryCallSettings.Builder<
+ GetNotificationChannelVerificationCodeRequest,
+ GetNotificationChannelVerificationCodeResponse>
+ getNotificationChannelVerificationCodeSettings() {
+ return getStubSettingsBuilder().getNotificationChannelVerificationCodeSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to verifyNotificationChannel. */
+ public UnaryCallSettings.Builder
+ verifyNotificationChannelSettings() {
+ return getStubSettingsBuilder().verifyNotificationChannelSettings();
+ }
+
/**
* Returns the builder for the settings used for calls to listNotificationChannelDescriptors.
*/
@@ -309,12 +332,6 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().updateNotificationChannelSettings();
}
- /** Returns the builder for the settings used for calls to deleteNotificationChannel. */
- public UnaryCallSettings.Builder
- deleteNotificationChannelSettings() {
- return getStubSettingsBuilder().deleteNotificationChannelSettings();
- }
-
/**
* Returns the builder for the settings used for calls to
* sendNotificationChannelVerificationCode.
@@ -324,23 +341,6 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().sendNotificationChannelVerificationCodeSettings();
}
- /**
- * Returns the builder for the settings used for calls to
- * getNotificationChannelVerificationCode.
- */
- public UnaryCallSettings.Builder<
- GetNotificationChannelVerificationCodeRequest,
- GetNotificationChannelVerificationCodeResponse>
- getNotificationChannelVerificationCodeSettings() {
- return getStubSettingsBuilder().getNotificationChannelVerificationCodeSettings();
- }
-
- /** Returns the builder for the settings used for calls to verifyNotificationChannel. */
- public UnaryCallSettings.Builder
- verifyNotificationChannelSettings() {
- return getStubSettingsBuilder().verifyNotificationChannelSettings();
- }
-
@Override
public NotificationChannelServiceSettings build() throws IOException {
return new NotificationChannelServiceSettings(this);
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java
index 1822f954..af70cea0 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceClient.java
@@ -25,6 +25,7 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
import com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStub;
import com.google.cloud.monitoring.v3.stub.ServiceMonitoringServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -38,7 +39,6 @@
import com.google.monitoring.v3.ListServiceLevelObjectivesResponse;
import com.google.monitoring.v3.ListServicesRequest;
import com.google.monitoring.v3.ListServicesResponse;
-import com.google.monitoring.v3.ProjectName;
import com.google.monitoring.v3.Service;
import com.google.monitoring.v3.ServiceLevelObjective;
import com.google.monitoring.v3.ServiceLevelObjectiveName;
@@ -63,9 +63,8 @@
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
- * Service service = Service.newBuilder().build();
- * Service response = serviceMonitoringServiceClient.createService(parent, service);
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ * serviceMonitoringServiceClient.deleteService(name);
* }
*
*
@@ -176,6 +175,190 @@ public ServiceMonitoringServiceStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Soft delete this `Service`.
+ *
+ * Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ * serviceMonitoringServiceClient.deleteService(name);
+ * }
+ *
+ *
+ * @param name Required. Resource name of the `Service` to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteService(ServiceName name) {
+ DeleteServiceRequest request =
+ DeleteServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteService(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Soft delete this `Service`.
+ *
+ *
Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ * serviceMonitoringServiceClient.deleteService(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Resource name of the `Service` to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteService(String name) {
+ DeleteServiceRequest request = DeleteServiceRequest.newBuilder().setName(name).build();
+ deleteService(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Soft delete this `Service`.
+ *
+ *
Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ * DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * serviceMonitoringServiceClient.deleteService(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteService(DeleteServiceRequest request) {
+ deleteServiceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Soft delete this `Service`.
+ *
+ * Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
+ * DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable deleteServiceCallable() {
+ return stub.deleteServiceCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Delete the given `ServiceLevelObjective`.
+ *
+ * Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
+ * }
+ *
+ *
+ * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name) {
+ DeleteServiceLevelObjectiveRequest request =
+ DeleteServiceLevelObjectiveRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteServiceLevelObjective(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Delete the given `ServiceLevelObjective`.
+ *
+ *
Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * serviceMonitoringServiceClient.deleteServiceLevelObjective(name.toString());
+ * }
+ *
+ *
+ * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteServiceLevelObjective(String name) {
+ DeleteServiceLevelObjectiveRequest request =
+ DeleteServiceLevelObjectiveRequest.newBuilder().setName(name).build();
+ deleteServiceLevelObjective(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Delete the given `ServiceLevelObjective`.
+ *
+ *
Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * serviceMonitoringServiceClient.deleteServiceLevelObjective(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) {
+ deleteServiceLevelObjectiveCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Delete the given `ServiceLevelObjective`.
+ *
+ * Sample code:
+ *
+ *
+ * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
+ deleteServiceLevelObjectiveCallable() {
+ return stub.deleteServiceLevelObjectiveCallable();
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Create a `Service`.
@@ -184,7 +367,7 @@ public ServiceMonitoringServiceStub getStub() {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* Service service = Service.newBuilder().build();
* Service response = serviceMonitoringServiceClient.createService(parent, service);
* }
@@ -195,7 +378,7 @@ public ServiceMonitoringServiceStub getStub() {
* @param service Required. The `Service` to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Service createService(ProjectName parent, Service service) {
+ public final Service createService(ResourceName parent, Service service) {
CreateServiceRequest request =
CreateServiceRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -212,7 +395,7 @@ public final Service createService(ProjectName parent, Service service) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* Service service = Service.newBuilder().build();
* Service response = serviceMonitoringServiceClient.createService(parent.toString(), service);
* }
@@ -237,7 +420,7 @@ public final Service createService(String parent, Service service) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* Service service = Service.newBuilder().build();
* CreateServiceRequest request = CreateServiceRequest.newBuilder()
* .setParent(parent.toString())
@@ -262,7 +445,7 @@ public final Service createService(CreateServiceRequest request) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* Service service = Service.newBuilder().build();
* CreateServiceRequest request = CreateServiceRequest.newBuilder()
* .setParent(parent.toString())
@@ -286,7 +469,7 @@ public final UnaryCallable createServiceCallable(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* Service response = serviceMonitoringServiceClient.getService(name);
* }
*
@@ -309,7 +492,7 @@ public final Service getService(ServiceName name) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* Service response = serviceMonitoringServiceClient.getService(name.toString());
* }
*
@@ -331,7 +514,7 @@ public final Service getService(String name) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* GetServiceRequest request = GetServiceRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -354,7 +537,7 @@ public final Service getService(GetServiceRequest request) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName name = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* GetServiceRequest request = GetServiceRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -376,7 +559,7 @@ public final UnaryCallable getServiceCallable() {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* for (Service element : serviceMonitoringServiceClient.listServices(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -388,7 +571,7 @@ public final UnaryCallable getServiceCallable() {
* projects/[PROJECT_ID_OR_NUMBER] workspaces/[HOST_PROJECT_ID_OR_NUMBER]
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final ListServicesPagedResponse listServices(ProjectName parent) {
+ public final ListServicesPagedResponse listServices(ResourceName parent) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
@@ -404,7 +587,7 @@ public final ListServicesPagedResponse listServices(ProjectName parent) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* for (Service element : serviceMonitoringServiceClient.listServices(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -429,7 +612,7 @@ public final ListServicesPagedResponse listServices(String parent) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* ListServicesRequest request = ListServicesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -454,7 +637,7 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request)
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* ListServicesRequest request = ListServicesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -479,7 +662,7 @@ public final ListServicesPagedResponse listServices(ListServicesRequest request)
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* ListServicesRequest request = ListServicesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -569,96 +752,6 @@ public final UnaryCallable updateServiceCallable(
return stub.updateServiceCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Soft delete this `Service`.
- *
- * Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
- * serviceMonitoringServiceClient.deleteService(name);
- * }
- *
- *
- * @param name Required. Resource name of the `Service` to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteService(ServiceName name) {
- DeleteServiceRequest request =
- DeleteServiceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
- deleteService(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Soft delete this `Service`.
- *
- *
Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
- * serviceMonitoringServiceClient.deleteService(name.toString());
- * }
- *
- *
- * @param name Required. Resource name of the `Service` to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteService(String name) {
- DeleteServiceRequest request = DeleteServiceRequest.newBuilder().setName(name).build();
- deleteService(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Soft delete this `Service`.
- *
- *
Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
- * DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * serviceMonitoringServiceClient.deleteService(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteService(DeleteServiceRequest request) {
- deleteServiceCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Soft delete this `Service`.
- *
- * Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName name = ServiceName.of("[PROJECT]", "[SERVICE]");
- * DeleteServiceRequest request = DeleteServiceRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable deleteServiceCallable() {
- return stub.deleteServiceCallable();
- }
-
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Create a `ServiceLevelObjective` for the given `Service`.
@@ -667,7 +760,7 @@ public final UnaryCallable deleteServiceCallable()
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
* ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(parent, serviceLevelObjective);
* }
@@ -697,7 +790,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
* ServiceLevelObjective response = serviceMonitoringServiceClient.createServiceLevelObjective(parent.toString(), serviceLevelObjective);
* }
@@ -727,7 +820,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
* CreateServiceLevelObjectiveRequest request = CreateServiceLevelObjectiveRequest.newBuilder()
* .setParent(parent.toString())
@@ -753,7 +846,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ServiceLevelObjective serviceLevelObjective = ServiceLevelObjective.newBuilder().build();
* CreateServiceLevelObjectiveRequest request = CreateServiceLevelObjectiveRequest.newBuilder()
* .setParent(parent.toString())
@@ -778,7 +871,7 @@ public final ServiceLevelObjective createServiceLevelObjective(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
* ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(name);
* }
*
@@ -803,7 +896,7 @@ public final ServiceLevelObjective getServiceLevelObjective(ServiceLevelObjectiv
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
* ServiceLevelObjective response = serviceMonitoringServiceClient.getServiceLevelObjective(name.toString());
* }
*
@@ -826,7 +919,7 @@ public final ServiceLevelObjective getServiceLevelObjective(String name) {
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
* GetServiceLevelObjectiveRequest request = GetServiceLevelObjectiveRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -850,7 +943,7 @@ public final ServiceLevelObjective getServiceLevelObjective(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
+ * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.ofProjectServiceServiceLevelObjectiveName("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
* GetServiceLevelObjectiveRequest request = GetServiceLevelObjectiveRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -873,7 +966,7 @@ public final ServiceLevelObjective getServiceLevelObjective(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(parent).iterateAll()) {
* // doThingsWith(element);
* }
@@ -903,7 +996,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* for (ServiceLevelObjective element : serviceMonitoringServiceClient.listServiceLevelObjectives(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
@@ -930,7 +1023,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -956,7 +1049,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -982,7 +1075,7 @@ public final ListServiceLevelObjectivesPagedResponse listServiceLevelObjectives(
*
*
* try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceName parent = ServiceName.of("[PROJECT]", "[SERVICE]");
+ * ServiceName parent = ServiceName.ofProjectServiceName("[PROJECT]", "[SERVICE]");
* ListServiceLevelObjectivesRequest request = ListServiceLevelObjectivesRequest.newBuilder()
* .setParent(parent.toString())
* .build();
@@ -1079,100 +1172,6 @@ public final ServiceLevelObjective updateServiceLevelObjective(
return stub.updateServiceLevelObjectiveCallable();
}
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Delete the given `ServiceLevelObjective`.
- *
- * Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
- * serviceMonitoringServiceClient.deleteServiceLevelObjective(name);
- * }
- *
- *
- * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteServiceLevelObjective(ServiceLevelObjectiveName name) {
- DeleteServiceLevelObjectiveRequest request =
- DeleteServiceLevelObjectiveRequest.newBuilder()
- .setName(name == null ? null : name.toString())
- .build();
- deleteServiceLevelObjective(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Delete the given `ServiceLevelObjective`.
- *
- *
Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
- * serviceMonitoringServiceClient.deleteServiceLevelObjective(name.toString());
- * }
- *
- *
- * @param name Required. Resource name of the `ServiceLevelObjective` to delete. The format is:
- * projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteServiceLevelObjective(String name) {
- DeleteServiceLevelObjectiveRequest request =
- DeleteServiceLevelObjectiveRequest.newBuilder().setName(name).build();
- deleteServiceLevelObjective(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Delete the given `ServiceLevelObjective`.
- *
- *
Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
- * DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * serviceMonitoringServiceClient.deleteServiceLevelObjective(request);
- * }
- *
- *
- * @param request The request object containing all of the parameters for the API call.
- * @throws com.google.api.gax.rpc.ApiException if the remote call fails
- */
- public final void deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) {
- deleteServiceLevelObjectiveCallable().call(request);
- }
-
- // AUTO-GENERATED DOCUMENTATION AND METHOD
- /**
- * Delete the given `ServiceLevelObjective`.
- *
- * Sample code:
- *
- *
- * try (ServiceMonitoringServiceClient serviceMonitoringServiceClient = ServiceMonitoringServiceClient.create()) {
- * ServiceLevelObjectiveName name = ServiceLevelObjectiveName.of("[PROJECT]", "[SERVICE]", "[SERVICE_LEVEL_OBJECTIVE]");
- * DeleteServiceLevelObjectiveRequest request = DeleteServiceLevelObjectiveRequest.newBuilder()
- * .setName(name.toString())
- * .build();
- * ApiFuture<Void> future = serviceMonitoringServiceClient.deleteServiceLevelObjectiveCallable().futureCall(request);
- * // Do something
- * future.get();
- * }
- *
- */
- public final UnaryCallable
- deleteServiceLevelObjectiveCallable() {
- return stub.deleteServiceLevelObjectiveCallable();
- }
-
@Override
public final void close() {
stub.close();
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java
index 1d7f696d..91cdfb87 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/ServiceMonitoringServiceSettings.java
@@ -64,16 +64,16 @@
* The builder of this class is recursive, so contained classes are themselves builders. When
* build() is called, the tree of builders is called to create the complete settings object.
*
- *
For example, to set the total timeout of createService to 30 seconds:
+ *
For example, to set the total timeout of deleteService to 30 seconds:
*
*
*
* ServiceMonitoringServiceSettings.Builder serviceMonitoringServiceSettingsBuilder =
* ServiceMonitoringServiceSettings.newBuilder();
* serviceMonitoringServiceSettingsBuilder
- * .createServiceSettings()
+ * .deleteServiceSettings()
* .setRetrySettings(
- * serviceMonitoringServiceSettingsBuilder.createServiceSettings().getRetrySettings().toBuilder()
+ * serviceMonitoringServiceSettingsBuilder.deleteServiceSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ServiceMonitoringServiceSettings serviceMonitoringServiceSettings = serviceMonitoringServiceSettingsBuilder.build();
@@ -83,6 +83,18 @@
@Generated("by gapic-generator")
public class ServiceMonitoringServiceSettings
extends ClientSettings {
+ /** Returns the object with the settings used for calls to deleteService. */
+ public UnaryCallSettings deleteServiceSettings() {
+ return ((ServiceMonitoringServiceStubSettings) getStubSettings()).deleteServiceSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */
+ public UnaryCallSettings
+ deleteServiceLevelObjectiveSettings() {
+ return ((ServiceMonitoringServiceStubSettings) getStubSettings())
+ .deleteServiceLevelObjectiveSettings();
+ }
+
/** Returns the object with the settings used for calls to createService. */
public UnaryCallSettings createServiceSettings() {
return ((ServiceMonitoringServiceStubSettings) getStubSettings()).createServiceSettings();
@@ -104,11 +116,6 @@ public UnaryCallSettings updateServiceSettings()
return ((ServiceMonitoringServiceStubSettings) getStubSettings()).updateServiceSettings();
}
- /** Returns the object with the settings used for calls to deleteService. */
- public UnaryCallSettings deleteServiceSettings() {
- return ((ServiceMonitoringServiceStubSettings) getStubSettings()).deleteServiceSettings();
- }
-
/** Returns the object with the settings used for calls to createServiceLevelObjective. */
public UnaryCallSettings
createServiceLevelObjectiveSettings() {
@@ -140,13 +147,6 @@ public UnaryCallSettings deleteServiceSettings() {
.updateServiceLevelObjectiveSettings();
}
- /** Returns the object with the settings used for calls to deleteServiceLevelObjective. */
- public UnaryCallSettings
- deleteServiceLevelObjectiveSettings() {
- return ((ServiceMonitoringServiceStubSettings) getStubSettings())
- .deleteServiceLevelObjectiveSettings();
- }
-
public static final ServiceMonitoringServiceSettings create(
ServiceMonitoringServiceStubSettings stub) throws IOException {
return new ServiceMonitoringServiceSettings.Builder(stub.toBuilder()).build();
@@ -245,6 +245,17 @@ public Builder applyToAllUnaryMethods(
return this;
}
+ /** Returns the builder for the settings used for calls to deleteService. */
+ public UnaryCallSettings.Builder deleteServiceSettings() {
+ return getStubSettingsBuilder().deleteServiceSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */
+ public UnaryCallSettings.Builder
+ deleteServiceLevelObjectiveSettings() {
+ return getStubSettingsBuilder().deleteServiceLevelObjectiveSettings();
+ }
+
/** Returns the builder for the settings used for calls to createService. */
public UnaryCallSettings.Builder createServiceSettings() {
return getStubSettingsBuilder().createServiceSettings();
@@ -267,11 +278,6 @@ public UnaryCallSettings.Builder updateServiceSet
return getStubSettingsBuilder().updateServiceSettings();
}
- /** Returns the builder for the settings used for calls to deleteService. */
- public UnaryCallSettings.Builder deleteServiceSettings() {
- return getStubSettingsBuilder().deleteServiceSettings();
- }
-
/** Returns the builder for the settings used for calls to createServiceLevelObjective. */
public UnaryCallSettings.Builder
createServiceLevelObjectiveSettings() {
@@ -299,12 +305,6 @@ public UnaryCallSettings.Builder deleteServiceSetti
return getStubSettingsBuilder().updateServiceLevelObjectiveSettings();
}
- /** Returns the builder for the settings used for calls to deleteServiceLevelObjective. */
- public UnaryCallSettings.Builder
- deleteServiceLevelObjectiveSettings() {
- return getStubSettingsBuilder().deleteServiceLevelObjectiveSettings();
- }
-
@Override
public ServiceMonitoringServiceSettings build() throws IOException {
return new ServiceMonitoringServiceSettings(this);
diff --git a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java
index 8bdf8ee1..6a187978 100644
--- a/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java
+++ b/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java
@@ -25,6 +25,7 @@
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
+import com.google.api.resourcenames.ResourceName;
import com.google.cloud.monitoring.v3.stub.UptimeCheckServiceStub;
import com.google.cloud.monitoring.v3.stub.UptimeCheckServiceStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
@@ -60,8 +61,8 @@
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
- * UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
* }
*
*
@@ -170,6 +171,137 @@ public UptimeCheckServiceStub getStub() {
return stub;
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check
+ * configuration is referenced by an alert policy or other dependent configs that would be
+ * rendered invalid by the deletion.
+ *
+ * Sample code:
+ *
+ *
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
+ * }
+ *
+ *
+ * @param name Required. The Uptime check configuration to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteUptimeCheckConfig(UptimeCheckConfigName name) {
+ DeleteUptimeCheckConfigRequest request =
+ DeleteUptimeCheckConfigRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteUptimeCheckConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check
+ * configuration is referenced by an alert policy or other dependent configs that would be
+ * rendered invalid by the deletion.
+ *
+ *
Sample code:
+ *
+ *
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * uptimeCheckServiceClient.deleteUptimeCheckConfig(name.toString());
+ * }
+ *
+ *
+ * @param name Required. The Uptime check configuration to delete. The format is:
+ * projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteUptimeCheckConfig(String name) {
+ DeleteUptimeCheckConfigRequest request =
+ DeleteUptimeCheckConfigRequest.newBuilder().setName(name).build();
+ deleteUptimeCheckConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check
+ * configuration is referenced by an alert policy or other dependent configs that would be
+ * rendered invalid by the deletion.
+ *
+ *
Sample code:
+ *
+ *
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * uptimeCheckServiceClient.deleteUptimeCheckConfig(request);
+ * }
+ *
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request) {
+ deleteUptimeCheckConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes an Uptime check configuration. Note that this method will fail if the Uptime check
+ * configuration is referenced by an alert policy or other dependent configs that would be
+ * rendered invalid by the deletion.
+ *
+ * Sample code:
+ *
+ *
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
+ * .setName(name.toString())
+ * .build();
+ * ApiFuture<Void> future = uptimeCheckServiceClient.deleteUptimeCheckConfigCallable().futureCall(request);
+ * // Do something
+ * future.get();
+ * }
+ *
+ */
+ public final UnaryCallable
+ deleteUptimeCheckConfigCallable() {
+ return stub.deleteUptimeCheckConfigCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists the existing valid Uptime check configurations for the project (leaving out any invalid
+ * configurations).
+ *
+ * Sample code:
+ *
+ *
+ * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+ * ResourceName parent = ProjectName.of("[PROJECT]");
+ * for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param parent Required. The project whose Uptime check configurations are listed. The format
+ * is:
+ * projects/[PROJECT_ID_OR_NUMBER]
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(ResourceName parent) {
+ ListUptimeCheckConfigsRequest request =
+ ListUptimeCheckConfigsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listUptimeCheckConfigs(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists the existing valid Uptime check configurations for the project (leaving out any invalid
@@ -179,8 +311,8 @@ public UptimeCheckServiceStub getStub() {
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * String formattedParent = ProjectName.format("[PROJECT]");
- * for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(formattedParent).iterateAll()) {
+ * ResourceName parent = ProjectName.of("[PROJECT]");
+ * for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
@@ -206,9 +338,9 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(String p
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * String formattedParent = ProjectName.format("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* ListUptimeCheckConfigsRequest request = ListUptimeCheckConfigsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* for (UptimeCheckConfig element : uptimeCheckServiceClient.listUptimeCheckConfigs(request).iterateAll()) {
* // doThingsWith(element);
@@ -233,9 +365,9 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * String formattedParent = ProjectName.format("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* ListUptimeCheckConfigsRequest request = ListUptimeCheckConfigsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* ApiFuture<ListUptimeCheckConfigsPagedResponse> future = uptimeCheckServiceClient.listUptimeCheckConfigsPagedCallable().futureCall(request);
* // Do something
@@ -259,9 +391,9 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * String formattedParent = ProjectName.format("[PROJECT]");
+ * ResourceName parent = ProjectName.of("[PROJECT]");
* ListUptimeCheckConfigsRequest request = ListUptimeCheckConfigsRequest.newBuilder()
- * .setParent(formattedParent)
+ * .setParent(parent.toString())
* .build();
* while (true) {
* ListUptimeCheckConfigsResponse response = uptimeCheckServiceClient.listUptimeCheckConfigsCallable().call(request);
@@ -291,7 +423,7 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs(
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
* }
*
@@ -316,7 +448,7 @@ public final UptimeCheckConfig getUptimeCheckConfig(UptimeCheckConfigName name)
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name.toString());
* }
*
@@ -339,7 +471,7 @@ public final UptimeCheckConfig getUptimeCheckConfig(String name) {
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -362,7 +494,7 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest
*
*
* try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- * UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ * UptimeCheckConfigName name = UptimeCheckConfigName.ofProjectUptimeCheckConfigName("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
* GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
* .setName(name.toString())
* .build();
@@ -385,9 +517,38 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest
*
*