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

Commit 38e43da

Browse files
fix: restore GAPIC v2 retry configs (#19)
Restores GAPIC v2 retry config overrides that were mistakenly removed during migration. PiperOrigin-RevId: 312088359 Source-Author: Google APIs <[email protected]> Source-Date: Mon May 18 08:57:12 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 5a90d467aa65e7f038f87585e8fbb45d74475e7c Source-Link: googleapis/googleapis@5a90d46
1 parent 7bb7a4b commit 38e43da

File tree

8 files changed

+209
-213
lines changed

8 files changed

+209
-213
lines changed

google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java

Lines changed: 92 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@
5454
* <pre>
5555
* <code>
5656
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
57-
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
58-
* Connection connection = Connection.newBuilder().build();
59-
* String connectionId = "";
60-
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
57+
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
58+
* connectionServiceClient.deleteConnection(name);
6159
* }
6260
* </code>
6361
* </pre>
@@ -167,6 +165,96 @@ public ConnectionServiceStub getStub() {
167165
return stub;
168166
}
169167

168+
// AUTO-GENERATED DOCUMENTATION AND METHOD
169+
/**
170+
* Deletes connection and associated credential.
171+
*
172+
* <p>Sample code:
173+
*
174+
* <pre><code>
175+
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
176+
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
177+
* connectionServiceClient.deleteConnection(name);
178+
* }
179+
* </code></pre>
180+
*
181+
* @param name Required. Name of the deleted connection, for example:
182+
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
183+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
184+
*/
185+
public final void deleteConnection(ConnectionName name) {
186+
DeleteConnectionRequest request =
187+
DeleteConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
188+
deleteConnection(request);
189+
}
190+
191+
// AUTO-GENERATED DOCUMENTATION AND METHOD
192+
/**
193+
* Deletes connection and associated credential.
194+
*
195+
* <p>Sample code:
196+
*
197+
* <pre><code>
198+
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
199+
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
200+
* connectionServiceClient.deleteConnection(name.toString());
201+
* }
202+
* </code></pre>
203+
*
204+
* @param name Required. Name of the deleted connection, for example:
205+
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
206+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
207+
*/
208+
public final void deleteConnection(String name) {
209+
DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder().setName(name).build();
210+
deleteConnection(request);
211+
}
212+
213+
// AUTO-GENERATED DOCUMENTATION AND METHOD
214+
/**
215+
* Deletes connection and associated credential.
216+
*
217+
* <p>Sample code:
218+
*
219+
* <pre><code>
220+
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
221+
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
222+
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
223+
* .setName(name.toString())
224+
* .build();
225+
* connectionServiceClient.deleteConnection(request);
226+
* }
227+
* </code></pre>
228+
*
229+
* @param request The request object containing all of the parameters for the API call.
230+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
231+
*/
232+
public final void deleteConnection(DeleteConnectionRequest request) {
233+
deleteConnectionCallable().call(request);
234+
}
235+
236+
// AUTO-GENERATED DOCUMENTATION AND METHOD
237+
/**
238+
* Deletes connection and associated credential.
239+
*
240+
* <p>Sample code:
241+
*
242+
* <pre><code>
243+
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
244+
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
245+
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
246+
* .setName(name.toString())
247+
* .build();
248+
* ApiFuture&lt;Void&gt; future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
249+
* // Do something
250+
* future.get();
251+
* }
252+
* </code></pre>
253+
*/
254+
public final UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
255+
return stub.deleteConnectionCallable();
256+
}
257+
170258
// AUTO-GENERATED DOCUMENTATION AND METHOD
171259
/**
172260
* Creates a new connection.
@@ -673,96 +761,6 @@ public final void updateConnectionCredential(UpdateConnectionCredentialRequest r
673761
return stub.updateConnectionCredentialCallable();
674762
}
675763

676-
// AUTO-GENERATED DOCUMENTATION AND METHOD
677-
/**
678-
* Deletes connection and associated credential.
679-
*
680-
* <p>Sample code:
681-
*
682-
* <pre><code>
683-
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
684-
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
685-
* connectionServiceClient.deleteConnection(name);
686-
* }
687-
* </code></pre>
688-
*
689-
* @param name Required. Name of the deleted connection, for example:
690-
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
691-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
692-
*/
693-
public final void deleteConnection(ConnectionName name) {
694-
DeleteConnectionRequest request =
695-
DeleteConnectionRequest.newBuilder().setName(name == null ? null : name.toString()).build();
696-
deleteConnection(request);
697-
}
698-
699-
// AUTO-GENERATED DOCUMENTATION AND METHOD
700-
/**
701-
* Deletes connection and associated credential.
702-
*
703-
* <p>Sample code:
704-
*
705-
* <pre><code>
706-
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
707-
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
708-
* connectionServiceClient.deleteConnection(name.toString());
709-
* }
710-
* </code></pre>
711-
*
712-
* @param name Required. Name of the deleted connection, for example:
713-
* `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
714-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
715-
*/
716-
public final void deleteConnection(String name) {
717-
DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder().setName(name).build();
718-
deleteConnection(request);
719-
}
720-
721-
// AUTO-GENERATED DOCUMENTATION AND METHOD
722-
/**
723-
* Deletes connection and associated credential.
724-
*
725-
* <p>Sample code:
726-
*
727-
* <pre><code>
728-
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
729-
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
730-
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
731-
* .setName(name.toString())
732-
* .build();
733-
* connectionServiceClient.deleteConnection(request);
734-
* }
735-
* </code></pre>
736-
*
737-
* @param request The request object containing all of the parameters for the API call.
738-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
739-
*/
740-
public final void deleteConnection(DeleteConnectionRequest request) {
741-
deleteConnectionCallable().call(request);
742-
}
743-
744-
// AUTO-GENERATED DOCUMENTATION AND METHOD
745-
/**
746-
* Deletes connection and associated credential.
747-
*
748-
* <p>Sample code:
749-
*
750-
* <pre><code>
751-
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
752-
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
753-
* DeleteConnectionRequest request = DeleteConnectionRequest.newBuilder()
754-
* .setName(name.toString())
755-
* .build();
756-
* ApiFuture&lt;Void&gt; future = connectionServiceClient.deleteConnectionCallable().futureCall(request);
757-
* // Do something
758-
* future.get();
759-
* }
760-
* </code></pre>
761-
*/
762-
public final UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
763-
return stub.deleteConnectionCallable();
764-
}
765-
766764
// AUTO-GENERATED DOCUMENTATION AND METHOD
767765
/**
768766
* Gets the access control policy for a resource. Returns an empty policy if the resource exists

google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@
6060
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
6161
* build() is called, the tree of builders is called to create the complete settings object.
6262
*
63-
* <p>For example, to set the total timeout of createConnection to 30 seconds:
63+
* <p>For example, to set the total timeout of deleteConnection to 30 seconds:
6464
*
6565
* <pre>
6666
* <code>
6767
* ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
6868
* ConnectionServiceSettings.newBuilder();
6969
* connectionServiceSettingsBuilder
70-
* .createConnectionSettings()
70+
* .deleteConnectionSettings()
7171
* .setRetrySettings(
72-
* connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
72+
* connectionServiceSettingsBuilder.deleteConnectionSettings().getRetrySettings().toBuilder()
7373
* .setTotalTimeout(Duration.ofSeconds(30))
7474
* .build());
7575
* ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
@@ -79,6 +79,11 @@
7979
@Generated("by gapic-generator")
8080
@BetaApi
8181
public class ConnectionServiceSettings extends ClientSettings<ConnectionServiceSettings> {
82+
/** Returns the object with the settings used for calls to deleteConnection. */
83+
public UnaryCallSettings<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
84+
return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
85+
}
86+
8287
/** Returns the object with the settings used for calls to createConnection. */
8388
public UnaryCallSettings<CreateConnectionRequest, Connection> createConnectionSettings() {
8489
return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings();
@@ -106,11 +111,6 @@ public UnaryCallSettings<UpdateConnectionRequest, Connection> updateConnectionSe
106111
return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionCredentialSettings();
107112
}
108113

