Skip to content
Permalink
Browse files
feat: proto changes (#64)
* fix: update method_signature annotation for list RPC

PiperOrigin-RevId: 315740438

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed Jun 10 12:12:14 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: a927c3518b0a8cfaaed7022e99ec5144b46c4a8d
Source-Link: googleapis/googleapis@a927c35

* fix: update annotations for java proto generation

PiperOrigin-RevId: 317204502

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Jun 18 16:26:44 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 163aa04ede887024d245ab2c6af2528d9460bb9c
Source-Link: googleapis/googleapis@163aa04
  • Loading branch information
yoshi-automation committed Jun 23, 2020
1 parent cf7f3ea commit cf48513fd40c12e2aaac198a3d1895afeb367271
Showing with 413 additions and 86 deletions.
  1. +59 −8 ...queryconnection/src/main/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClient.java
  2. +3 −16 ...yconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/ConnectionServiceClientTest.java
  3. +9 −9 ...eryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionServiceGrpc.java
  4. +5 −5 ...gqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlCredential.java
  5. +5 −5 ...gqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CloudSqlProperties.java
  6. +5 −5 ...cloud-bigqueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/Connection.java
  7. +289 −0 ...ueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ConnectionOuterClass.java
  8. +5 −5 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/CreateConnectionRequest.java
  9. +5 −5 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/DeleteConnectionRequest.java
  10. +5 −5 ...ueryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/GetConnectionRequest.java
  11. +5 −5 ...ryconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsRequest.java
  12. +5 −5 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/ListConnectionsResponse.java
  13. +5 −5 ...yconnection-v1/src/main/java/com/google/cloud/bigquery/connection/v1/UpdateConnectionRequest.java
  14. +3 −3 ...e-cloud-bigqueryconnection-v1/src/main/proto/google/cloud/bigquery/connection/v1/connection.proto
  15. +5 −5 synth.metadata
@@ -377,6 +377,57 @@ public final UnaryCallable<GetConnectionRequest, Connection> getConnectionCallab
return stub.getConnectionCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns a list of connections in the given project.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* for (Connection element : connectionServiceClient.listConnections(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* </code></pre>
*
* @param parent Required. Parent resource name. Must be in the form:
* `projects/{project_id}/locations/{location_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListConnectionsPagedResponse listConnections(LocationName parent) {
ListConnectionsRequest request =
ListConnectionsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listConnections(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns a list of connections in the given project.
*
* <p>Sample code:
*
* <pre><code>
* try (ConnectionServiceClient connectionServiceClient = ConnectionServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* for (Connection element : connectionServiceClient.listConnections(parent.toString()).iterateAll()) {
* // doThingsWith(element);
* }
* }
* </code></pre>
*
* @param parent Required. Parent resource name. Must be in the form:
* `projects/{project_id}/locations/{location_id}`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListConnectionsPagedResponse listConnections(String parent) {
ListConnectionsRequest request = ListConnectionsRequest.newBuilder().setParent(parent).build();
return listConnections(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns a list of connections in the given project.
@@ -784,7 +835,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* <p>Sample code:
*
@@ -816,7 +867,7 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* <p>Sample code:
*
@@ -845,7 +896,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* <p>Sample code:
*
@@ -872,7 +923,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* <p>Sample code:
*
@@ -897,7 +948,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
*
* <p>Note: This operation is designed to be used for building permission-aware UIs and
* command-line tools, not for authorization checking. This operation may "fail open" without
@@ -933,7 +984,7 @@ public final TestIamPermissionsResponse testIamPermissions(
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
*
* <p>Note: This operation is designed to be used for building permission-aware UIs and
* command-line tools, not for authorization checking. This operation may "fail open" without
@@ -969,7 +1020,7 @@ public final TestIamPermissionsResponse testIamPermissions(
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
*
* <p>Note: This operation is designed to be used for building permission-aware UIs and
* command-line tools, not for authorization checking. This operation may "fail open" without
@@ -999,7 +1050,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
*
* <p>Note: This operation is designed to be used for building permission-aware UIs and
* command-line tools, not for authorization checking. This operation may "fail open" without
@@ -222,14 +222,8 @@ public void listConnectionsTest() {
mockConnectionService.addResponse(expectedResponse);

LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
int pageSize = 883849137;
ListConnectionsRequest request =
ListConnectionsRequest.newBuilder()
.setParent(parent.toString())
.setPageSize(pageSize)
.build();

ListConnectionsPagedResponse pagedListResponse = client.listConnections(request);
ListConnectionsPagedResponse pagedListResponse = client.listConnections(parent);

List<Connection> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
@@ -240,7 +234,6 @@ public void listConnectionsTest() {
ListConnectionsRequest actualRequest = (ListConnectionsRequest) actualRequests.get(0);

Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent()));
Assert.assertEquals(pageSize, actualRequest.getPageSize());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -255,14 +248,8 @@ public void listConnectionsExceptionTest() throws Exception {

try {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
int pageSize = 883849137;
ListConnectionsRequest request =
ListConnectionsRequest.newBuilder()
.setParent(parent.toString())
.setPageSize(pageSize)
.build();

client.listConnections(request);

client.listConnections(parent);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
// Expected exception
@@ -536,7 +536,7 @@ public void getIamPolicy(
* <pre>
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
* Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* </pre>
*/
public void setIamPolicy(
@@ -551,7 +551,7 @@ public void setIamPolicy(
* <pre>
* Returns permissions that a caller has on the specified resource.
* If the resource does not exist, this will return an empty set of
* permissions, not a NOT_FOUND error.
* permissions, not a `NOT_FOUND` error.
* Note: This operation is designed to be used for building permission-aware
* UIs and command-line tools, not for authorization checking. This operation
* may "fail open" without warning.
@@ -752,7 +752,7 @@ public void getIamPolicy(
* <pre>
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
* Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* </pre>
*/
public void setIamPolicy(
@@ -770,7 +770,7 @@ public void setIamPolicy(
* <pre>
* Returns permissions that a caller has on the specified resource.
* If the resource does not exist, this will return an empty set of
* permissions, not a NOT_FOUND error.
* permissions, not a `NOT_FOUND` error.
* Note: This operation is designed to be used for building permission-aware
* UIs and command-line tools, not for authorization checking. This operation
* may "fail open" without warning.
@@ -890,7 +890,7 @@ public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyReque
* <pre>
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
* Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* </pre>
*/
public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) {
@@ -903,7 +903,7 @@ public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyReque
* <pre>
* Returns permissions that a caller has on the specified resource.
* If the resource does not exist, this will return an empty set of
* permissions, not a NOT_FOUND error.
* permissions, not a `NOT_FOUND` error.
* Note: This operation is designed to be used for building permission-aware
* UIs and command-line tools, not for authorization checking. This operation
* may "fail open" without warning.
@@ -1026,7 +1026,7 @@ protected ConnectionServiceFutureStub build(
* <pre>
* Sets the access control policy on the specified resource. Replaces any
* existing policy.
* Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.iam.v1.Policy>
@@ -1041,7 +1041,7 @@ protected ConnectionServiceFutureStub build(
* <pre>
* Returns permissions that a caller has on the specified resource.
* If the resource does not exist, this will return an empty set of
* permissions, not a NOT_FOUND error.
* permissions, not a `NOT_FOUND` error.
* Note: This operation is designed to be used for building permission-aware
* UIs and command-line tools, not for authorization checking. This operation
* may "fail open" without warning.
@@ -1150,7 +1150,7 @@ public io.grpc.stub.StreamObserver<Req> invoke(

@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto.getDescriptor();
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass.getDescriptor();
}

@java.lang.Override
@@ -105,14 +105,14 @@ private CloudSqlCredential(
}

public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.connection.v1.CloudSqlCredential.class,
@@ -400,14 +400,14 @@ public static final class Builder extends com.google.protobuf.GeneratedMessageV3
// @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.CloudSqlCredential)
com.google.cloud.bigquery.connection.v1.CloudSqlCredentialOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.connection.v1.CloudSqlCredential.class,
@@ -440,7 +440,7 @@ public Builder clear() {

@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlCredential_descriptor;
}

@@ -130,14 +130,14 @@ private CloudSqlProperties(
}

public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.connection.v1.CloudSqlProperties.class,
@@ -706,14 +706,14 @@ public static final class Builder extends com.google.protobuf.GeneratedMessageV3
// @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.CloudSqlProperties)
com.google.cloud.bigquery.connection.v1.CloudSqlPropertiesOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.connection.v1.CloudSqlProperties.class,
@@ -754,7 +754,7 @@ public Builder clear() {

@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_CloudSqlProperties_descriptor;
}

@@ -149,14 +149,14 @@ private Connection(
}

public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_Connection_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.connection.v1.Connection.class,
@@ -706,14 +706,14 @@ public static final class Builder extends com.google.protobuf.GeneratedMessageV3
// @@protoc_insertion_point(builder_implements:google.cloud.bigquery.connection.v1.Connection)
com.google.cloud.bigquery.connection.v1.ConnectionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor;
}

@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_Connection_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.connection.v1.Connection.class,
@@ -756,7 +756,7 @@ public Builder clear() {

@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.bigquery.connection.v1.ConnectionProto
return com.google.cloud.bigquery.connection.v1.ConnectionOuterClass
.internal_static_google_cloud_bigquery_connection_v1_Connection_descriptor;
}

0 comments on commit cf48513

Please sign in to comment.