Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit 82786bd

Browse files
fix: migrate to grpc_service_config (#202)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/9a39005f-0276-4a7f-98a1-26d6e52f1281/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 318542700 Source-Link: googleapis/googleapis@7c577e8
1 parent 7eb7f20 commit 82786bd

34 files changed

+3110
-2388
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
1717
<dependency>
1818
<groupId>com.google.cloud</groupId>
1919
<artifactId>libraries-bom</artifactId>
20-
<version>7.0.0</version>
20+
<version>8.0.0</version>
2121
<type>pom</type>
2222
<scope>import</scope>
2323
</dependency>

google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceClient.java

+95-95
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* <code>
6161
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
6262
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
63-
* alertPolicyServiceClient.deleteAlertPolicy(name);
63+
* AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
6464
* }
6565
* </code>
6666
* </pre>
@@ -169,100 +169,6 @@ public AlertPolicyServiceStub getStub() {
169169
return stub;
170170
}
171171

172-
// AUTO-GENERATED DOCUMENTATION AND METHOD
173-
/**
174-
* Deletes an alerting policy.
175-
*
176-
* <p>Sample code:
177-
*
178-
* <pre><code>
179-
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
180-
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
181-
* alertPolicyServiceClient.deleteAlertPolicy(name);
182-
* }
183-
* </code></pre>
184-
*
185-
* @param name Required. The alerting policy to delete. The format is:
186-
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
187-
* <p>For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
188-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
189-
*/
190-
public final void deleteAlertPolicy(AlertPolicyName name) {
191-
DeleteAlertPolicyRequest request =
192-
DeleteAlertPolicyRequest.newBuilder()
193-
.setName(name == null ? null : name.toString())
194-
.build();
195-
deleteAlertPolicy(request);
196-
}
197-
198-
// AUTO-GENERATED DOCUMENTATION AND METHOD
199-
/**
200-
* Deletes an alerting policy.
201-
*
202-
* <p>Sample code:
203-
*
204-
* <pre><code>
205-
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
206-
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
207-
* alertPolicyServiceClient.deleteAlertPolicy(name.toString());
208-
* }
209-
* </code></pre>
210-
*
211-
* @param name Required. The alerting policy to delete. The format is:
212-
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
213-
* <p>For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
214-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
215-
*/
216-
public final void deleteAlertPolicy(String name) {
217-
DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder().setName(name).build();
218-
deleteAlertPolicy(request);
219-
}
220-
221-
// AUTO-GENERATED DOCUMENTATION AND METHOD
222-
/**
223-
* Deletes an alerting policy.
224-
*
225-
* <p>Sample code:
226-
*
227-
* <pre><code>
228-
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
229-
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
230-
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
231-
* .setName(name.toString())
232-
* .build();
233-
* alertPolicyServiceClient.deleteAlertPolicy(request);
234-
* }
235-
* </code></pre>
236-
*
237-
* @param request The request object containing all of the parameters for the API call.
238-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
239-
*/
240-
public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) {
241-
deleteAlertPolicyCallable().call(request);
242-
}
243-
244-
// AUTO-GENERATED DOCUMENTATION AND METHOD
245-
/**
246-
* Deletes an alerting policy.
247-
*
248-
* <p>Sample code:
249-
*
250-
* <pre><code>
251-
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
252-
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
253-
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
254-
* .setName(name.toString())
255-
* .build();
256-
* ApiFuture&lt;Void&gt; future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
257-
* // Do something
258-
* future.get();
259-
* }
260-
* </code></pre>
261-
*/
262-
public final UnaryCallable<DeleteAlertPolicyRequest, Empty> deleteAlertPolicyCallable() {
263-
return stub.deleteAlertPolicyCallable();
264-
}
265-
266172
// AUTO-GENERATED DOCUMENTATION AND METHOD
267173
/**
268174
* Lists the existing alerting policies for the project.
@@ -608,6 +514,100 @@ public final UnaryCallable<CreateAlertPolicyRequest, AlertPolicy> createAlertPol
608514
return stub.createAlertPolicyCallable();
609515
}
610516

517+
// AUTO-GENERATED DOCUMENTATION AND METHOD
518+
/**
519+
* Deletes an alerting policy.
520+
*
521+
* <p>Sample code:
522+
*
523+
* <pre><code>
524+
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
525+
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
526+
* alertPolicyServiceClient.deleteAlertPolicy(name);
527+
* }
528+
* </code></pre>
529+
*
530+
* @param name Required. The alerting policy to delete. The format is:
531+
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
532+
* <p>For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
533+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
534+
*/
535+
public final void deleteAlertPolicy(AlertPolicyName name) {
536+
DeleteAlertPolicyRequest request =
537+
DeleteAlertPolicyRequest.newBuilder()
538+
.setName(name == null ? null : name.toString())
539+
.build();
540+
deleteAlertPolicy(request);
541+
}
542+
543+
// AUTO-GENERATED DOCUMENTATION AND METHOD
544+
/**
545+
* Deletes an alerting policy.
546+
*
547+
* <p>Sample code:
548+
*
549+
* <pre><code>
550+
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
551+
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
552+
* alertPolicyServiceClient.deleteAlertPolicy(name.toString());
553+
* }
554+
* </code></pre>
555+
*
556+
* @param name Required. The alerting policy to delete. The format is:
557+
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
558+
* <p>For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
559+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
560+
*/
561+
public final void deleteAlertPolicy(String name) {
562+
DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder().setName(name).build();
563+
deleteAlertPolicy(request);
564+
}
565+
566+
// AUTO-GENERATED DOCUMENTATION AND METHOD
567+
/**
568+
* Deletes an alerting policy.
569+
*
570+
* <p>Sample code:
571+
*
572+
* <pre><code>
573+
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
574+
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
575+
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
576+
* .setName(name.toString())
577+
* .build();
578+
* alertPolicyServiceClient.deleteAlertPolicy(request);
579+
* }
580+
* </code></pre>
581+
*
582+
* @param request The request object containing all of the parameters for the API call.
583+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
584+
*/
585+
public final void deleteAlertPolicy(DeleteAlertPolicyRequest request) {
586+
deleteAlertPolicyCallable().call(request);
587+
}
588+
589+
// AUTO-GENERATED DOCUMENTATION AND METHOD
590+
/**
591+
* Deletes an alerting policy.
592+
*
593+
* <p>Sample code:
594+
*
595+
* <pre><code>
596+
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
597+
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
598+
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
599+
* .setName(name.toString())
600+
* .build();
601+
* ApiFuture&lt;Void&gt; future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
602+
* // Do something
603+
* future.get();
604+
* }
605+
* </code></pre>
606+
*/
607+
public final UnaryCallable<DeleteAlertPolicyRequest, Empty> deleteAlertPolicyCallable() {
608+
return stub.deleteAlertPolicyCallable();
609+
}
610+
611611
// AUTO-GENERATED DOCUMENTATION AND METHOD
612612
/**
613613
* Updates an alerting policy. You can either replace the entire policy with a new one or replace

google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/AlertPolicyServiceSettings.java

+13-13
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@
5656
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
5757
* build() is called, the tree of builders is called to create the complete settings object.
5858
*
59-
* <p>For example, to set the total timeout of deleteAlertPolicy to 30 seconds:
59+
* <p>For example, to set the total timeout of getAlertPolicy to 30 seconds:
6060
*
6161
* <pre>
6262
* <code>
6363
* AlertPolicyServiceSettings.Builder alertPolicyServiceSettingsBuilder =
6464
* AlertPolicyServiceSettings.newBuilder();
6565
* alertPolicyServiceSettingsBuilder
66-
* .deleteAlertPolicySettings()
66+
* .getAlertPolicySettings()
6767
* .setRetrySettings(
68-
* alertPolicyServiceSettingsBuilder.deleteAlertPolicySettings().getRetrySettings().toBuilder()
68+
* alertPolicyServiceSettingsBuilder.getAlertPolicySettings().getRetrySettings().toBuilder()
6969
* .setTotalTimeout(Duration.ofSeconds(30))
7070
* .build());
7171
* AlertPolicyServiceSettings alertPolicyServiceSettings = alertPolicyServiceSettingsBuilder.build();
@@ -74,11 +74,6 @@
7474
*/
7575
@Generated("by gapic-generator")
7676
public class AlertPolicyServiceSettings extends ClientSettings<AlertPolicyServiceSettings> {
77-
/** Returns the object with the settings used for calls to deleteAlertPolicy. */
78-
public UnaryCallSettings<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
79-
return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
80-
}
81-
8277
/** Returns the object with the settings used for calls to listAlertPolicies. */
8378
public PagedCallSettings<
8479
ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -96,6 +91,11 @@ public UnaryCallSettings<CreateAlertPolicyRequest, AlertPolicy> createAlertPolic
9691
return ((AlertPolicyServiceStubSettings) getStubSettings()).createAlertPolicySettings();
9792
}
9893