109-
/** Returns the object with the settings used for calls to deleteConnection. */
110-
public UnaryCallSettings<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
111-
return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
112-
}
113-
114114
/** Returns the object with the settings used for calls to getIamPolicy. */
115115
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
116116
return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings();
@@ -224,6 +224,11 @@ public Builder applyToAllUnaryMethods(
224224
return this;
225225
}
226226

227+
/** Returns the builder for the settings used for calls to deleteConnection. */
228+
public UnaryCallSettings.Builder<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
229+
return getStubSettingsBuilder().deleteConnectionSettings();
230+
}
231+
227232
/** Returns the builder for the settings used for calls to createConnection. */
228233
public UnaryCallSettings.Builder<CreateConnectionRequest, Connection>
229234
createConnectionSettings() {
@@ -253,11 +258,6 @@ public UnaryCallSettings.Builder<GetConnectionRequest, Connection> getConnection
253258
return getStubSettingsBuilder().updateConnectionCredentialSettings();
254259
}
255260

256-
/** Returns the builder for the settings used for calls to deleteConnection. */
257-
public UnaryCallSettings.Builder<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
258-
return getStubSettingsBuilder().deleteConnectionSettings();
259-
}
260-
261261
/** Returns the builder for the settings used for calls to getIamPolicy. */
262262
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
263263
return getStubSettingsBuilder().getIamPolicySettings();

google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
* <pre>
2929
* <code>
3030
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
31-
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
32-
* Connection connection = Connection.newBuilder().build();
33-
* String connectionId = "";
34-
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
31+
* ConnectionName name = ConnectionName.of("[PROJECT]", "[LOCATION]", "[CONNECTION]");
32+
* connectionServiceClient.deleteConnection(name);
3533
* }
3634
* </code>
3735
* </pre>

google-cloud-bigquery-connection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
4545
public abstract class ConnectionServiceStub implements BackgroundResource {
4646

47+
public UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
48+
throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()");
49+
}
50+
4751
public UnaryCallable<CreateConnectionRequest, Connection> createConnectionCallable() {
4852
throw new UnsupportedOperationException("Not implemented: createConnectionCallable()");
4953
}
@@ -66,10 +70,6 @@ public UnaryCallable<UpdateConnectionRequest, Connection> updateConnectionCallab
6670
"Not implemented: updateConnectionCredentialCallable()");
6771
}
6872

69-
public UnaryCallable<DeleteConnectionRequest, Empty> deleteConnectionCallable() {
70-
throw new UnsupportedOperationException("Not implemented: deleteConnectionCallable()");
71-
}
72-
7373
public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
7474
throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()");
7575
}

0 commit comments

Comments
 (0)