Skip to content
Permalink
Browse files
feat: generate v1 client (#28)
* feat: generate v1 client

* feat: generate v1 client

* feat: generate v1 client
  • Loading branch information
stephaniewang526 committed May 29, 2020
1 parent b8226f8 commit b9638be7679cd0cdbac500e9c2d692be2dd45029
Showing with 18,239 additions and 13,987 deletions.
  1. +1,140 −0 ...uery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java
  2. +274 −0 ...ry-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java
  3. +42 −0 ...-cloud-bigquery-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java
  4. +88 −0 ...y-connection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java
  5. +530 −0 ...tion/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java
  6. +115 −0 ...c/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java
  7. +399 −0 ...nnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java
  8. +493 −0 ...-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java
  9. +57 −0 ...gquery-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java
  10. +190 −0 ...ry-connection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java
  11. +10 −0 google-cloud-bigqueryconnection-bom/pom.xml
  12. +9 −0 google-cloud-bigqueryconnection/pom.xml
  13. +92 −94 ...onnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClient.java
  14. +13 −13 ...nection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceSettings.java
  15. +2 −4 ...d-bigqueryconnection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/package-info.java
  16. +4 −4 ...ection/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStub.java
  17. +27 −27 ...rc/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/ConnectionServiceStubSettings.java
  18. +31 −31 ...on/src/main/java/com/google/cloud/bigquery/connection/v1beta1/stub/GrpcConnectionServiceStub.java
  19. +1,140 −0 ...queryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java
  20. +274 −0 ...eryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceSettings.java
  21. +42 −0 ...e-cloud-bigqueryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/package-info.java
  22. +88 −0 ...ryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStub.java
  23. +530 −0 ...tion/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/ConnectionServiceStubSettings.java
  24. +115 −0 ...c/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceCallableFactory.java
  25. +399 −0 ...nnection/src/main/java/com/google/cloud/bigqueryconnection/v1/stub/GrpcConnectionServiceStub.java
  26. +37 −37 ...ction/src/test/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionServiceClientTest.java
  27. +493 −0 ...yconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java
  28. +57 −0 ...igqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionService.java
  29. +190 −0 ...eryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java
  30. +69 −0 grpc-google-cloud-bigqueryconnection-v1/pom.xml
  31. +126 −326 ...ryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1}/ConnectionServiceGrpc.java
  32. +12 −0 pom.xml
  33. +0 −13,395 ...onnection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java
  34. +46 −0 proto-google-cloud-bigqueryconnection-v1/pom.xml
  35. +816 −0 ...gqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredential.java
  36. +75 −0 ...nection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredentialOrBuilder.java
  37. +1,443 −0 ...gqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlProperties.java
  38. +141 −0 ...nection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlPropertiesOrBuilder.java
  39. +1,662 −0 ...cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/Connection.java
  40. +1 −1 ...-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1}/ConnectionName.java
  41. +178 −0 ...queryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionOrBuilder.java
  42. +289 −0 ...-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionProto.java
  43. +1,147 −0 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequest.java
  44. +122 −0 ...on-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequestOrBuilder.java
  45. +665 −0 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequest.java
  46. +56 −0 ...on-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequestOrBuilder.java
  47. +661 −0 ...ueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequest.java
  48. +56 −0 ...ction-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequestOrBuilder.java
  49. +933 −0 ...ryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequest.java
  50. +94 −0 ...ion-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequestOrBuilder.java
  51. +1,148 −0 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponse.java
  52. +102 −0 ...on-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponseOrBuilder.java
  53. +1 −1 ...ud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1}/LocationName.java
  54. +1,252 −0 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequest.java
  55. +135 −0 ...on-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequestOrBuilder.java
  56. +20 −48 ...-cloud-bigqueryconnection-v1/src/main/proto/google/cloud/bigquery/connection/v1}/connection.proto
  57. +82 −0 ...onnection-v1beta1/src/main/java/com/google/cloud/bigquery/connection/v1beta1/ConnectionProto.java
  58. +22 −5 synth.metadata
  59. +2 −1 synth.py
  60. +2 −0 versions.txt

