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

Commit b9638be

Browse files
feat: generate v1 client (#28)
* feat: generate v1 client * feat: generate v1 client * feat: generate v1 client
1 parent b8226f8 commit b9638be

File tree

60 files changed

+18239
-13987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+18239
-13987
lines changed

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

Lines changed: 1140 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.cloud.bigqueryconnection.v1;
17+
18+
import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse;
19+
20+
import com.google.api.core.ApiFunction;
21+
import com.google.api.core.BetaApi;
22+
import com.google.api.gax.core.GoogleCredentialsProvider;
23+
import com.google.api.gax.core.InstantiatingExecutorProvider;
24+
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
25+
import com.google.api.gax.rpc.ApiClientHeaderProvider;
26+
import com.google.api.gax.rpc.ClientContext;
27+
import com.google.api.gax.rpc.ClientSettings;
28+
import com.google.api.gax.rpc.PagedCallSettings;
29+
import com.google.api.gax.rpc.TransportChannelProvider;
30+
import com.google.api.gax.rpc.UnaryCallSettings;
31+
import com.google.cloud.bigquery.connection.v1.Connection;
32+
import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest;
33+
import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest;
34+
import com.google.cloud.bigquery.connection.v1.GetConnectionRequest;
35+
import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest;
36+
import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse;
37+
import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest;
38+
import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStubSettings;
39+
import com.google.iam.v1.GetIamPolicyRequest;
40+
import com.google.iam.v1.Policy;
41+
import com.google.iam.v1.SetIamPolicyRequest;
42+
import com.google.iam.v1.TestIamPermissionsRequest;
43+
import com.google.iam.v1.TestIamPermissionsResponse;
44+
import com.google.protobuf.Empty;
45+
import java.io.IOException;
46+
import java.util.List;
47+
import javax.annotation.Generated;
48+
49+
// AUTO-GENERATED DOCUMENTATION AND CLASS
50+
/**
51+
* Settings class to configure an instance of {@link ConnectionServiceClient}.
52+
*
53+
* <p>The default instance has everything set to sensible defaults:
54+
*
55+
* <ul>
56+
* <li>The default service address (bigqueryconnection.googleapis.com) and default port (443) are
57+
* used.
58+
* <li>Credentials are acquired automatically through Application Default Credentials.
59+
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
60+
* </ul>
61+
*
62+
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
63+
* build() is called, the tree of builders is called to create the complete settings object.
64+
*
65+
* <p>For example, to set the total timeout of createConnection to 30 seconds:
66+
*
67+
* <pre>
68+
* <code>
69+
* ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
70+
* ConnectionServiceSettings.newBuilder();
71+
* connectionServiceSettingsBuilder
72+
* .createConnectionSettings()
73+
* .setRetrySettings(
74+
* connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
75+
* .setTotalTimeout(Duration.ofSeconds(30))
76+
* .build());
77+
* ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
78+
* </code>
79+
* </pre>
80+
*/
81+
@Generated("by gapic-generator")
82+
@BetaApi
83+
public class ConnectionServiceSettings extends ClientSettings<ConnectionServiceSettings> {
84+
/** Returns the object with the settings used for calls to createConnection. */
85+
public UnaryCallSettings<CreateConnectionRequest, Connection> createConnectionSettings() {
86+
return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings();
87+
}
88+
89+
/** Returns the object with the settings used for calls to getConnection. */
90+
public UnaryCallSettings<GetConnectionRequest, Connection> getConnectionSettings() {
91+
return ((ConnectionServiceStubSettings) getStubSettings()).getConnectionSettings();
92+
}
93+
94+
/** Returns the object with the settings used for calls to listConnections. */
95+
public PagedCallSettings<
96+
ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>
97+
listConnectionsSettings() {
98+
return ((ConnectionServiceStubSettings) getStubSettings()).listConnectionsSettings();
99+
}
100+
101+
/** Returns the object with the settings used for calls to updateConnection. */
102+
public UnaryCallSettings<UpdateConnectionRequest, Connection> updateConnectionSettings() {
103+
return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionSettings();
104+
}
105+
106+
/** Returns the object with the settings used for calls to deleteConnection. */
107+
public UnaryCallSettings<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
108+
return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
109+
}
110+
111+
/** Returns the object with the settings used for calls to getIamPolicy. */
112+
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
113+
return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings();
114+
}
115+
116+
/** Returns the object with the settings used for calls to setIamPolicy. */
117+
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
118+
return ((ConnectionServiceStubSettings) getStubSettings()).setIamPolicySettings();
119+
}
120+
121+
/** Returns the object with the settings used for calls to testIamPermissions. */
122+
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
123+
testIamPermissionsSettings() {
124+
return ((ConnectionServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
125+
}
126+
127+
public static final ConnectionServiceSettings create(ConnectionServiceStubSettings stub)
128+
throws IOException {
129+
return new ConnectionServiceSettings.Builder(stub.toBuilder()).build();
130+
}
131+
132+
/** Returns a builder for the default ExecutorProvider for this service. */
133+
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
134+
return ConnectionServiceStubSettings.defaultExecutorProviderBuilder();
135+
}
136+
137+
/** Returns the default service endpoint. */
138+
public static String getDefaultEndpoint() {
139+
return ConnectionServiceStubSettings.getDefaultEndpoint();
140+
}
141+
142+
/** Returns the default service scopes. */
143+
public static List<String> getDefaultServiceScopes() {
144+
return ConnectionServiceStubSettings.getDefaultServiceScopes();
145+
}
146+
147+
/** Returns a builder for the default credentials for this service. */
148+
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
149+
return ConnectionServiceStubSettings.defaultCredentialsProviderBuilder();
150+
}
151+
152+
/** Returns a builder for the default ChannelProvider for this service. */
153+
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
154+
return ConnectionServiceStubSettings.defaultGrpcTransportProviderBuilder();
155+
}
156+
157+
public static TransportChannelProvider defaultTransportChannelProvider() {
158+
return ConnectionServiceStubSettings.defaultTransportChannelProvider();
159+
}
160+
161+
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
162+
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
163+
return ConnectionServiceStubSettings.defaultApiClientHeaderProviderBuilder();
164+
}
165+
166+
/** Returns a new builder for this class. */
167+
public static Builder newBuilder() {
168+
return Builder.createDefault();
169+
}
170+
171+
/** Returns a new builder for this class. */
172+
public static Builder newBuilder(ClientContext clientContext) {
173+
return new Builder(clientContext);
174+
}
175+
176+
/** Returns a builder containing all the values of this settings class. */
177+
public Builder toBuilder() {
178+
return new Builder(this);
179+
}
180+
181+
protected ConnectionServiceSettings(Builder settingsBuilder) throws IOException {
182+
super(settingsBuilder);
183+
}
184+
185+
/** Builder for ConnectionServiceSettings. */
186+
public static class Builder extends ClientSettings.Builder<ConnectionServiceSettings, Builder> {
187+
protected Builder() throws IOException {
188+
this((ClientContext) null);
189+
}
190+
191+
protected Builder(ClientContext clientContext) {
192+
super(ConnectionServiceStubSettings.newBuilder(clientContext));
193+
}
194+
195+
private static Builder createDefault() {
196+
return new Builder(ConnectionServiceStubSettings.newBuilder());
197+
}
198+
199+
protected Builder(ConnectionServiceSettings settings) {
200+
super(settings.getStubSettings().toBuilder());
201+
}
202+
203+
protected Builder(ConnectionServiceStubSettings.Builder stubSettings) {
204+
super(stubSettings);
205+
}
206+
207+
public ConnectionServiceStubSettings.Builder getStubSettingsBuilder() {
208+
return ((ConnectionServiceStubSettings.Builder) getStubSettings());
209+
}
210+
211+
// NEXT_MAJOR_VER: remove 'throws Exception'
212+
/**
213+
* Applies the given settings updater function to all of the unary API methods in this service.
214+
*
215+
* <p>Note: This method does not support applying settings to streaming methods.
216+
*/
217+
public Builder applyToAllUnaryMethods(
218+
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
219+
super.applyToAllUnaryMethods(
220+
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
221+
return this;
222+
}
223+
224+
/** Returns the builder for the settings used for calls to createConnection. */
225+
public UnaryCallSettings.Builder<CreateConnectionRequest, Connection>
226+
createConnectionSettings() {
227+
return getStubSettingsBuilder().createConnectionSettings();
228+
}
229+
230+
/** Returns the builder for the settings used for calls to getConnection. */
231+
public UnaryCallSettings.Builder<GetConnectionRequest, Connection> getConnectionSettings() {
232+
return getStubSettingsBuilder().getConnectionSettings();
233+
}
234+
235+
/** Returns the builder for the settings used for calls to listConnections. */
236+
public PagedCallSettings.Builder<
237+
ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>
238+
listConnectionsSettings() {
239+
return getStubSettingsBuilder().listConnectionsSettings();
240+
}
241+
242+
/** Returns the builder for the settings used for calls to updateConnection. */
243+
public UnaryCallSettings.Builder<UpdateConnectionRequest, Connection>
244+
updateConnectionSettings() {
245+
return getStubSettingsBuilder().updateConnectionSettings();
246+
}
247+
248+
/** Returns the builder for the settings used for calls to deleteConnection. */
249+
public UnaryCallSettings.Builder<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
250+
return getStubSettingsBuilder().deleteConnectionSettings();
251+
}
252+
253+
/** Returns the builder for the settings used for calls to getIamPolicy. */
254+
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
255+
return getStubSettingsBuilder().getIamPolicySettings();
256+
}
257+
258+
/** Returns the builder for the settings used for calls to setIamPolicy. */
259+
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
260+
return getStubSettingsBuilder().setIamPolicySettings();
261+
}
262+
263+
/** Returns the builder for the settings used for calls to testIamPermissions. */
264+
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
265+
testIamPermissionsSettings() {
266+
return getStubSettingsBuilder().testIamPermissionsSettings();
267+
}
268+
269+
@Override
270+
public ConnectionServiceSettings build() throws IOException {
271+
return new ConnectionServiceSettings(this);
272+
}
273+
}
274+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2020 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* A client to BigQuery Connection API.
19+
*
20+
* <p>The interfaces provided are listed below, along with usage samples.
21+
*
22+
* <p>======================= ConnectionServiceClient =======================
23+
*
24+
* <p>Service Description: Manages external data source connections and credentials.
25+
*
26+
* <p>Sample for ConnectionServiceClient:
27+
*
28+
* <pre>
29+
* <code>
30+
* 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);
35+
* }
36+
* </code>
37+
* </pre>
38+
*/
39+
@Generated("by gapic-generator")
40+
package com.google.cloud.bigqueryconnection.v1;
41+
42+
import javax.annotation.Generated;

0 commit comments

Comments
 (0)