Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ target/

# python utilities
*.pyc
__pycache__
__pycache__

.flattened-pom.xml
2 changes: 1 addition & 1 deletion .repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"repo": "googleapis/java-bigqueryreservations",
"repo_short": "java-bigqueryreservations",
"distribution_name": "com.google.cloud:google-cloud-bigqueryreservations",
"api_id": "bigqueryreservations.googleapis.com",
"api_id": "bigqueryreservation.googleapis.com",
"requires_billing": true
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigqueryreservations</artifactId>
<version>0.0.0</version>
</dependency>

```
Expand Down Expand Up @@ -160,6 +161,6 @@ Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5]
[code-of-conduct]: https://github.com/googleapis/java-bigqueryreservations/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct
[license]: https://github.com/googleapis/java-bigqueryreservations/blob/master/LICENSE
[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing
[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=bigqueryreservations.googleapis.com
[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=bigqueryreservation.googleapis.com
[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
8 changes: 4 additions & 4 deletions google-cloud-bigqueryreservations-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigqueryreservations-v1beta1</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigqueryreservations-v1beta1:current} -->
<artifactId>proto-google-cloud-bigqueryreservations-v1</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigqueryreservations-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-bigqueryreservations-v1beta1</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigqueryreservations-v1beta1:current} -->
<artifactId>grpc-google-cloud-bigqueryreservations-v1</artifactId>
<version>0.0.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigqueryreservations-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
5 changes: 3 additions & 2 deletions google-cloud-bigqueryreservations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<properties>
<site.installationModule>google-cloud-bigqueryreservations</site.installationModule>
</properties>

<dependencies>
<dependency>
<groupId>io.grpc</groupId>
Expand Down Expand Up @@ -44,7 +45,7 @@

<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigqueryreservations-v1beta1</artifactId>
<artifactId>proto-google-cloud-bigqueryreservations-v1</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -72,7 +73,7 @@

<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-bigqueryreservations-v1beta1</artifactId>
<artifactId>grpc-google-cloud-bigqueryreservations-v1</artifactId>
<scope>test</scope>
</dependency>
<!-- Need testing utility classes for generated gRPC clients tests -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,111 @@ public final UnaryCallable<UpdateReservationRequest, Reservation> updateReservat
return stub.updateReservationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new capacity commitment resource.
*
* <p>Sample code:
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build();
* CapacityCommitment response = reservationServiceClient.createCapacityCommitment(parent, capacityCommitment);
* }
* </code></pre>
*
* @param parent Required. Resource name of the parent reservation. E.g.,
* projects/myproject/locations/US
* @param capacityCommitment Content of the capacity commitment to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CapacityCommitment createCapacityCommitment(
LocationName parent, CapacityCommitment capacityCommitment) {
CreateCapacityCommitmentRequest request =
CreateCapacityCommitmentRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setCapacityCommitment(capacityCommitment)
.build();
return createCapacityCommitment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new capacity commitment resource.
*
* <p>Sample code:
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* CapacityCommitment capacityCommitment = CapacityCommitment.newBuilder().build();
* CapacityCommitment response = reservationServiceClient.createCapacityCommitment(parent.toString(), capacityCommitment);
* }
* </code></pre>
*
* @param parent Required. Resource name of the parent reservation. E.g.,
* projects/myproject/locations/US
* @param capacityCommitment Content of the capacity commitment to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CapacityCommitment createCapacityCommitment(
String parent, CapacityCommitment capacityCommitment) {
CreateCapacityCommitmentRequest request =
CreateCapacityCommitmentRequest.newBuilder()
.setParent(parent)
.setCapacityCommitment(capacityCommitment)
.build();
return createCapacityCommitment(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new capacity commitment resource.
*
* <p>Sample code:
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* CreateCapacityCommitmentRequest request = CreateCapacityCommitmentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
* CapacityCommitment response = reservationServiceClient.createCapacityCommitment(request);
* }
* </code></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 CapacityCommitment createCapacityCommitment(
CreateCapacityCommitmentRequest request) {
return createCapacityCommitmentCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a new capacity commitment resource.
*
* <p>Sample code:
*
* <pre><code>
* try (ReservationServiceClient reservationServiceClient = ReservationServiceClient.create()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* CreateCapacityCommitmentRequest request = CreateCapacityCommitmentRequest.newBuilder()
* .setParent(parent.toString())
* .build();
* ApiFuture&lt;CapacityCommitment&gt; future = reservationServiceClient.createCapacityCommitmentCallable().futureCall(request);
* // Do something
* CapacityCommitment response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentCallable() {
return stub.createCapacityCommitmentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all the capacity commitments for the admin project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ public UnaryCallSettings<UpdateReservationRequest, Reservation> updateReservatio
return ((ReservationServiceStubSettings) getStubSettings()).updateReservationSettings();
}

/** Returns the object with the settings used for calls to createCapacityCommitment. */
public UnaryCallSettings<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentSettings() {
return ((ReservationServiceStubSettings) getStubSettings()).createCapacityCommitmentSettings();
}

/** Returns the object with the settings used for calls to listCapacityCommitments. */
public PagedCallSettings<
ListCapacityCommitmentsRequest,
Expand Down Expand Up @@ -315,6 +321,12 @@ public UnaryCallSettings.Builder<GetReservationRequest, Reservation> getReservat
return getStubSettingsBuilder().updateReservationSettings();
}

/** Returns the builder for the settings used for calls to createCapacityCommitment. */
public UnaryCallSettings.Builder<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentSettings() {
return getStubSettingsBuilder().createCapacityCommitmentSettings();
}

/** Returns the builder for the settings used for calls to listCapacityCommitments. */
public PagedCallSettings.Builder<
ListCapacityCommitmentsRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.google.cloud.bigquery.reservation.v1.BiReservation;
import com.google.cloud.bigquery.reservation.v1.CapacityCommitment;
import com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.CreateReservationRequest;
import com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest;
Expand Down Expand Up @@ -145,6 +146,16 @@ public class GrpcReservationServiceStub extends ReservationServiceStub {
ProtoUtils.marshaller(UpdateReservationRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Reservation.getDefaultInstance()))
.build();
private static final MethodDescriptor<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentMethodDescriptor =
MethodDescriptor.<CreateCapacityCommitmentRequest, CapacityCommitment>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName(
"google.cloud.bigquery.reservation.v1.ReservationService/CreateCapacityCommitment")
.setRequestMarshaller(
ProtoUtils.marshaller(CreateCapacityCommitmentRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(CapacityCommitment.getDefaultInstance()))
.build();
private static final MethodDescriptor<
ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse>
listCapacityCommitmentsMethodDescriptor =
Expand Down Expand Up @@ -277,6 +288,8 @@ public class GrpcReservationServiceStub extends ReservationServiceStub {
listReservationsPagedCallable;
private final UnaryCallable<GetReservationRequest, Reservation> getReservationCallable;
private final UnaryCallable<UpdateReservationRequest, Reservation> updateReservationCallable;
private final UnaryCallable<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentCallable;
private final UnaryCallable<ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse>
listCapacityCommitmentsCallable;
private final UnaryCallable<ListCapacityCommitmentsRequest, ListCapacityCommitmentsPagedResponse>
Expand Down Expand Up @@ -438,6 +451,20 @@ public Map<String, String> extract(UpdateReservationRequest request) {
}
})
.build();
GrpcCallSettings<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentTransportSettings =
GrpcCallSettings.<CreateCapacityCommitmentRequest, CapacityCommitment>newBuilder()
.setMethodDescriptor(createCapacityCommitmentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateCapacityCommitmentRequest>() {
@Override
public Map<String, String> extract(CreateCapacityCommitmentRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
})
.build();
GrpcCallSettings<ListCapacityCommitmentsRequest, ListCapacityCommitmentsResponse>
listCapacityCommitmentsTransportSettings =
GrpcCallSettings
Expand Down Expand Up @@ -628,6 +655,11 @@ public Map<String, String> extract(UpdateBiReservationRequest request) {
updateReservationTransportSettings,
settings.updateReservationSettings(),
clientContext);
this.createCapacityCommitmentCallable =
callableFactory.createUnaryCallable(
createCapacityCommitmentTransportSettings,
settings.createCapacityCommitmentSettings(),
clientContext);
this.listCapacityCommitmentsCallable =
callableFactory.createUnaryCallable(
listCapacityCommitmentsTransportSettings,
Expand Down Expand Up @@ -726,6 +758,11 @@ public UnaryCallable<UpdateReservationRequest, Reservation> updateReservationCal
return updateReservationCallable;
}

public UnaryCallable<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentCallable() {
return createCapacityCommitmentCallable;
}

public UnaryCallable<ListCapacityCommitmentsRequest, ListCapacityCommitmentsPagedResponse>
listCapacityCommitmentsPagedCallable() {
return listCapacityCommitmentsPagedCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.google.cloud.bigquery.reservation.v1.BiReservation;
import com.google.cloud.bigquery.reservation.v1.CapacityCommitment;
import com.google.cloud.bigquery.reservation.v1.CreateAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.CreateCapacityCommitmentRequest;
import com.google.cloud.bigquery.reservation.v1.CreateReservationRequest;
import com.google.cloud.bigquery.reservation.v1.DeleteAssignmentRequest;
import com.google.cloud.bigquery.reservation.v1.DeleteCapacityCommitmentRequest;
Expand Down Expand Up @@ -97,6 +98,11 @@ public UnaryCallable<UpdateReservationRequest, Reservation> updateReservationCal
throw new UnsupportedOperationException("Not implemented: updateReservationCallable()");
}

public UnaryCallable<CreateCapacityCommitmentRequest, CapacityCommitment>
createCapacityCommitmentCallable() {
throw new UnsupportedOperationException("Not implemented: createCapacityCommitmentCallable()");
}

public UnaryCallable<ListCapacityCommitmentsRequest, ListCapacityCommitmentsPagedResponse>
listCapacityCommitmentsPagedCallable() {
throw new UnsupportedOperationException(
Expand Down
Loading