94+
/** Returns the object with the settings used for calls to deleteAlertPolicy. */
95+
public UnaryCallSettings<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
96+
return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
97+
}
98+
9999
/** Returns the object with the settings used for calls to updateAlertPolicy. */
100100
public UnaryCallSettings<UpdateAlertPolicyRequest, AlertPolicy> updateAlertPolicySettings() {
101101
return ((AlertPolicyServiceStubSettings) getStubSettings()).updateAlertPolicySettings();
@@ -198,11 +198,6 @@ public Builder applyToAllUnaryMethods(
198198
return this;
199199
}
200200

201-
/** Returns the builder for the settings used for calls to deleteAlertPolicy. */
202-
public UnaryCallSettings.Builder<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
203-
return getStubSettingsBuilder().deleteAlertPolicySettings();
204-
}
205-
206201
/** Returns the builder for the settings used for calls to listAlertPolicies. */
207202
public PagedCallSettings.Builder<
208203
ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
@@ -221,6 +216,11 @@ public UnaryCallSettings.Builder<GetAlertPolicyRequest, AlertPolicy> getAlertPol
221216
return getStubSettingsBuilder().createAlertPolicySettings();
222217
}
223218

219+
/** Returns the builder for the settings used for calls to deleteAlertPolicy. */
220+
public UnaryCallSettings.Builder<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
221+
return getStubSettingsBuilder().deleteAlertPolicySettings();
222+
}
223+
224224
/** Returns the builder for the settings used for calls to updateAlertPolicy. */
225225
public UnaryCallSettings.Builder<UpdateAlertPolicyRequest, AlertPolicy>
226226
updateAlertPolicySettings() {

0 commit comments

Comments
 (0)