Large diffs are not rendered by default.

@@ -0,0 +1,274 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.bigqueryconnection.v1;

import static com.google.cloud.bigqueryconnection.v1.ConnectionServiceClient.ListConnectionsPagedResponse;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.ClientSettings;
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.bigquery.connection.v1.Connection;
import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest;
import com.google.cloud.bigquery.connection.v1.DeleteConnectionRequest;
import com.google.cloud.bigquery.connection.v1.GetConnectionRequest;
import com.google.cloud.bigquery.connection.v1.ListConnectionsRequest;
import com.google.cloud.bigquery.connection.v1.ListConnectionsResponse;
import com.google.cloud.bigquery.connection.v1.UpdateConnectionRequest;
import com.google.cloud.bigqueryconnection.v1.stub.ConnectionServiceStubSettings;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.iam.v1.TestIamPermissionsResponse;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
* Settings class to configure an instance of {@link ConnectionServiceClient}.
*
* <p>The default instance has everything set to sensible defaults:
*
* <ul>
* <li>The default service address (bigqueryconnection.googleapis.com) and default port (443) are
* used.
* <li>Credentials are acquired automatically through Application Default Credentials.
* <li>Retries are configured for idempotent methods but not for non-idempotent methods.
* </ul>
*
* <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 createConnection to 30 seconds:
*
* <pre>
* <code>
* ConnectionServiceSettings.Builder connectionServiceSettingsBuilder =
* ConnectionServiceSettings.newBuilder();
* connectionServiceSettingsBuilder
* .createConnectionSettings()
* .setRetrySettings(
* connectionServiceSettingsBuilder.createConnectionSettings().getRetrySettings().toBuilder()
* .setTotalTimeout(Duration.ofSeconds(30))
* .build());
* ConnectionServiceSettings connectionServiceSettings = connectionServiceSettingsBuilder.build();
* </code>
* </pre>
*/
@Generated("by gapic-generator")
@BetaApi
public class ConnectionServiceSettings extends ClientSettings<ConnectionServiceSettings> {
/** Returns the object with the settings used for calls to createConnection. */
public UnaryCallSettings<CreateConnectionRequest, Connection> createConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).createConnectionSettings();
}

/** Returns the object with the settings used for calls to getConnection. */
public UnaryCallSettings<GetConnectionRequest, Connection> getConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).getConnectionSettings();
}

/** Returns the object with the settings used for calls to listConnections. */
public PagedCallSettings<
ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>
listConnectionsSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).listConnectionsSettings();
}

/** Returns the object with the settings used for calls to updateConnection. */
public UnaryCallSettings<UpdateConnectionRequest, Connection> updateConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).updateConnectionSettings();
}

/** Returns the object with the settings used for calls to deleteConnection. */
public UnaryCallSettings<DeleteConnectionRequest, Empty> deleteConnectionSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).deleteConnectionSettings();
}

/** Returns the object with the settings used for calls to getIamPolicy. */
public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).getIamPolicySettings();
}

/** Returns the object with the settings used for calls to setIamPolicy. */
public UnaryCallSettings<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).setIamPolicySettings();
}

/** Returns the object with the settings used for calls to testIamPermissions. */
public UnaryCallSettings<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return ((ConnectionServiceStubSettings) getStubSettings()).testIamPermissionsSettings();
}

public static final ConnectionServiceSettings create(ConnectionServiceStubSettings stub)
throws IOException {
return new ConnectionServiceSettings.Builder(stub.toBuilder()).build();
}

/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return ConnectionServiceStubSettings.defaultExecutorProviderBuilder();
}

/** Returns the default service endpoint. */
public static String getDefaultEndpoint() {
return ConnectionServiceStubSettings.getDefaultEndpoint();
}

/** Returns the default service scopes. */
public static List<String> getDefaultServiceScopes() {
return ConnectionServiceStubSettings.getDefaultServiceScopes();
}

