Skip to content

Commit

Permalink
chore: generate libraries at Tue Nov 26 02:30:47 UTC 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-java-bot committed Nov 26, 2024
1 parent 2e664cc commit 9851a76
Show file tree
Hide file tree
Showing 40 changed files with 6,316 additions and 1,064 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.aiplatform.v1beta1;

import com.google.api.HttpBody;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
Expand All @@ -24,6 +25,7 @@
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1beta1.stub.ReasoningEngineExecutionServiceStub;
import com.google.cloud.aiplatform.v1beta1.stub.ReasoningEngineExecutionServiceStubSettings;
Expand Down Expand Up @@ -63,6 +65,7 @@
* ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
* .toString())
* .setInput(Struct.newBuilder().build())
* .setClassMethod("classMethod-937857927")
* .build();
* QueryReasoningEngineResponse response =
* reasoningEngineExecutionServiceClient.queryReasoningEngine(request);
Expand Down Expand Up @@ -95,6 +98,16 @@
* </td>
* </tr>
* <tr>
* <td><p> StreamQueryReasoningEngine</td>
* <td><p> Streams queries using a reasoning engine.</td>
* <td>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> streamQueryReasoningEngineCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> ListLocations</td>
* <td><p> Lists information about the supported locations for this service.</td>
* <td>
Expand Down Expand Up @@ -286,6 +299,7 @@ public ReasoningEngineExecutionServiceStub getStub() {
* ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
* .toString())
* .setInput(Struct.newBuilder().build())
* .setClassMethod("classMethod-937857927")
* .build();
* QueryReasoningEngineResponse response =
* reasoningEngineExecutionServiceClient.queryReasoningEngine(request);
Expand Down Expand Up @@ -320,6 +334,7 @@ public final QueryReasoningEngineResponse queryReasoningEngine(
* ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
* .toString())
* .setInput(Struct.newBuilder().build())
* .setClassMethod("classMethod-937857927")
* .build();
* ApiFuture<QueryReasoningEngineResponse> future =
* reasoningEngineExecutionServiceClient.queryReasoningEngineCallable().futureCall(request);
Expand All @@ -333,6 +348,41 @@ public final QueryReasoningEngineResponse queryReasoningEngine(
return stub.queryReasoningEngineCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Streams queries using a reasoning engine.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ReasoningEngineExecutionServiceClient reasoningEngineExecutionServiceClient =
* ReasoningEngineExecutionServiceClient.create()) {
* StreamQueryReasoningEngineRequest request =
* StreamQueryReasoningEngineRequest.newBuilder()
* .setName(
* ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
* .toString())
* .setInput(Struct.newBuilder().build())
* .setClassMethod("classMethod-937857927")
* .build();
* ServerStream<HttpBody> stream =
* reasoningEngineExecutionServiceClient.streamQueryReasoningEngineCallable().call(request);
* for (HttpBody response : stream) {
* // Do something when a response is received.
* }
* }
* }</pre>
*/
public final ServerStreamingCallable<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineCallable() {
return stub.streamQueryReasoningEngineCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionServiceClient.ListLocationsPagedResponse;

import com.google.api.HttpBody;
import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
Expand All @@ -27,6 +28,7 @@
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.ServerStreamingCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.aiplatform.v1beta1.stub.ReasoningEngineExecutionServiceStubSettings;
Expand Down Expand Up @@ -106,6 +108,13 @@ public class ReasoningEngineExecutionServiceSettings
.queryReasoningEngineSettings();
}

/** Returns the object with the settings used for calls to streamQueryReasoningEngine. */
public ServerStreamingCallSettings<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineSettings() {
return ((ReasoningEngineExecutionServiceStubSettings) getStubSettings())
.streamQueryReasoningEngineSettings();
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -238,6 +247,12 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().queryReasoningEngineSettings();
}

