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

Commit

Permalink
docs: cleanup and clarifications (#648)
Browse files Browse the repository at this point in the history
* docs: cleanup and clarifications
feat: add UpdateAssignment method
feat: add "concurrency" and "multi_region_auxiliary" in reservation
feat: add preferred table.

PiperOrigin-RevId: 440912466

Source-Link: googleapis/googleapis@7ab53ca

Source-Link: googleapis/googleapis-gen@116cf4d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTE2Y2Y0ZDU3Y2FkNWM0NTdjMDcwZTcxNjUzYTQ4ZWUyYzI2YWRlMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Apr 12, 2022
1 parent f0f9b6b commit 30bee5e
Show file tree
Hide file tree
Showing 29 changed files with 4,133 additions and 375 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ public ReservationServiceStub getStub() {
*
* @param parent Required. Project, location. E.g., `projects/myproject/locations/US`
* @param reservation Definition of the new reservation to create.
* @param reservationId The reservation ID. This field must only contain lower case alphanumeric
* characters or dash. Max length is 64 characters.
* @param reservationId The reservation ID. It must only contain lower case alphanumeric
* characters or dashes. It must start with a letter and must not end with a dash. Its maximum
* length is 64 characters.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Reservation createReservation(
Expand Down Expand Up @@ -217,8 +218,9 @@ public final Reservation createReservation(
*
* @param parent Required. Project, location. E.g., `projects/myproject/locations/US`
* @param reservation Definition of the new reservation to create.
* @param reservationId The reservation ID. This field must only contain lower case alphanumeric
* characters or dash. Max length is 64 characters.
* @param reservationId The reservation ID. It must only contain lower case alphanumeric
* characters or dashes. It must start with a letter and must not end with a dash. Its maximum
* length is 64 characters.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Reservation createReservation(
Expand Down Expand Up @@ -1259,8 +1261,8 @@ public final CapacityCommitment updateCapacityCommitment(
* <p>A common use case is to enable downgrading commitments.
*
* <p>For example, in order to downgrade from 10000 slots to 8000, you might split a 10000
* capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the
* first one to `FLEX` and then delete it.
* capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the
* commitment end time passes.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1296,8 +1298,8 @@ public final SplitCapacityCommitmentResponse splitCapacityCommitment(
* <p>A common use case is to enable downgrading commitments.
*
* <p>For example, in order to downgrade from 10000 slots to 8000, you might split a 10000
* capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the
* first one to `FLEX` and then delete it.
* capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the
* commitment end time passes.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1330,8 +1332,8 @@ public final SplitCapacityCommitmentResponse splitCapacityCommitment(
* <p>A common use case is to enable downgrading commitments.
*
* <p>For example, in order to downgrade from 10000 slots to 8000, you might split a 10000
* capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the
* first one to `FLEX` and then delete it.
* capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the
* commitment end time passes.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -1364,8 +1366,8 @@ public final SplitCapacityCommitmentResponse splitCapacityCommitment(
* <p>A common use case is to enable downgrading commitments.
*
* <p>For example, in order to downgrade from 10000 slots to 8000, you might split a 10000
* capacity commitment into commitments of 2000 and 8000. Then, you would change the plan of the
* first one to `FLEX` and then delete it.
* capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the
* commitment end time passes.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -2862,6 +2864,87 @@ public final UnaryCallable<MoveAssignmentRequest, Assignment> moveAssignmentCall
return stub.moveAssignmentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing assignment.
*
* <p>Only the `priority` field can be updated.
*
* <p>Sample code:
*
* <pre>{@code
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* Assignment assignment = Assignment.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* Assignment response = reservationServiceClient.updateAssignment(assignment, updateMask);
* }
* }</pre>
*
* @param assignment Content of the assignment to update.
* @param updateMask Standard field mask for the set of fields to be updated.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Assignment updateAssignment(Assignment assignment, FieldMask updateMask) {
UpdateAssignmentRequest request =
UpdateAssignmentRequest.newBuilder()
.setAssignment(assignment)
.setUpdateMask(updateMask)
.build();
return updateAssignment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing assignment.
*
* <p>Only the `priority` field can be updated.
*
* <p>Sample code:
*
* <pre>{@code
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* UpdateAssignmentRequest request =
* UpdateAssignmentRequest.newBuilder()
* .setAssignment(Assignment.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Assignment response = reservationServiceClient.updateAssignment(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Assignment updateAssignment(UpdateAssignmentRequest request) {
return updateAssignmentCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an existing assignment.
*
* <p>Only the `priority` field can be updated.
*
* <p>Sample code:
*
* <pre>{@code
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* UpdateAssignmentRequest request =
* UpdateAssignmentRequest.newBuilder()
* .setAssignment(Assignment.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Assignment> future =
* reservationServiceClient.updateAssignmentCallable().futureCall(request);
* // Do something.
* Assignment response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<UpdateAssignmentRequest, Assignment> updateAssignmentCallable() {
return stub.updateAssignmentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves a BI reservation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ public UnaryCallSettings<MoveAssignmentRequest, Assignment> moveAssignmentSettin
return ((ReservationServiceStubSettings) getStubSettings()).moveAssignmentSettings();
}

/** Returns the object with the settings used for calls to updateAssignment. */
public UnaryCallSettings<UpdateAssignmentRequest, Assignment> updateAssignmentSettings() {
return ((ReservationServiceStubSettings) getStubSettings()).updateAssignmentSettings();
}

/** Returns the object with the settings used for calls to getBiReservation. */
public UnaryCallSettings<GetBiReservationRequest, BiReservation> getBiReservationSettings() {
return ((ReservationServiceStubSettings) getStubSettings()).getBiReservationSettings();
Expand Down Expand Up @@ -418,6 +423,12 @@ public UnaryCallSettings.Builder<MoveAssignmentRequest, Assignment> moveAssignme
return getStubSettingsBuilder().moveAssignmentSettings();
}

/** Returns the builder for the settings used for calls to updateAssignment. */
public UnaryCallSettings.Builder<UpdateAssignmentRequest, Assignment>
updateAssignmentSettings() {
return getStubSettingsBuilder().updateAssignmentSettings();
}

/** Returns the builder for the settings used for calls to getBiReservation. */
public UnaryCallSettings.Builder<GetBiReservationRequest, BiReservation>
getBiReservationSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"SplitCapacityCommitment": {
"methods": ["splitCapacityCommitment", "splitCapacityCommitment", "splitCapacityCommitment", "splitCapacityCommitmentCallable"]
},
"UpdateAssignment": {
"methods": ["updateAssignment", "updateAssignment", "updateAssignmentCallable"]
},
"UpdateBiReservation": {
"methods": ["updateBiReservation", "updateBiReservation", "updateBiReservationCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse;
import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse;
import com.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest;
Expand Down Expand Up @@ -283,6 +284,17 @@ public class GrpcReservationServiceStub extends ReservationServiceStub {
.setResponseMarshaller(ProtoUtils.marshaller(Assignment.getDefaultInstance()))
.build();

private static final MethodDescriptor<UpdateAssignmentRequest, Assignment>
updateAssignmentMethodDescriptor =
MethodDescriptor.<UpdateAssignmentRequest, Assignment>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.bigquery.reservation.v1.ReservationService/UpdateAssignment")
.setRequestMarshaller(
ProtoUtils.marshaller(UpdateAssignmentRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Assignment.getDefaultInstance()))
.build();

private static final MethodDescriptor<GetBiReservationRequest, BiReservation>
getBiReservationMethodDescriptor =
MethodDescriptor.<GetBiReservationRequest, BiReservation>newBuilder()
Expand Down Expand Up @@ -344,6 +356,7 @@ public class GrpcReservationServiceStub extends ReservationServiceStub {
private final UnaryCallable<SearchAllAssignmentsRequest, SearchAllAssignmentsPagedResponse>
searchAllAssignmentsPagedCallable;
private final UnaryCallable<MoveAssignmentRequest, Assignment> moveAssignmentCallable;
private final UnaryCallable<UpdateAssignmentRequest, Assignment> updateAssignmentCallable;
private final UnaryCallable<GetBiReservationRequest, BiReservation> getBiReservationCallable;
private final UnaryCallable<UpdateBiReservationRequest, BiReservation>
updateBiReservationCallable;
Expand Down Expand Up @@ -588,6 +601,16 @@ protected GrpcReservationServiceStub(
return params.build();
})
.build();
GrpcCallSettings<UpdateAssignmentRequest, Assignment> updateAssignmentTransportSettings =
GrpcCallSettings.<UpdateAssignmentRequest, Assignment>newBuilder()
.setMethodDescriptor(updateAssignmentMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("assignment.name", String.valueOf(request.getAssignment().getName()));
return params.build();
})
.build();
GrpcCallSettings<GetBiReservationRequest, BiReservation> getBiReservationTransportSettings =
GrpcCallSettings.<GetBiReservationRequest, BiReservation>newBuilder()
.setMethodDescriptor(getBiReservationMethodDescriptor)
Expand Down Expand Up @@ -711,6 +734,9 @@ protected GrpcReservationServiceStub(
this.moveAssignmentCallable =
callableFactory.createUnaryCallable(
moveAssignmentTransportSettings, settings.moveAssignmentSettings(), clientContext);
this.updateAssignmentCallable =
callableFactory.createUnaryCallable(
updateAssignmentTransportSettings, settings.updateAssignmentSettings(), clientContext);
this.getBiReservationCallable =
callableFactory.createUnaryCallable(
getBiReservationTransportSettings, settings.getBiReservationSettings(), clientContext);
Expand Down Expand Up @@ -857,6 +883,11 @@ public UnaryCallable<MoveAssignmentRequest, Assignment> moveAssignmentCallable()
return moveAssignmentCallable;
}

@Override
public UnaryCallable<UpdateAssignmentRequest, Assignment> updateAssignmentCallable() {
return updateAssignmentCallable;
}

@Override
public UnaryCallable<GetBiReservationRequest, BiReservation> getBiReservationCallable() {
return getBiReservationCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse;
import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse;
import com.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest;
Expand Down Expand Up @@ -175,6 +176,10 @@ public UnaryCallable<MoveAssignmentRequest, Assignment> moveAssignmentCallable()
throw new UnsupportedOperationException("Not implemented: moveAssignmentCallable()");
}

public UnaryCallable<UpdateAssignmentRequest, Assignment> updateAssignmentCallable() {
throw new UnsupportedOperationException("Not implemented: updateAssignmentCallable()");
}

public UnaryCallable<GetBiReservationRequest, BiReservation> getBiReservationCallable() {
throw new UnsupportedOperationException("Not implemented: getBiReservationCallable()");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import com.google.cloud.bigquery.reservation.v1.SearchAssignmentsResponse;
import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse;
import com.google.cloud.bigquery.reservation.v1.UpdateAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateBiReservationRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.UpdateReservationRequest;
Expand Down Expand Up @@ -165,6 +166,7 @@ public class ReservationServiceStubSettings extends StubSettings<ReservationServ
SearchAllAssignmentsPagedResponse>
searchAllAssignmentsSettings;
private final UnaryCallSettings<MoveAssignmentRequest, Assignment> moveAssignmentSettings;
private final UnaryCallSettings<UpdateAssignmentRequest, Assignment> updateAssignmentSettings;
private final UnaryCallSettings<GetBiReservationRequest, BiReservation> getBiReservationSettings;
private final UnaryCallSettings<UpdateBiReservationRequest, BiReservation>
updateBiReservationSettings;
Expand Down Expand Up @@ -595,6 +597,11 @@ public UnaryCallSettings<MoveAssignmentRequest, Assignment> moveAssignmentSettin
return moveAssignmentSettings;
}

/** Returns the object with the settings used for calls to updateAssignment. */
public UnaryCallSettings<UpdateAssignmentRequest, Assignment> updateAssignmentSettings() {
return updateAssignmentSettings;
}

/** Returns the object with the settings used for calls to getBiReservation. */
public UnaryCallSettings<GetBiReservationRequest, BiReservation> getBiReservationSettings() {
return getBiReservationSettings;
Expand Down Expand Up @@ -700,6 +707,7 @@ protected ReservationServiceStubSettings(Builder settingsBuilder) throws IOExcep
searchAssignmentsSettings = settingsBuilder.searchAssignmentsSettings().build();
searchAllAssignmentsSettings = settingsBuilder.searchAllAssignmentsSettings().build();
moveAssignmentSettings = settingsBuilder.moveAssignmentSettings().build();
updateAssignmentSettings = settingsBuilder.updateAssignmentSettings().build();
getBiReservationSettings = settingsBuilder.getBiReservationSettings().build();
updateBiReservationSettings = settingsBuilder.updateBiReservationSettings().build();
}
Expand Down Expand Up @@ -754,6 +762,8 @@ public static class Builder
searchAllAssignmentsSettings;
private final UnaryCallSettings.Builder<MoveAssignmentRequest, Assignment>
moveAssignmentSettings;
private final UnaryCallSettings.Builder<UpdateAssignmentRequest, Assignment>
updateAssignmentSettings;
private final UnaryCallSettings.Builder<GetBiReservationRequest, BiReservation>
getBiReservationSettings;
private final UnaryCallSettings.Builder<UpdateBiReservationRequest, BiReservation>
Expand Down Expand Up @@ -831,6 +841,7 @@ protected Builder(ClientContext clientContext) {
searchAllAssignmentsSettings =
PagedCallSettings.newBuilder(SEARCH_ALL_ASSIGNMENTS_PAGE_STR_FACT);
moveAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateAssignmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getBiReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
updateBiReservationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

Expand All @@ -854,6 +865,7 @@ protected Builder(ClientContext clientContext) {
searchAssignmentsSettings,
searchAllAssignmentsSettings,
moveAssignmentSettings,
updateAssignmentSettings,
getBiReservationSettings,
updateBiReservationSettings);
initDefaults(this);
Expand All @@ -880,6 +892,7 @@ protected Builder(ReservationServiceStubSettings settings) {
searchAssignmentsSettings = settings.searchAssignmentsSettings.toBuilder();
searchAllAssignmentsSettings = settings.searchAllAssignmentsSettings.toBuilder();
moveAssignmentSettings = settings.moveAssignmentSettings.toBuilder();
updateAssignmentSettings = settings.updateAssignmentSettings.toBuilder();
getBiReservationSettings = settings.getBiReservationSettings.toBuilder();
updateBiReservationSettings = settings.updateBiReservationSettings.toBuilder();

Expand All @@ -903,6 +916,7 @@ protected Builder(ReservationServiceStubSettings settings) {
searchAssignmentsSettings,
searchAllAssignmentsSettings,
moveAssignmentSettings,
updateAssignmentSettings,
getBiReservationSettings,
updateBiReservationSettings);
}
Expand Down Expand Up @@ -1011,6 +1025,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));

builder
.updateAssignmentSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.getBiReservationSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
Expand Down Expand Up @@ -1158,6 +1177,12 @@ public UnaryCallSettings.Builder<MoveAssignmentRequest, Assignment> moveAssignme
return moveAssignmentSettings;
}

/** Returns the builder for the settings used for calls to updateAssignment. */
public UnaryCallSettings.Builder<UpdateAssignmentRequest, Assignment>
updateAssignmentSettings() {
return updateAssignmentSettings;
}

/** Returns the builder for the settings used for calls to getBiReservation. */
public UnaryCallSettings.Builder<GetBiReservationRequest, BiReservation>
getBiReservationSettings() {
Expand Down
Loading

0 comments on commit 30bee5e

Please sign in to comment.