/** Returns a builder for the default credentials for this service. */
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
return ConnectionServiceStubSettings.defaultCredentialsProviderBuilder();
}

/** Returns a builder for the default ChannelProvider for this service. */
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
return ConnectionServiceStubSettings.defaultGrpcTransportProviderBuilder();
}

public static TransportChannelProvider defaultTransportChannelProvider() {
return ConnectionServiceStubSettings.defaultTransportChannelProvider();
}

@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return ConnectionServiceStubSettings.defaultApiClientHeaderProviderBuilder();
}

/** Returns a new builder for this class. */
public static Builder newBuilder() {
return Builder.createDefault();
}

/** Returns a new builder for this class. */
public static Builder newBuilder(ClientContext clientContext) {
return new Builder(clientContext);
}

/** Returns a builder containing all the values of this settings class. */
public Builder toBuilder() {
return new Builder(this);
}

protected ConnectionServiceSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);
}

/** Builder for ConnectionServiceSettings. */
public static class Builder extends ClientSettings.Builder<ConnectionServiceSettings, Builder> {
protected Builder() throws IOException {
this((ClientContext) null);
}

protected Builder(ClientContext clientContext) {
super(ConnectionServiceStubSettings.newBuilder(clientContext));
}

private static Builder createDefault() {
return new Builder(ConnectionServiceStubSettings.newBuilder());
}

protected Builder(ConnectionServiceSettings settings) {
super(settings.getStubSettings().toBuilder());
}

protected Builder(ConnectionServiceStubSettings.Builder stubSettings) {
super(stubSettings);
}

public ConnectionServiceStubSettings.Builder getStubSettingsBuilder() {
return ((ConnectionServiceStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
}

/** Returns the builder for the settings used for calls to createConnection. */
public UnaryCallSettings.Builder<CreateConnectionRequest, Connection>
createConnectionSettings() {
return getStubSettingsBuilder().createConnectionSettings();
}

/** Returns the builder for the settings used for calls to getConnection. */
public UnaryCallSettings.Builder<GetConnectionRequest, Connection> getConnectionSettings() {
return getStubSettingsBuilder().getConnectionSettings();
}

/** Returns the builder for the settings used for calls to listConnections. */
public PagedCallSettings.Builder<
ListConnectionsRequest, ListConnectionsResponse, ListConnectionsPagedResponse>
listConnectionsSettings() {
return getStubSettingsBuilder().listConnectionsSettings();
}

/** Returns the builder for the settings used for calls to updateConnection. */
public UnaryCallSettings.Builder<UpdateConnectionRequest, Connection>
updateConnectionSettings() {
return getStubSettingsBuilder().updateConnectionSettings();
}

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

/** Returns the builder for the settings used for calls to getIamPolicy. */
public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return getStubSettingsBuilder().getIamPolicySettings();
}

/** Returns the builder for the settings used for calls to setIamPolicy. */
public UnaryCallSettings.Builder<SetIamPolicyRequest, Policy> setIamPolicySettings() {
return getStubSettingsBuilder().setIamPolicySettings();
}

/** Returns the builder for the settings used for calls to testIamPermissions. */
public UnaryCallSettings.Builder<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsSettings() {
return getStubSettingsBuilder().testIamPermissionsSettings();
}

@Override
public ConnectionServiceSettings build() throws IOException {
return new ConnectionServiceSettings(this);
}
}
}
@@ -0,0 +1,42 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* A client to BigQuery Connection API.
*
* <p>The interfaces provided are listed below, along with usage samples.
*
* <p>======================= ConnectionServiceClient =======================
*
* <p>Service Description: Manages external data source connections and credentials.
*
* <p>Sample for ConnectionServiceClient:
*
* <pre>
* <code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* Connection connection = Connection.newBuilder().build();
* String connectionId = "";
* Connection response = connectionServiceClient.createConnection(parent, connection, connectionId);
* }
* </code>
* </pre>
*/
@Generated("by gapic-generator")
package com.google.cloud.bigqueryconnection.v1;

import javax.annotation.Generated;

0 comments on commit b9638be

Please sign in to comment.