/** Returns the builder for the settings used for calls to streamQueryReasoningEngine. */
public ServerStreamingCallSettings.Builder<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineSettings() {
return getStubSettingsBuilder().streamQueryReasoningEngineSettings();
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public final ListReasoningEnginesPagedResponse listReasoningEngines(
* }</pre>
*
* @param reasoningEngine Required. The ReasoningEngine which replaces the resource on the server.
* @param updateMask Required. Mask specifying which fields to update.
* @param updateMask Optional. Mask specifying which fields to update.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<ReasoningEngine, UpdateReasoningEngineOperationMetadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,9 @@
"SetIamPolicy": {
"methods": ["setIamPolicy", "setIamPolicyCallable"]
},
"StreamQueryReasoningEngine": {
"methods": ["streamQueryReasoningEngineCallable"]
},
"TestIamPermissions": {
"methods": ["testIamPermissions", "testIamPermissionsCallable"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@
* ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
* .toString())
* .setInput(Struct.newBuilder().build())
* .setClassMethod("classMethod-937857927")
* .build();
* QueryReasoningEngineResponse response =
* reasoningEngineExecutionServiceClient.queryReasoningEngine(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@

import static com.google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionServiceClient.ListLocationsPagedResponse;

import com.google.api.HttpBody;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1beta1.QueryReasoningEngineRequest;
import com.google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse;
import com.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
Expand Down Expand Up @@ -65,6 +68,17 @@ public class GrpcReasoningEngineExecutionServiceStub extends ReasoningEngineExec
ProtoUtils.marshaller(QueryReasoningEngineResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineMethodDescriptor =
MethodDescriptor.<StreamQueryReasoningEngineRequest, HttpBody>newBuilder()
.setType(MethodDescriptor.MethodType.SERVER_STREAMING)
.setFullMethodName(
"google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService/StreamQueryReasoningEngine")
.setRequestMarshaller(
ProtoUtils.marshaller(StreamQueryReasoningEngineRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(HttpBody.getDefaultInstance()))
.build();

private static final MethodDescriptor<ListLocationsRequest, ListLocationsResponse>
listLocationsMethodDescriptor =
MethodDescriptor.<ListLocationsRequest, ListLocationsResponse>newBuilder()
Expand Down Expand Up @@ -113,6 +127,8 @@ public class GrpcReasoningEngineExecutionServiceStub extends ReasoningEngineExec

private final UnaryCallable<QueryReasoningEngineRequest, QueryReasoningEngineResponse>
queryReasoningEngineCallable;
private final ServerStreamingCallable<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineCallable;
private final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable;
private final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable;
Expand Down Expand Up @@ -180,6 +196,17 @@ protected GrpcReasoningEngineExecutionServiceStub(
return builder.build();
})
.build();
GrpcCallSettings<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineTransportSettings =
GrpcCallSettings.<StreamQueryReasoningEngineRequest, HttpBody>newBuilder()
.setMethodDescriptor(streamQueryReasoningEngineMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
GrpcCallSettings<ListLocationsRequest, ListLocationsResponse> listLocationsTransportSettings =
GrpcCallSettings.<ListLocationsRequest, ListLocationsResponse>newBuilder()
.setMethodDescriptor(listLocationsMethodDescriptor)
Expand Down Expand Up @@ -237,6 +264,11 @@ protected GrpcReasoningEngineExecutionServiceStub(
queryReasoningEngineTransportSettings,
settings.queryReasoningEngineSettings(),
clientContext);
this.streamQueryReasoningEngineCallable =
callableFactory.createServerStreamingCallable(
streamQueryReasoningEngineTransportSettings,
settings.streamQueryReasoningEngineSettings(),
clientContext);
this.listLocationsCallable =
callableFactory.createUnaryCallable(
listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
Expand Down Expand Up @@ -272,6 +304,12 @@ public GrpcOperationsStub getOperationsStub() {
return queryReasoningEngineCallable;
}

@Override
public ServerStreamingCallable<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineCallable() {
return streamQueryReasoningEngineCallable;
}

@Override
public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
return listLocationsCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@

import static com.google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionServiceClient.ListLocationsPagedResponse;

import com.google.api.HttpBody;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.ServerStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1beta1.QueryReasoningEngineRequest;
import com.google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse;
import com.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
Expand All @@ -49,6 +52,12 @@ public abstract class ReasoningEngineExecutionServiceStub implements BackgroundR
throw new UnsupportedOperationException("Not implemented: queryReasoningEngineCallable()");
}

public ServerStreamingCallable<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineCallable() {
throw new UnsupportedOperationException(
"Not implemented: streamQueryReasoningEngineCallable()");
}

public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable() {
throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionServiceClient.ListLocationsPagedResponse;

import com.google.api.HttpBody;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
Expand All @@ -36,13 +37,15 @@
import com.google.api.gax.rpc.PagedCallSettings;
import com.google.api.gax.rpc.PagedListDescriptor;
import com.google.api.gax.rpc.PagedListResponseFactory;
import com.google.api.gax.rpc.ServerStreamingCallSettings;
import com.google.api.gax.rpc.StatusCode;
import com.google.api.gax.rpc.StubSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.aiplatform.v1beta1.QueryReasoningEngineRequest;
import com.google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse;
import com.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest;
import com.google.cloud.location.GetLocationRequest;
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
Expand Down Expand Up @@ -122,6 +125,8 @@ public class ReasoningEngineExecutionServiceStubSettings

private final UnaryCallSettings<QueryReasoningEngineRequest, QueryReasoningEngineResponse>
queryReasoningEngineSettings;
private final ServerStreamingCallSettings<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineSettings;
private final PagedCallSettings<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings;
Expand Down Expand Up @@ -188,6 +193,12 @@ public ApiFuture<ListLocationsPagedResponse> getFuturePagedResponse(
return queryReasoningEngineSettings;
}

/** Returns the object with the settings used for calls to streamQueryReasoningEngine. */
public ServerStreamingCallSettings<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineSettings() {
return streamQueryReasoningEngineSettings;
}

/** Returns the object with the settings used for calls to listLocations. */
public PagedCallSettings<ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings() {
Expand Down Expand Up @@ -299,6 +310,8 @@ protected ReasoningEngineExecutionServiceStubSettings(Builder settingsBuilder)
super(settingsBuilder);

queryReasoningEngineSettings = settingsBuilder.queryReasoningEngineSettings().build();
streamQueryReasoningEngineSettings =
settingsBuilder.streamQueryReasoningEngineSettings().build();
listLocationsSettings = settingsBuilder.listLocationsSettings().build();
getLocationSettings = settingsBuilder.getLocationSettings().build();
setIamPolicySettings = settingsBuilder.setIamPolicySettings().build();
Expand All @@ -313,6 +326,8 @@ public static class Builder
private final UnaryCallSettings.Builder<
QueryReasoningEngineRequest, QueryReasoningEngineResponse>
queryReasoningEngineSettings;
private final ServerStreamingCallSettings.Builder<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineSettings;
private final PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
listLocationsSettings;
Expand Down Expand Up @@ -349,6 +364,7 @@ protected Builder(ClientContext clientContext) {
super(clientContext);

queryReasoningEngineSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
streamQueryReasoningEngineSettings = ServerStreamingCallSettings.newBuilder();
listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
Expand All @@ -370,6 +386,7 @@ protected Builder(ReasoningEngineExecutionServiceStubSettings settings) {
super(settings);

queryReasoningEngineSettings = settings.queryReasoningEngineSettings.toBuilder();
streamQueryReasoningEngineSettings = settings.streamQueryReasoningEngineSettings.toBuilder();
listLocationsSettings = settings.listLocationsSettings.toBuilder();
getLocationSettings = settings.getLocationSettings.toBuilder();
setIamPolicySettings = settings.setIamPolicySettings.toBuilder();
Expand Down Expand Up @@ -404,6 +421,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

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

builder
.listLocationsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
Expand Down Expand Up @@ -453,6 +475,12 @@ public Builder applyToAllUnaryMethods(
return queryReasoningEngineSettings;
}

/** Returns the builder for the settings used for calls to streamQueryReasoningEngine. */
public ServerStreamingCallSettings.Builder<StreamQueryReasoningEngineRequest, HttpBody>
streamQueryReasoningEngineSettings() {
return streamQueryReasoningEngineSettings;
}

/** Returns the builder for the settings used for calls to listLocations. */
public PagedCallSettings.Builder<
ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
Expand Down
Loading

0 comments on commit 9851a76

Please sign in to comment.