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

Commit

Permalink
[CHANGE ME] Re-generated to pick up changes from googleapis. (#49)
Browse files Browse the repository at this point in the history
* bazel: update protobuf, rules_go, gazelle, and gapic-generator-go versions - protobuf v3.12.1 - rules_go v0.23.0 - gazelle v0.21.0 - gapic-generator-go v0.14.1

PiperOrigin-RevId: 313460921

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed May 27 14:10:16 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: c4e37010d74071851ff24121f522e802231ac86e
Source-Link: googleapis/googleapis@c4e3701

* - Add CreateCapacityCommitment method to BigQuery Reservation v1beta1. - Update missing child_type annotations for v1 and v1beta1 proto annotations. - Revert name of bi_reservation back to reservation for v1beta1 service.

PiperOrigin-RevId: 314217336

Source-Author: Google APIs <noreply@google.com>
Source-Date: Mon Jun 1 15:38:28 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 907754d70ec714ab0e8282fe6ff4988221c64130
Source-Link: googleapis/googleapis@907754d

* add clir ignore differences

Co-authored-by: Praful Makani <praful@qlogic.io>
  • Loading branch information
yoshi-automation and Praful Makani committed Jun 11, 2020
1 parent ef0b921 commit 680fd86
Show file tree
Hide file tree
Showing 35 changed files with 252 additions and 52 deletions.
10 changes: 10 additions & 0 deletions google-cloud-bigqueryreservation/clirr-ignored-differences.xml
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://mojo.codehaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<difference>
<className>com/google/cloud/bigquery/reservation/v1/ReservationServiceClient/**</className>
<method>* *(*, *)</method>
<to>* *(*,*)</to>
<differenceType>7005</differenceType>
</difference>
</differences>
Expand Up @@ -2010,7 +2010,7 @@ public final ListAssignmentsPagedResponse listAssignments(ListAssignmentsRequest
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String query = "";
* for (Assignment element : reservationServiceClient.searchAssignments(parent, query).iterateAll()) {
* // doThingsWith(element);
Expand All @@ -2026,8 +2026,7 @@ public final ListAssignmentsPagedResponse listAssignments(ListAssignmentsRequest
* `assignee=organizations/456`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SearchAssignmentsPagedResponse searchAssignments(
ReservationName parent, String query) {
public final SearchAssignmentsPagedResponse searchAssignments(LocationName parent, String query) {
SearchAssignmentsRequest request =
SearchAssignmentsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
Expand Down Expand Up @@ -2063,7 +2062,7 @@ public final SearchAssignmentsPagedResponse searchAssignments(
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String query = "";
* for (Assignment element : reservationServiceClient.searchAssignments(parent.toString(), query).iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -2112,7 +2111,7 @@ public final SearchAssignmentsPagedResponse searchAssignments(String parent, Str
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
Expand Down Expand Up @@ -2156,7 +2155,7 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
Expand Down Expand Up @@ -2200,7 +2199,7 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* SearchAssignmentsRequest request = SearchAssignmentsRequest.newBuilder()
* .setParent(parent.toString())
* .build();
Expand Down Expand Up @@ -2236,7 +2235,7 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
* String destinationId = "";
* ReservationName destinationId = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* Assignment response = reservationServiceClient.moveAssignment(name, destinationId);
* }
* </code></pre>
Expand All @@ -2247,11 +2246,11 @@ public final SearchAssignmentsPagedResponse searchAssignments(SearchAssignmentsR
* `projects/myotherproject/locations/US/reservations/team2-prod`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Assignment moveAssignment(AssignmentName name, String destinationId) {
public final Assignment moveAssignment(AssignmentName name, ReservationName destinationId) {
MoveAssignmentRequest request =
MoveAssignmentRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setDestinationId(destinationId)
.setDestinationId(destinationId == null ? null : destinationId.toString())
.build();
return moveAssignment(request);
}
Expand All @@ -2268,8 +2267,8 @@ public final Assignment moveAssignment(AssignmentName name, String destinationId
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* AssignmentName name = AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
* String destinationId = "";
* Assignment response = reservationServiceClient.moveAssignment(name.toString(), destinationId);
* ReservationName destinationId = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
* Assignment response = reservationServiceClient.moveAssignment(name.toString(), destinationId.toString());
* }
* </code></pre>
*
Expand Down
Expand Up @@ -780,7 +780,7 @@ public void searchAssignmentsTest() {
.build();
mockReservationService.addResponse(expectedResponse);

ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String query = "query107944136";

SearchAssignmentsPagedResponse pagedListResponse = client.searchAssignments(parent, query);
Expand All @@ -793,7 +793,7 @@ public void searchAssignmentsTest() {
Assert.assertEquals(1, actualRequests.size());
SearchAssignmentsRequest actualRequest = (SearchAssignmentsRequest) actualRequests.get(0);

Assert.assertEquals(parent, ReservationName.parse(actualRequest.getParent()));
Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent()));
Assert.assertEquals(query, actualRequest.getQuery());
Assert.assertTrue(
channelProvider.isHeaderSent(
Expand All @@ -808,7 +808,7 @@ public void searchAssignmentsExceptionTest() throws Exception {
mockReservationService.addException(exception);

try {
ReservationName parent = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String query = "query107944136";

client.searchAssignments(parent, query);
Expand All @@ -830,7 +830,7 @@ public void moveAssignmentTest() {

AssignmentName name =
AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
String destinationId = "destinationId912984812";
ReservationName destinationId = ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");

Assignment actualResponse = client.moveAssignment(name, destinationId);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -840,7 +840,7 @@ public void moveAssignmentTest() {
MoveAssignmentRequest actualRequest = (MoveAssignmentRequest) actualRequests.get(0);

Assert.assertEquals(name, AssignmentName.parse(actualRequest.getName()));
Assert.assertEquals(destinationId, actualRequest.getDestinationId());
Assert.assertEquals(destinationId, ReservationName.parse(actualRequest.getDestinationId()));
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -856,7 +856,8 @@ public void moveAssignmentExceptionTest() throws Exception {
try {
AssignmentName name =
AssignmentName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]", "[ASSIGNMENT]");
String destinationId = "destinationId912984812";
ReservationName destinationId =
ReservationName.of("[PROJECT]", "[LOCATION]", "[RESERVATION]");

client.moveAssignment(name, destinationId);
Assert.fail("No exception raised");
Expand Down
Expand Up @@ -259,6 +259,10 @@ public JobType findValueByNumber(int number) {
};

public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}

Expand Down Expand Up @@ -418,6 +422,10 @@ public State findValueByNumber(int number) {
};

public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}

Expand Down Expand Up @@ -466,6 +474,7 @@ private State(int value) {
*
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
Expand All @@ -489,6 +498,7 @@ public java.lang.String getName() {
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
Expand All @@ -515,6 +525,7 @@ public com.google.protobuf.ByteString getNameBytes() {
*
* @return The assignee.
*/
@java.lang.Override
public java.lang.String getAssignee() {
java.lang.Object ref = assignee_;
if (ref instanceof java.lang.String) {
Expand All @@ -538,6 +549,7 @@ public java.lang.String getAssignee() {
*
* @return The bytes for assignee.
*/
@java.lang.Override
public com.google.protobuf.ByteString getAssigneeBytes() {
java.lang.Object ref = assignee_;
if (ref instanceof java.lang.String) {
Expand All @@ -563,6 +575,7 @@ public com.google.protobuf.ByteString getAssigneeBytes() {
*
* @return The enum numeric value on the wire for jobType.
*/
@java.lang.Override
public int getJobTypeValue() {
return jobType_;
}
Expand All @@ -577,6 +590,7 @@ public int getJobTypeValue() {
*
* @return The jobType.
*/
@java.lang.Override
public com.google.cloud.bigquery.reservation.v1.Assignment.JobType getJobType() {
@SuppressWarnings("deprecation")
com.google.cloud.bigquery.reservation.v1.Assignment.JobType result =
Expand All @@ -601,6 +615,7 @@ public com.google.cloud.bigquery.reservation.v1.Assignment.JobType getJobType()
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
Expand All @@ -617,6 +632,7 @@ public int getStateValue() {
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.bigquery.reservation.v1.Assignment.State getState() {
@SuppressWarnings("deprecation")
com.google.cloud.bigquery.reservation.v1.Assignment.State result =
Expand Down Expand Up @@ -1233,6 +1249,7 @@ public Builder setAssigneeBytes(com.google.protobuf.ByteString value) {
*
* @return The enum numeric value on the wire for jobType.
*/
@java.lang.Override
public int getJobTypeValue() {
return jobType_;
}
Expand All @@ -1249,6 +1266,7 @@ public int getJobTypeValue() {
* @return This builder for chaining.
*/
public Builder setJobTypeValue(int value) {

jobType_ = value;
onChanged();
return this;
Expand All @@ -1264,6 +1282,7 @@ public Builder setJobTypeValue(int value) {
*
* @return The jobType.
*/
@java.lang.Override
public com.google.cloud.bigquery.reservation.v1.Assignment.JobType getJobType() {
@SuppressWarnings("deprecation")
com.google.cloud.bigquery.reservation.v1.Assignment.JobType result =
Expand Down Expand Up @@ -1325,6 +1344,7 @@ public Builder clearJobType() {
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
Expand All @@ -1343,6 +1363,7 @@ public int getStateValue() {
* @return This builder for chaining.
*/
public Builder setStateValue(int value) {

state_ = value;
onChanged();
return this;
Expand All @@ -1360,6 +1381,7 @@ public Builder setStateValue(int value) {
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.bigquery.reservation.v1.Assignment.State getState() {
@SuppressWarnings("deprecation")
com.google.cloud.bigquery.reservation.v1.Assignment.State result =
Expand Down
Expand Up @@ -146,6 +146,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
*
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
Expand All @@ -170,6 +171,7 @@ public java.lang.String getName() {
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
Expand All @@ -196,6 +198,7 @@ public com.google.protobuf.ByteString getNameBytes() {
*
* @return Whether the updateTime field is set.
*/
@java.lang.Override
public boolean hasUpdateTime() {
return updateTime_ != null;
}
Expand All @@ -211,6 +214,7 @@ public boolean hasUpdateTime() {
*
* @return The updateTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getUpdateTime() {
return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
}
Expand All @@ -224,6 +228,7 @@ public com.google.protobuf.Timestamp getUpdateTime() {
* <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
return getUpdateTime();
}
Expand All @@ -241,6 +246,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
*
* @return The size.
*/
@java.lang.Override
public long getSize() {
return size_;
}
Expand Down Expand Up @@ -936,6 +942,7 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
*
* @return The size.
*/
@java.lang.Override
public long getSize() {
return size_;
}
Expand Down

0 comments on commit 680fd86

Please sign in to comment.