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

Commit

Permalink
fix: migrate to grpc_service_config (#202)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yoshi-automation committed Jun 26, 2020
1 parent 7eb7f20 commit 82786bd
Show file tree
Hide file tree
Showing 34 changed files with 3,110 additions and 2,388 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>7.0.0</version>
<version>8.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Expand Up @@ -60,7 +60,7 @@
* <code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* alertPolicyServiceClient.deleteAlertPolicy(name);
* AlertPolicy response = alertPolicyServiceClient.getAlertPolicy(name);
* }
* </code>
* </pre>
Expand Down Expand Up @@ -169,100 +169,6 @@ public AlertPolicyServiceStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an alerting policy.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* alertPolicyServiceClient.deleteAlertPolicy(name);
* }
* </code></pre>
*
* @param name Required. The alerting policy to delete. The format is:
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
* <p>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.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* alertPolicyServiceClient.deleteAlertPolicy(name.toString());
* }
* </code></pre>
*
* @param name Required. The alerting policy to delete. The format is:
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
* <p>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.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
* alertPolicyServiceClient.deleteAlertPolicy(request);
* }
* </code></pre>
*
* @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.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteAlertPolicyRequest, Empty> deleteAlertPolicyCallable() {
return stub.deleteAlertPolicyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists the existing alerting policies for the project.
Expand Down Expand Up @@ -608,6 +514,100 @@ public final UnaryCallable<CreateAlertPolicyRequest, AlertPolicy> createAlertPol
return stub.createAlertPolicyCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an alerting policy.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* alertPolicyServiceClient.deleteAlertPolicy(name);
* }
* </code></pre>
*
* @param name Required. The alerting policy to delete. The format is:
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
* <p>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.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* alertPolicyServiceClient.deleteAlertPolicy(name.toString());
* }
* </code></pre>
*
* @param name Required. The alerting policy to delete. The format is:
* <p>projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]
* <p>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.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
* alertPolicyServiceClient.deleteAlertPolicy(request);
* }
* </code></pre>
*
* @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.
*
* <p>Sample code:
*
* <pre><code>
* try (AlertPolicyServiceClient alertPolicyServiceClient = AlertPolicyServiceClient.create()) {
* AlertPolicyName name = AlertPolicyName.ofProjectAlertPolicyName("[PROJECT]", "[ALERT_POLICY]");
* DeleteAlertPolicyRequest request = DeleteAlertPolicyRequest.newBuilder()
* .setName(name.toString())
* .build();
* ApiFuture&lt;Void&gt; future = alertPolicyServiceClient.deleteAlertPolicyCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteAlertPolicyRequest, Empty> 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
Expand Down
Expand Up @@ -56,16 +56,16 @@
* <p>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.
*
* <p>For example, to set the total timeout of deleteAlertPolicy to 30 seconds:
* <p>For example, to set the total timeout of getAlertPolicy to 30 seconds:
*
* <pre>
* <code>
* AlertPolicyServiceSettings.Builder alertPolicyServiceSettingsBuilder =
* AlertPolicyServiceSettings.newBuilder();
* alertPolicyServiceSettingsBuilder
* .deleteAlertPolicySettings()
* .getAlertPolicySettings()
* .setRetrySettings(
* alertPolicyServiceSettingsBuilder.deleteAlertPolicySettings().getRetrySettings().toBuilder()
* alertPolicyServiceSettingsBuilder.getAlertPolicySettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* AlertPolicyServiceSettings alertPolicyServiceSettings = alertPolicyServiceSettingsBuilder.build();
Expand All @@ -74,11 +74,6 @@
*/
@Generated("by gapic-generator")
public class AlertPolicyServiceSettings extends ClientSettings<AlertPolicyServiceSettings> {
/** Returns the object with the settings used for calls to deleteAlertPolicy. */
public UnaryCallSettings<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
}

/** Returns the object with the settings used for calls to listAlertPolicies. */
public PagedCallSettings<
ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
Expand All @@ -96,6 +91,11 @@ public UnaryCallSettings<CreateAlertPolicyRequest, AlertPolicy> createAlertPolic
return ((AlertPolicyServiceStubSettings) getStubSettings()).createAlertPolicySettings();
}

/** Returns the object with the settings used for calls to deleteAlertPolicy. */
public UnaryCallSettings<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
return ((AlertPolicyServiceStubSettings) getStubSettings()).deleteAlertPolicySettings();
}

/** Returns the object with the settings used for calls to updateAlertPolicy. */
public UnaryCallSettings<UpdateAlertPolicyRequest, AlertPolicy> updateAlertPolicySettings() {
return ((AlertPolicyServiceStubSettings) getStubSettings()).updateAlertPolicySettings();
Expand Down Expand Up @@ -198,11 +198,6 @@ public Builder applyToAllUnaryMethods(
return this;
}

/** Returns the builder for the settings used for calls to deleteAlertPolicy. */
public UnaryCallSettings.Builder<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
return getStubSettingsBuilder().deleteAlertPolicySettings();
}

/** Returns the builder for the settings used for calls to listAlertPolicies. */
public PagedCallSettings.Builder<
ListAlertPoliciesRequest, ListAlertPoliciesResponse, ListAlertPoliciesPagedResponse>
Expand All @@ -221,6 +216,11 @@ public UnaryCallSettings.Builder<GetAlertPolicyRequest, AlertPolicy> getAlertPol
return getStubSettingsBuilder().createAlertPolicySettings();
}

/** Returns the builder for the settings used for calls to deleteAlertPolicy. */
public UnaryCallSettings.Builder<DeleteAlertPolicyRequest, Empty> deleteAlertPolicySettings() {
return getStubSettingsBuilder().deleteAlertPolicySettings();
}

/** Returns the builder for the settings used for calls to updateAlertPolicy. */
public UnaryCallSettings.Builder<UpdateAlertPolicyRequest, AlertPolicy>
updateAlertPolicySettings() {
Expand Down

0 comments on commit 82786bd

Please sign in to comment.