diff --git a/generation_config.yaml b/generation_config.yaml index 8c63eb11a9d7..2b24dfcf59b8 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,5 +1,5 @@ gapic_generator_version: 2.67.0 -googleapis_commitish: dc505966accc82576fc1ebed3d7924fe9df4ab49 +googleapis_commitish: c662840a94dbdf708caa44893a2d49119cdd391c libraries_bom_version: 26.76.0 libraries: - api_shortname: accessapproval diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceClient.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceClient.java new file mode 100644 index 000000000000..1eeaea5fab1e --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceClient.java @@ -0,0 +1,2004 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1.stub.SessionServiceStub; +import com.google.cloud.aiplatform.v1.stub.SessionServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: The service that manages Vertex Session related resources. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ *   SessionName name =
+ *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+ *   Session response = sessionServiceClient.getSession(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SessionServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateSession

Creates a new [Session][google.cloud.aiplatform.v1.Session].

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSessionAsync(CreateSessionRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createSessionAsync(ReasoningEngineName parent, Session session) + *

  • createSessionAsync(String parent, Session session) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSessionOperationCallable() + *

  • createSessionCallable() + *

+ *

GetSession

Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSession(GetSessionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSession(SessionName name) + *

  • getSession(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSessionCallable() + *

+ *

ListSessions

Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning engine.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSessions(ListSessionsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSessions(ReasoningEngineName parent) + *

  • listSessions(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSessionsPagedCallable() + *

  • listSessionsCallable() + *

+ *

UpdateSession

Updates the specific [Session][google.cloud.aiplatform.v1.Session].

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSession(UpdateSessionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateSession(Session session, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSessionCallable() + *

+ *

DeleteSession

Deletes details of the specific [Session][google.cloud.aiplatform.v1.Session].

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSessionAsync(DeleteSessionRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deleteSessionAsync(SessionName name) + *

  • deleteSessionAsync(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSessionOperationCallable() + *

  • deleteSessionCallable() + *

+ *

ListEvents

Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listEvents(ListEventsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listEvents(SessionName parent) + *

  • listEvents(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listEventsPagedCallable() + *

  • listEventsCallable() + *

+ *

AppendEvent

Appends an event to a given session.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • appendEvent(AppendEventRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • appendEvent(SessionName name, SessionEvent event) + *

  • appendEvent(String name, SessionEvent event) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • appendEventCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SessionServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@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
+ * SessionServiceSettings sessionServiceSettings =
+ *     SessionServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SessionServiceClient sessionServiceClient = SessionServiceClient.create(sessionServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@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
+ * SessionServiceSettings sessionServiceSettings =
+ *     SessionServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SessionServiceClient sessionServiceClient = SessionServiceClient.create(sessionServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class SessionServiceClient implements BackgroundResource { + private final SessionServiceSettings settings; + private final SessionServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of SessionServiceClient with default settings. */ + public static final SessionServiceClient create() throws IOException { + return create(SessionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SessionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SessionServiceClient create(SessionServiceSettings settings) + throws IOException { + return new SessionServiceClient(settings); + } + + /** + * Constructs an instance of SessionServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(SessionServiceSettings). + */ + public static final SessionServiceClient create(SessionServiceStub stub) { + return new SessionServiceClient(stub); + } + + /** + * Constructs an instance of SessionServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected SessionServiceClient(SessionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SessionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected SessionServiceClient(SessionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final SessionServiceSettings getSettings() { + return settings; + } + + public SessionServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ReasoningEngineName parent =
+   *       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
+   *   Session session = Session.newBuilder().build();
+   *   Session response = sessionServiceClient.createSessionAsync(parent, session).get();
+   * }
+   * }
+ * + * @param parent Required. The resource name of the location to create the session in. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param session Required. The session to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSessionAsync( + ReasoningEngineName parent, Session session) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSession(session) + .build(); + return createSessionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   String parent =
+   *       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString();
+   *   Session session = Session.newBuilder().build();
+   *   Session response = sessionServiceClient.createSessionAsync(parent, session).get();
+   * }
+   * }
+ * + * @param parent Required. The resource name of the location to create the session in. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param session Required. The session to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createSessionAsync( + String parent, Session session) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder().setParent(parent).setSession(session).build(); + return createSessionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   CreateSessionRequest request =
+   *       CreateSessionRequest.newBuilder()
+   *           .setParent(
+   *               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
+   *                   .toString())
+   *           .setSession(Session.newBuilder().build())
+   *           .build();
+   *   Session response = sessionServiceClient.createSessionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture createSessionAsync( + CreateSessionRequest request) { + return createSessionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   CreateSessionRequest request =
+   *       CreateSessionRequest.newBuilder()
+   *           .setParent(
+   *               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
+   *                   .toString())
+   *           .setSession(Session.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       sessionServiceClient.createSessionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Session response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createSessionOperationCallable() { + return stub.createSessionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   CreateSessionRequest request =
+   *       CreateSessionRequest.newBuilder()
+   *           .setParent(
+   *               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
+   *                   .toString())
+   *           .setSession(Session.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.createSessionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSessionCallable() { + return stub.createSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   SessionName name =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+   *   Session response = sessionServiceClient.getSession(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the session. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Session getSession(SessionName name) { + GetSessionRequest request = + GetSessionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSession(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   String name =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString();
+   *   Session response = sessionServiceClient.getSession(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the session. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Session getSession(String name) { + GetSessionRequest request = GetSessionRequest.newBuilder().setName(name).build(); + return getSession(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   GetSessionRequest request =
+   *       GetSessionRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .build();
+   *   Session response = sessionServiceClient.getSession(request);
+   * }
+   * }
+ * + * @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 Session getSession(GetSessionRequest request) { + return getSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   GetSessionRequest request =
+   *       GetSessionRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = sessionServiceClient.getSessionCallable().futureCall(request);
+   *   // Do something.
+   *   Session response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSessionCallable() { + return stub.getSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning engine. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ReasoningEngineName parent =
+   *       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
+   *   for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the location to list sessions from. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSessionsPagedResponse listSessions(ReasoningEngineName parent) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listSessions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning engine. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   String parent =
+   *       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString();
+   *   for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the location to list sessions from. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSessionsPagedResponse listSessions(String parent) { + ListSessionsRequest request = ListSessionsRequest.newBuilder().setParent(parent).build(); + return listSessions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning engine. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListSessionsRequest request =
+   *       ListSessionsRequest.newBuilder()
+   *           .setParent(
+   *               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Session element : sessionServiceClient.listSessions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListSessionsPagedResponse listSessions(ListSessionsRequest request) { + return listSessionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning engine. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListSessionsRequest request =
+   *       ListSessionsRequest.newBuilder()
+   *           .setParent(
+   *               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.listSessionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Session element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listSessionsPagedCallable() { + return stub.listSessionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning engine. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListSessionsRequest request =
+   *       ListSessionsRequest.newBuilder()
+   *           .setParent(
+   *               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListSessionsResponse response = sessionServiceClient.listSessionsCallable().call(request);
+   *     for (Session element : response.getSessionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSessionsCallable() { + return stub.listSessionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   Session session = Session.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Session response = sessionServiceClient.updateSession(session, updateMask);
+   * }
+   * }
+ * + * @param session Required. The session to update. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @param updateMask Optional. Field mask is used to control which fields get updated. If the mask + * is not present, all fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Session updateSession(Session session, FieldMask updateMask) { + UpdateSessionRequest request = + UpdateSessionRequest.newBuilder().setSession(session).setUpdateMask(updateMask).build(); + return updateSession(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   UpdateSessionRequest request =
+   *       UpdateSessionRequest.newBuilder()
+   *           .setSession(Session.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Session response = sessionServiceClient.updateSession(request);
+   * }
+   * }
+ * + * @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 Session updateSession(UpdateSessionRequest request) { + return updateSessionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   UpdateSessionRequest request =
+   *       UpdateSessionRequest.newBuilder()
+   *           .setSession(Session.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sessionServiceClient.updateSessionCallable().futureCall(request);
+   *   // Do something.
+   *   Session response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSessionCallable() { + return stub.updateSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   SessionName name =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+   *   sessionServiceClient.deleteSessionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the session. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSessionAsync( + SessionName name) { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteSessionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   String name =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString();
+   *   sessionServiceClient.deleteSessionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the session. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteSessionAsync(String name) { + DeleteSessionRequest request = DeleteSessionRequest.newBuilder().setName(name).build(); + return deleteSessionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   DeleteSessionRequest request =
+   *       DeleteSessionRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .build();
+   *   sessionServiceClient.deleteSessionAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture deleteSessionAsync( + DeleteSessionRequest request) { + return deleteSessionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   DeleteSessionRequest request =
+   *       DeleteSessionRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       sessionServiceClient.deleteSessionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteSessionOperationCallable() { + return stub.deleteSessionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes details of the specific [Session][google.cloud.aiplatform.v1.Session]. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   DeleteSessionRequest request =
+   *       DeleteSessionRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.deleteSessionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSessionCallable() { + return stub.deleteSessionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   SessionName parent =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+   *   for (SessionEvent element : sessionServiceClient.listEvents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the session to list events from. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEventsPagedResponse listEvents(SessionName parent) { + ListEventsRequest request = + ListEventsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   String parent =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString();
+   *   for (SessionEvent element : sessionServiceClient.listEvents(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the session to list events from. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListEventsPagedResponse listEvents(String parent) { + ListEventsRequest request = ListEventsRequest.newBuilder().setParent(parent).build(); + return listEvents(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListEventsRequest request =
+   *       ListEventsRequest.newBuilder()
+   *           .setParent(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (SessionEvent element : sessionServiceClient.listEvents(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListEventsPagedResponse listEvents(ListEventsRequest request) { + return listEventsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListEventsRequest request =
+   *       ListEventsRequest.newBuilder()
+   *           .setParent(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.listEventsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (SessionEvent element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listEventsPagedCallable() { + return stub.listEventsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListEventsRequest request =
+   *       ListEventsRequest.newBuilder()
+   *           .setParent(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListEventsResponse response = sessionServiceClient.listEventsCallable().call(request);
+   *     for (SessionEvent element : response.getSessionEventsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listEventsCallable() { + return stub.listEventsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Appends an event to a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   SessionName name =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+   *   SessionEvent event = SessionEvent.newBuilder().build();
+   *   AppendEventResponse response = sessionServiceClient.appendEvent(name, event);
+   * }
+   * }
+ * + * @param name Required. The resource name of the session to append event to. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @param event Required. The event to append to the session. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppendEventResponse appendEvent(SessionName name, SessionEvent event) { + AppendEventRequest request = + AppendEventRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setEvent(event) + .build(); + return appendEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Appends an event to a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   String name =
+   *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString();
+   *   SessionEvent event = SessionEvent.newBuilder().build();
+   *   AppendEventResponse response = sessionServiceClient.appendEvent(name, event);
+   * }
+   * }
+ * + * @param name Required. The resource name of the session to append event to. Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + * @param event Required. The event to append to the session. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AppendEventResponse appendEvent(String name, SessionEvent event) { + AppendEventRequest request = + AppendEventRequest.newBuilder().setName(name).setEvent(event).build(); + return appendEvent(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Appends an event to a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   AppendEventRequest request =
+   *       AppendEventRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .setEvent(SessionEvent.newBuilder().build())
+   *           .build();
+   *   AppendEventResponse response = sessionServiceClient.appendEvent(request);
+   * }
+   * }
+ * + * @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 AppendEventResponse appendEvent(AppendEventRequest request) { + return appendEventCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Appends an event to a given session. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   AppendEventRequest request =
+   *       AppendEventRequest.newBuilder()
+   *           .setName(
+   *               SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]")
+   *                   .toString())
+   *           .setEvent(SessionEvent.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.appendEventCallable().futureCall(request);
+   *   // Do something.
+   *   AppendEventResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable appendEventCallable() { + return stub.appendEventCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : sessionServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = sessionServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = sessionServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @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 Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = sessionServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = sessionServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sessionServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = sessionServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sessionServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = sessionServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

Note: This operation is designed to be used for buildingpermission-aware UIs and + * command-line tools, not for authorizationchecking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               EndpointName.ofProjectLocationEndpointName(
+   *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       sessionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListSessionsPagedResponse + extends AbstractPagedListResponse< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSessionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListSessionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListSessionsPagedResponse(ListSessionsPage page) { + super(page, ListSessionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSessionsPage + extends AbstractPage { + + private ListSessionsPage( + PageContext context, + ListSessionsResponse response) { + super(context, response); + } + + private static ListSessionsPage createEmptyPage() { + return new ListSessionsPage(null, null); + } + + @Override + protected ListSessionsPage createPage( + PageContext context, + ListSessionsResponse response) { + return new ListSessionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSessionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSessionsRequest, + ListSessionsResponse, + Session, + ListSessionsPage, + ListSessionsFixedSizeCollection> { + + private ListSessionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSessionsFixedSizeCollection createEmptyCollection() { + return new ListSessionsFixedSizeCollection(null, 0); + } + + @Override + protected ListSessionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSessionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListEventsPagedResponse + extends AbstractPagedListResponse< + ListEventsRequest, + ListEventsResponse, + SessionEvent, + ListEventsPage, + ListEventsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListEventsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListEventsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListEventsPagedResponse(ListEventsPage page) { + super(page, ListEventsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListEventsPage + extends AbstractPage { + + private ListEventsPage( + PageContext context, + ListEventsResponse response) { + super(context, response); + } + + private static ListEventsPage createEmptyPage() { + return new ListEventsPage(null, null); + } + + @Override + protected ListEventsPage createPage( + PageContext context, + ListEventsResponse response) { + return new ListEventsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListEventsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListEventsRequest, + ListEventsResponse, + SessionEvent, + ListEventsPage, + ListEventsFixedSizeCollection> { + + private ListEventsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListEventsFixedSizeCollection createEmptyCollection() { + return new ListEventsFixedSizeCollection(null, 0); + } + + @Override + protected ListEventsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListEventsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceSettings.java new file mode 100644 index 000000000000..425f90fa7687 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceSettings.java @@ -0,0 +1,386 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListEventsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListSessionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.aiplatform.v1.stub.SessionServiceStubSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SessionServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (aiplatform.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getSession: + * + *

{@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
+ * SessionServiceSettings.Builder sessionServiceSettingsBuilder =
+ *     SessionServiceSettings.newBuilder();
+ * sessionServiceSettingsBuilder
+ *     .getSessionSettings()
+ *     .setRetrySettings(
+ *         sessionServiceSettingsBuilder
+ *             .getSessionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * SessionServiceSettings sessionServiceSettings = sessionServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createSession: + * + *

{@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
+ * SessionServiceSettings.Builder sessionServiceSettingsBuilder =
+ *     SessionServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * sessionServiceSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SessionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return ((SessionServiceStubSettings) getStubSettings()).createSessionSettings(); + } + + /** Returns the object with the settings used for calls to createSession. */ + public OperationCallSettings + createSessionOperationSettings() { + return ((SessionServiceStubSettings) getStubSettings()).createSessionOperationSettings(); + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return ((SessionServiceStubSettings) getStubSettings()).getSessionSettings(); + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return ((SessionServiceStubSettings) getStubSettings()).listSessionsSettings(); + } + + /** Returns the object with the settings used for calls to updateSession. */ + public UnaryCallSettings updateSessionSettings() { + return ((SessionServiceStubSettings) getStubSettings()).updateSessionSettings(); + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return ((SessionServiceStubSettings) getStubSettings()).deleteSessionSettings(); + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public OperationCallSettings + deleteSessionOperationSettings() { + return ((SessionServiceStubSettings) getStubSettings()).deleteSessionOperationSettings(); + } + + /** Returns the object with the settings used for calls to listEvents. */ + public PagedCallSettings + listEventsSettings() { + return ((SessionServiceStubSettings) getStubSettings()).listEventsSettings(); + } + + /** Returns the object with the settings used for calls to appendEvent. */ + public UnaryCallSettings appendEventSettings() { + return ((SessionServiceStubSettings) getStubSettings()).appendEventSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((SessionServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((SessionServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SessionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SessionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SessionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final SessionServiceSettings create(SessionServiceStubSettings stub) + throws IOException { + return new SessionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SessionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SessionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SessionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SessionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SessionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SessionServiceStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SessionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SessionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SessionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SessionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(SessionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SessionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SessionServiceStubSettings.newBuilder()); + } + + public SessionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((SessionServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return getStubSettingsBuilder().createSessionSettings(); + } + + /** Returns the builder for the settings used for calls to createSession. */ + public OperationCallSettings.Builder< + CreateSessionRequest, Session, CreateSessionOperationMetadata> + createSessionOperationSettings() { + return getStubSettingsBuilder().createSessionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getStubSettingsBuilder().getSessionSettings(); + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return getStubSettingsBuilder().listSessionsSettings(); + } + + /** Returns the builder for the settings used for calls to updateSession. */ + public UnaryCallSettings.Builder updateSessionSettings() { + return getStubSettingsBuilder().updateSessionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return getStubSettingsBuilder().deleteSessionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public OperationCallSettings.Builder + deleteSessionOperationSettings() { + return getStubSettingsBuilder().deleteSessionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listEvents. */ + public PagedCallSettings.Builder + listEventsSettings() { + return getStubSettingsBuilder().listEventsSettings(); + } + + /** Returns the builder for the settings used for calls to appendEvent. */ + public UnaryCallSettings.Builder + appendEventSettings() { + return getStubSettingsBuilder().appendEventSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public SessionServiceSettings build() throws IOException { + return new SessionServiceSettings(this); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json index 61effbb3c642..1e0b9277f14b 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/gapic_metadata.json @@ -1484,6 +1484,51 @@ } } }, + "SessionService": { + "clients": { + "grpc": { + "libraryClient": "SessionServiceClient", + "rpcs": { + "AppendEvent": { + "methods": ["appendEvent", "appendEvent", "appendEvent", "appendEventCallable"] + }, + "CreateSession": { + "methods": ["createSessionAsync", "createSessionAsync", "createSessionAsync", "createSessionOperationCallable", "createSessionCallable"] + }, + "DeleteSession": { + "methods": ["deleteSessionAsync", "deleteSessionAsync", "deleteSessionAsync", "deleteSessionOperationCallable", "deleteSessionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSession": { + "methods": ["getSession", "getSession", "getSession", "getSessionCallable"] + }, + "ListEvents": { + "methods": ["listEvents", "listEvents", "listEvents", "listEventsPagedCallable", "listEventsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSessions": { + "methods": ["listSessions", "listSessions", "listSessions", "listSessionsPagedCallable", "listSessionsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateSession": { + "methods": ["updateSession", "updateSession", "updateSessionCallable"] + } + } + } + } + }, "SpecialistPoolService": { "clients": { "grpc": { diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java index dacb5d320767..b0a311800021 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/package-info.java @@ -587,6 +587,25 @@ * } * } * + *

======================= SessionServiceClient ======================= + * + *

Service Description: The service that manages Vertex Session related resources. + * + *

Sample for SessionServiceClient: + * + *

{@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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) {
+ *   SessionName name =
+ *       SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]");
+ *   Session response = sessionServiceClient.getSession(name);
+ * }
+ * }
+ * *

======================= SpecialistPoolServiceClient ======================= * *

Service Description: A service for creating and managing Customer SpecialistPools. When diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcSessionServiceCallableFactory.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcSessionServiceCallableFactory.java new file mode 100644 index 000000000000..7cf27919536a --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcSessionServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the SessionService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcSessionServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcSessionServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcSessionServiceStub.java new file mode 100644 index 000000000000..b6a5449cd9b6 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/GrpcSessionServiceStub.java @@ -0,0 +1,576 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListEventsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListSessionsPagedResponse; + +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.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1.AppendEventRequest; +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata; +import com.google.cloud.aiplatform.v1.CreateSessionRequest; +import com.google.cloud.aiplatform.v1.DeleteOperationMetadata; +import com.google.cloud.aiplatform.v1.DeleteSessionRequest; +import com.google.cloud.aiplatform.v1.GetSessionRequest; +import com.google.cloud.aiplatform.v1.ListEventsRequest; +import com.google.cloud.aiplatform.v1.ListEventsResponse; +import com.google.cloud.aiplatform.v1.ListSessionsRequest; +import com.google.cloud.aiplatform.v1.ListSessionsResponse; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.UpdateSessionRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the SessionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcSessionServiceStub extends SessionServiceStub { + private static final MethodDescriptor + createSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/CreateSession") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/GetSession") + .setRequestMarshaller(ProtoUtils.marshaller(GetSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSessionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/ListSessions") + .setRequestMarshaller(ProtoUtils.marshaller(ListSessionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListSessionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/UpdateSession") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Session.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteSessionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/DeleteSession") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteSessionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listEventsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/ListEvents") + .setRequestMarshaller(ProtoUtils.marshaller(ListEventsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListEventsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + appendEventMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.aiplatform.v1.SessionService/AppendEvent") + .setRequestMarshaller(ProtoUtils.marshaller(AppendEventRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AppendEventResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSessionCallable; + private final OperationCallable + createSessionOperationCallable; + private final UnaryCallable getSessionCallable; + private final UnaryCallable listSessionsCallable; + private final UnaryCallable + listSessionsPagedCallable; + private final UnaryCallable updateSessionCallable; + private final UnaryCallable deleteSessionCallable; + private final OperationCallable + deleteSessionOperationCallable; + private final UnaryCallable listEventsCallable; + private final UnaryCallable listEventsPagedCallable; + private final UnaryCallable appendEventCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSessionServiceStub create(SessionServiceStubSettings settings) + throws IOException { + return new GrpcSessionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSessionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcSessionServiceStub( + SessionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSessionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSessionServiceStub( + SessionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSessionServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcSessionServiceStub(SessionServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSessionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcSessionServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcSessionServiceStub( + SessionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSessionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("session.name", String.valueOf(request.getSession().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listEventsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listEventsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings appendEventTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(appendEventMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSessionCallable = + callableFactory.createUnaryCallable( + createSessionTransportSettings, settings.createSessionSettings(), clientContext); + this.createSessionOperationCallable = + callableFactory.createOperationCallable( + createSessionTransportSettings, + settings.createSessionOperationSettings(), + clientContext, + operationsStub); + this.getSessionCallable = + callableFactory.createUnaryCallable( + getSessionTransportSettings, settings.getSessionSettings(), clientContext); + this.listSessionsCallable = + callableFactory.createUnaryCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.listSessionsPagedCallable = + callableFactory.createPagedCallable( + listSessionsTransportSettings, settings.listSessionsSettings(), clientContext); + this.updateSessionCallable = + callableFactory.createUnaryCallable( + updateSessionTransportSettings, settings.updateSessionSettings(), clientContext); + this.deleteSessionCallable = + callableFactory.createUnaryCallable( + deleteSessionTransportSettings, settings.deleteSessionSettings(), clientContext); + this.deleteSessionOperationCallable = + callableFactory.createOperationCallable( + deleteSessionTransportSettings, + settings.deleteSessionOperationSettings(), + clientContext, + operationsStub); + this.listEventsCallable = + callableFactory.createUnaryCallable( + listEventsTransportSettings, settings.listEventsSettings(), clientContext); + this.listEventsPagedCallable = + callableFactory.createPagedCallable( + listEventsTransportSettings, settings.listEventsSettings(), clientContext); + this.appendEventCallable = + callableFactory.createUnaryCallable( + appendEventTransportSettings, settings.appendEventSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSessionCallable() { + return createSessionCallable; + } + + @Override + public OperationCallable + createSessionOperationCallable() { + return createSessionOperationCallable; + } + + @Override + public UnaryCallable getSessionCallable() { + return getSessionCallable; + } + + @Override + public UnaryCallable listSessionsCallable() { + return listSessionsCallable; + } + + @Override + public UnaryCallable listSessionsPagedCallable() { + return listSessionsPagedCallable; + } + + @Override + public UnaryCallable updateSessionCallable() { + return updateSessionCallable; + } + + @Override + public UnaryCallable deleteSessionCallable() { + return deleteSessionCallable; + } + + @Override + public OperationCallable + deleteSessionOperationCallable() { + return deleteSessionOperationCallable; + } + + @Override + public UnaryCallable listEventsCallable() { + return listEventsCallable; + } + + @Override + public UnaryCallable listEventsPagedCallable() { + return listEventsPagedCallable; + } + + @Override + public UnaryCallable appendEventCallable() { + return appendEventCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/SessionServiceStub.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/SessionServiceStub.java new file mode 100644 index 000000000000..f364faf56563 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/SessionServiceStub.java @@ -0,0 +1,140 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListEventsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListSessionsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.aiplatform.v1.AppendEventRequest; +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata; +import com.google.cloud.aiplatform.v1.CreateSessionRequest; +import com.google.cloud.aiplatform.v1.DeleteOperationMetadata; +import com.google.cloud.aiplatform.v1.DeleteSessionRequest; +import com.google.cloud.aiplatform.v1.GetSessionRequest; +import com.google.cloud.aiplatform.v1.ListEventsRequest; +import com.google.cloud.aiplatform.v1.ListEventsResponse; +import com.google.cloud.aiplatform.v1.ListSessionsRequest; +import com.google.cloud.aiplatform.v1.ListSessionsResponse; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.UpdateSessionRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the SessionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class SessionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public OperationCallable + createSessionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionOperationCallable()"); + } + + public UnaryCallable createSessionCallable() { + throw new UnsupportedOperationException("Not implemented: createSessionCallable()"); + } + + public UnaryCallable getSessionCallable() { + throw new UnsupportedOperationException("Not implemented: getSessionCallable()"); + } + + public UnaryCallable listSessionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsPagedCallable()"); + } + + public UnaryCallable listSessionsCallable() { + throw new UnsupportedOperationException("Not implemented: listSessionsCallable()"); + } + + public UnaryCallable updateSessionCallable() { + throw new UnsupportedOperationException("Not implemented: updateSessionCallable()"); + } + + public OperationCallable + deleteSessionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionOperationCallable()"); + } + + public UnaryCallable deleteSessionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSessionCallable()"); + } + + public UnaryCallable listEventsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listEventsPagedCallable()"); + } + + public UnaryCallable listEventsCallable() { + throw new UnsupportedOperationException("Not implemented: listEventsCallable()"); + } + + public UnaryCallable appendEventCallable() { + throw new UnsupportedOperationException("Not implemented: appendEventCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/SessionServiceStubSettings.java b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/SessionServiceStubSettings.java new file mode 100644 index 000000000000..95db1fde1449 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/stub/SessionServiceStubSettings.java @@ -0,0 +1,861 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub; + +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListEventsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListSessionsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +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.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.v1.AppendEventRequest; +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata; +import com.google.cloud.aiplatform.v1.CreateSessionRequest; +import com.google.cloud.aiplatform.v1.DeleteOperationMetadata; +import com.google.cloud.aiplatform.v1.DeleteSessionRequest; +import com.google.cloud.aiplatform.v1.GetSessionRequest; +import com.google.cloud.aiplatform.v1.ListEventsRequest; +import com.google.cloud.aiplatform.v1.ListEventsResponse; +import com.google.cloud.aiplatform.v1.ListSessionsRequest; +import com.google.cloud.aiplatform.v1.ListSessionsResponse; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.UpdateSessionRequest; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SessionServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (aiplatform.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getSession: + * + *

{@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
+ * SessionServiceStubSettings.Builder sessionServiceSettingsBuilder =
+ *     SessionServiceStubSettings.newBuilder();
+ * sessionServiceSettingsBuilder
+ *     .getSessionSettings()
+ *     .setRetrySettings(
+ *         sessionServiceSettingsBuilder
+ *             .getSessionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * SessionServiceStubSettings sessionServiceSettings = sessionServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting + * retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createSession: + * + *

{@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
+ * SessionServiceStubSettings.Builder sessionServiceSettingsBuilder =
+ *     SessionServiceStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * sessionServiceSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SessionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createSessionSettings; + private final OperationCallSettings + createSessionOperationSettings; + private final UnaryCallSettings getSessionSettings; + private final PagedCallSettings< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings updateSessionSettings; + private final UnaryCallSettings deleteSessionSettings; + private final OperationCallSettings + deleteSessionOperationSettings; + private final PagedCallSettings + listEventsSettings; + private final UnaryCallSettings appendEventSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_SESSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionsRequest injectToken(ListSessionsRequest payload, String token) { + return ListSessionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionsRequest injectPageSize(ListSessionsRequest payload, int pageSize) { + return ListSessionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSessionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSessionsResponse payload) { + return payload.getSessionsList(); + } + }; + + private static final PagedListDescriptor + LIST_EVENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEventsRequest injectToken(ListEventsRequest payload, String token) { + return ListEventsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEventsRequest injectPageSize(ListEventsRequest payload, int pageSize) { + return ListEventsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEventsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEventsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEventsResponse payload) { + return payload.getSessionEventsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + LIST_SESSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSessionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SESSIONS_PAGE_STR_DESC, request, context); + return ListSessionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListEventsRequest, ListEventsResponse, ListEventsPagedResponse> + LIST_EVENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEventsRequest, ListEventsResponse, ListEventsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEventsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_EVENTS_PAGE_STR_DESC, request, context); + return ListEventsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSession. */ + public UnaryCallSettings createSessionSettings() { + return createSessionSettings; + } + + /** Returns the object with the settings used for calls to createSession. */ + public OperationCallSettings + createSessionOperationSettings() { + return createSessionOperationSettings; + } + + /** Returns the object with the settings used for calls to getSession. */ + public UnaryCallSettings getSessionSettings() { + return getSessionSettings; + } + + /** Returns the object with the settings used for calls to listSessions. */ + public PagedCallSettings + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the object with the settings used for calls to updateSession. */ + public UnaryCallSettings updateSessionSettings() { + return updateSessionSettings; + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public UnaryCallSettings deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the object with the settings used for calls to deleteSession. */ + public OperationCallSettings + deleteSessionOperationSettings() { + return deleteSessionOperationSettings; + } + + /** Returns the object with the settings used for calls to listEvents. */ + public PagedCallSettings + listEventsSettings() { + return listEventsSettings; + } + + /** Returns the object with the settings used for calls to appendEvent. */ + public UnaryCallSettings appendEventSettings() { + return appendEventSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public SessionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSessionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "aiplatform"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "aiplatform.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "aiplatform.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SessionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SessionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createSessionSettings = settingsBuilder.createSessionSettings().build(); + createSessionOperationSettings = settingsBuilder.createSessionOperationSettings().build(); + getSessionSettings = settingsBuilder.getSessionSettings().build(); + listSessionsSettings = settingsBuilder.listSessionsSettings().build(); + updateSessionSettings = settingsBuilder.updateSessionSettings().build(); + deleteSessionSettings = settingsBuilder.deleteSessionSettings().build(); + deleteSessionOperationSettings = settingsBuilder.deleteSessionOperationSettings().build(); + listEventsSettings = settingsBuilder.listEventsSettings().build(); + appendEventSettings = settingsBuilder.appendEventSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for SessionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSessionSettings; + private final OperationCallSettings.Builder< + CreateSessionRequest, Session, CreateSessionOperationMetadata> + createSessionOperationSettings; + private final UnaryCallSettings.Builder getSessionSettings; + private final PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings; + private final UnaryCallSettings.Builder updateSessionSettings; + private final UnaryCallSettings.Builder deleteSessionSettings; + private final OperationCallSettings.Builder< + DeleteSessionRequest, Empty, DeleteOperationMetadata> + deleteSessionOperationSettings; + private final PagedCallSettings.Builder< + ListEventsRequest, ListEventsResponse, ListEventsPagedResponse> + listEventsSettings; + private final UnaryCallSettings.Builder + appendEventSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSessionOperationSettings = OperationCallSettings.newBuilder(); + getSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSessionsSettings = PagedCallSettings.newBuilder(LIST_SESSIONS_PAGE_STR_FACT); + updateSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSessionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSessionOperationSettings = OperationCallSettings.newBuilder(); + listEventsSettings = PagedCallSettings.newBuilder(LIST_EVENTS_PAGE_STR_FACT); + appendEventSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + updateSessionSettings, + deleteSessionSettings, + listEventsSettings, + appendEventSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(SessionServiceStubSettings settings) { + super(settings); + + createSessionSettings = settings.createSessionSettings.toBuilder(); + createSessionOperationSettings = settings.createSessionOperationSettings.toBuilder(); + getSessionSettings = settings.getSessionSettings.toBuilder(); + listSessionsSettings = settings.listSessionsSettings.toBuilder(); + updateSessionSettings = settings.updateSessionSettings.toBuilder(); + deleteSessionSettings = settings.deleteSessionSettings.toBuilder(); + deleteSessionOperationSettings = settings.deleteSessionOperationSettings.toBuilder(); + listEventsSettings = settings.listEventsSettings.toBuilder(); + appendEventSettings = settings.appendEventSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + updateSessionSettings, + deleteSessionSettings, + listEventsSettings, + appendEventSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSessionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteSessionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listEventsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .appendEventSettings() + .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")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createSessionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Session.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + CreateSessionOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteSessionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(DeleteOperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createSession. */ + public UnaryCallSettings.Builder createSessionSettings() { + return createSessionSettings; + } + + /** Returns the builder for the settings used for calls to createSession. */ + public OperationCallSettings.Builder< + CreateSessionRequest, Session, CreateSessionOperationMetadata> + createSessionOperationSettings() { + return createSessionOperationSettings; + } + + /** Returns the builder for the settings used for calls to getSession. */ + public UnaryCallSettings.Builder getSessionSettings() { + return getSessionSettings; + } + + /** Returns the builder for the settings used for calls to listSessions. */ + public PagedCallSettings.Builder< + ListSessionsRequest, ListSessionsResponse, ListSessionsPagedResponse> + listSessionsSettings() { + return listSessionsSettings; + } + + /** Returns the builder for the settings used for calls to updateSession. */ + public UnaryCallSettings.Builder updateSessionSettings() { + return updateSessionSettings; + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public UnaryCallSettings.Builder deleteSessionSettings() { + return deleteSessionSettings; + } + + /** Returns the builder for the settings used for calls to deleteSession. */ + public OperationCallSettings.Builder + deleteSessionOperationSettings() { + return deleteSessionOperationSettings; + } + + /** Returns the builder for the settings used for calls to listEvents. */ + public PagedCallSettings.Builder + listEventsSettings() { + return listEventsSettings; + } + + /** Returns the builder for the settings used for calls to appendEvent. */ + public UnaryCallSettings.Builder + appendEventSettings() { + return appendEventSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public SessionServiceStubSettings build() throws IOException { + return new SessionServiceStubSettings(this); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1/reflect-config.json b/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1/reflect-config.json index e081a2f2d13b..215c8a60cf98 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1/reflect-config.json +++ b/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1/reflect-config.json @@ -656,6 +656,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.AppendEventRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.AppendEventRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.AppendEventResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.AppendEventResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.Artifact", "queryAllDeclaredConstructors": true, @@ -3383,6 +3419,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.CreateSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.CreateSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata", "queryAllDeclaredConstructors": true, @@ -4553,6 +4625,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.DeleteSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.DeleteSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest", "queryAllDeclaredConstructors": true, @@ -5588,6 +5678,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.EventActions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.EventActions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.EventMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.EventMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.ExactMatchInput", "queryAllDeclaredConstructors": true, @@ -9053,6 +9179,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.GetSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.GetSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.GetSpecialistPoolRequest", "queryAllDeclaredConstructors": true, @@ -10637,6 +10781,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.ListEventsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ListEventsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ListEventsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ListEventsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.ListExecutionsRequest", "queryAllDeclaredConstructors": true, @@ -11753,6 +11933,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.ListSessionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ListSessionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ListSessionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ListSessionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest", "queryAllDeclaredConstructors": true, @@ -17216,6 +17432,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.ReasoningEngineSpec$SourceCodeSpec$ImageSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.ReasoningEngineSpec$SourceCodeSpec$ImageSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.ReasoningEngineSpec$SourceCodeSpec$InlineSource", "queryAllDeclaredConstructors": true, @@ -18476,6 +18710,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.Session", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.Session$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.SessionEvent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.SessionEvent$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.SharePointSources", "queryAllDeclaredConstructors": true, @@ -20735,6 +21005,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.Transcription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.Transcription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.Trial", "queryAllDeclaredConstructors": true, @@ -21761,6 +22049,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1.UpdateSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1.UpdateSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata", "queryAllDeclaredConstructors": true, diff --git a/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1beta1/reflect-config.json b/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1beta1/reflect-config.json index d9c7c0513fa8..3637bfd12364 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1beta1/reflect-config.json +++ b/java-aiplatform/google-cloud-aiplatform/src/main/resources/META-INF/native-image/com.google.cloud.aiplatform.v1beta1/reflect-config.json @@ -21464,6 +21464,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec$SourceCodeSpec$ImageSpec", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec$SourceCodeSpec$ImageSpec$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec$SourceCodeSpec$InlineSource", "queryAllDeclaredConstructors": true, @@ -26369,6 +26387,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.aiplatform.v1beta1.Transcription", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.aiplatform.v1beta1.Transcription$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.aiplatform.v1beta1.Trial", "queryAllDeclaredConstructors": true, diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockSessionService.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockSessionService.java new file mode 100644 index 000000000000..89fe131d762e --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockSessionService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSessionService implements MockGrpcService { + private final MockSessionServiceImpl serviceImpl; + + public MockSessionService() { + serviceImpl = new MockSessionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockSessionServiceImpl.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockSessionServiceImpl.java new file mode 100644 index 000000000000..d4ca14fd3471 --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/MockSessionServiceImpl.java @@ -0,0 +1,207 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.aiplatform.v1.SessionServiceGrpc.SessionServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSessionServiceImpl extends SessionServiceImplBase { + private List requests; + private Queue responses; + + public MockSessionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createSession( + CreateSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSession(GetSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSessions( + ListSessionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSessionsResponse) { + requests.add(request); + responseObserver.onNext(((ListSessionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSessions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSessionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSession( + UpdateSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Session) { + requests.add(request); + responseObserver.onNext(((Session) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Session.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSession( + DeleteSessionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSession, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listEvents( + ListEventsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListEventsResponse) { + requests.add(request); + responseObserver.onNext(((ListEventsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListEvents, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListEventsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void appendEvent( + AppendEventRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AppendEventResponse) { + requests.add(request); + responseObserver.onNext(((AppendEventResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method AppendEvent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AppendEventResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/SessionServiceClientTest.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/SessionServiceClientTest.java new file mode 100644 index 000000000000..b9bf5318014b --- /dev/null +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1/SessionServiceClientTest.java @@ -0,0 +1,974 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListEventsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListLocationsPagedResponse; +import static com.google.cloud.aiplatform.v1.SessionServiceClient.ListSessionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Struct; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SessionServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockSessionService mockSessionService; + private LocalChannelProvider channelProvider; + private SessionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSessionService = new MockSessionService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSessionService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SessionServiceSettings settings = + SessionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SessionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setSessionState(Struct.newBuilder().build()) + .setUserId("userId-836030906") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSessionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSessionService.addResponse(resultOperation); + + ReasoningEngineName parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]"); + Session session = Session.newBuilder().build(); + + Session actualResponse = client.createSessionAsync(parent, session).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(session, actualRequest.getSession()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + ReasoningEngineName parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]"); + Session session = Session.newBuilder().build(); + client.createSessionAsync(parent, session).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createSessionTest2() throws Exception { + Session expectedResponse = + Session.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setSessionState(Struct.newBuilder().build()) + .setUserId("userId-836030906") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createSessionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSessionService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Session session = Session.newBuilder().build(); + + Session actualResponse = client.createSessionAsync(parent, session).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionRequest actualRequest = ((CreateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(session, actualRequest.getSession()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + String parent = "parent-995424086"; + Session session = Session.newBuilder().build(); + client.createSessionAsync(parent, session).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setSessionState(Struct.newBuilder().build()) + .setUserId("userId-836030906") + .build(); + mockSessionService.addResponse(expectedResponse); + + SessionName name = SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + + Session actualResponse = client.getSession(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + SessionName name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + client.getSession(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionTest2() throws Exception { + Session expectedResponse = + Session.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setSessionState(Struct.newBuilder().build()) + .setUserId("userId-836030906") + .build(); + mockSessionService.addResponse(expectedResponse); + + String name = "name3373707"; + + Session actualResponse = client.getSession(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionRequest actualRequest = ((GetSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + String name = "name3373707"; + client.getSession(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockSessionService.addResponse(expectedResponse); + + ReasoningEngineName parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]"); + + ListSessionsPagedResponse pagedListResponse = client.listSessions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionsRequest actualRequest = ((ListSessionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSessionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + ReasoningEngineName parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]"); + client.listSessions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionsTest2() throws Exception { + Session responsesElement = Session.newBuilder().build(); + ListSessionsResponse expectedResponse = + ListSessionsResponse.newBuilder() + .setNextPageToken("") + .addAllSessions(Arrays.asList(responsesElement)) + .build(); + mockSessionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSessionsPagedResponse pagedListResponse = client.listSessions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionsList().get(0), resources.get(0)); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionsRequest actualRequest = ((ListSessionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSessionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSessions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSessionTest() throws Exception { + Session expectedResponse = + Session.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setSessionState(Struct.newBuilder().build()) + .setUserId("userId-836030906") + .build(); + mockSessionService.addResponse(expectedResponse); + + Session session = Session.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Session actualResponse = client.updateSession(session, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSessionRequest actualRequest = ((UpdateSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(session, actualRequest.getSession()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + Session session = Session.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSession(session, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSessionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSessionService.addResponse(resultOperation); + + SessionName name = SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + + client.deleteSessionAsync(name).get(); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + SessionName name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + client.deleteSessionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteSessionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteSessionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSessionService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteSessionAsync(name).get(); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionRequest actualRequest = ((DeleteSessionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + String name = "name3373707"; + client.deleteSessionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listEventsTest() throws Exception { + SessionEvent responsesElement = SessionEvent.newBuilder().build(); + ListEventsResponse expectedResponse = + ListEventsResponse.newBuilder() + .setNextPageToken("") + .addAllSessionEvents(Arrays.asList(responsesElement)) + .build(); + mockSessionService.addResponse(expectedResponse); + + SessionName parent = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + + ListEventsPagedResponse pagedListResponse = client.listEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionEventsList().get(0), resources.get(0)); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEventsRequest actualRequest = ((ListEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEventsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + SessionName parent = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + client.listEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEventsTest2() throws Exception { + SessionEvent responsesElement = SessionEvent.newBuilder().build(); + ListEventsResponse expectedResponse = + ListEventsResponse.newBuilder() + .setNextPageToken("") + .addAllSessionEvents(Arrays.asList(responsesElement)) + .build(); + mockSessionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEventsPagedResponse pagedListResponse = client.listEvents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionEventsList().get(0), resources.get(0)); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEventsRequest actualRequest = ((ListEventsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEventsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listEvents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void appendEventTest() throws Exception { + AppendEventResponse expectedResponse = AppendEventResponse.newBuilder().build(); + mockSessionService.addResponse(expectedResponse); + + SessionName name = SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + SessionEvent event = SessionEvent.newBuilder().build(); + + AppendEventResponse actualResponse = client.appendEvent(name, event); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AppendEventRequest actualRequest = ((AppendEventRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(event, actualRequest.getEvent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void appendEventExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + SessionName name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + SessionEvent event = SessionEvent.newBuilder().build(); + client.appendEvent(name, event); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void appendEventTest2() throws Exception { + AppendEventResponse expectedResponse = AppendEventResponse.newBuilder().build(); + mockSessionService.addResponse(expectedResponse); + + String name = "name3373707"; + SessionEvent event = SessionEvent.newBuilder().build(); + + AppendEventResponse actualResponse = client.appendEvent(name, event); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AppendEventRequest actualRequest = ((AppendEventRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(event, actualRequest.getEvent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void appendEventExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionService.addException(exception); + + try { + String name = "name3373707"; + SessionEvent event = SessionEvent.newBuilder().build(); + client.appendEvent(name, event); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName("[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/SessionServiceClientTest.java b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/SessionServiceClientTest.java index e6f941a1449b..06327a7e0542 100644 --- a/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/SessionServiceClientTest.java +++ b/java-aiplatform/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/SessionServiceClientTest.java @@ -118,6 +118,7 @@ public void createSessionTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) .setSessionState(Struct.newBuilder().build()) .setUserId("userId-836030906") .build(); @@ -176,6 +177,7 @@ public void createSessionTest2() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) .setSessionState(Struct.newBuilder().build()) .setUserId("userId-836030906") .build(); @@ -232,6 +234,7 @@ public void getSessionTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) .setSessionState(Struct.newBuilder().build()) .setUserId("userId-836030906") .build(); @@ -278,6 +281,7 @@ public void getSessionTest2() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) .setSessionState(Struct.newBuilder().build()) .setUserId("userId-836030906") .build(); @@ -413,6 +417,7 @@ public void updateSessionTest() throws Exception { .setCreateTime(Timestamp.newBuilder().build()) .setUpdateTime(Timestamp.newBuilder().build()) .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) .setSessionState(Struct.newBuilder().build()) .setUserId("userId-836030906") .build(); diff --git a/java-aiplatform/grpc-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceGrpc.java b/java-aiplatform/grpc-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceGrpc.java new file mode 100644 index 000000000000..fd3e3ac43ef2 --- /dev/null +++ b/java-aiplatform/grpc-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceGrpc.java @@ -0,0 +1,1202 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.aiplatform.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * The service that manages Vertex Session related resources.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SessionServiceGrpc { + + private SessionServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.aiplatform.v1.SessionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.CreateSessionRequest, com.google.longrunning.Operation> + getCreateSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSession", + requestType = com.google.cloud.aiplatform.v1.CreateSessionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.CreateSessionRequest, com.google.longrunning.Operation> + getCreateSessionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.CreateSessionRequest, com.google.longrunning.Operation> + getCreateSessionMethod; + if ((getCreateSessionMethod = SessionServiceGrpc.getCreateSessionMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getCreateSessionMethod = SessionServiceGrpc.getCreateSessionMethod) == null) { + SessionServiceGrpc.getCreateSessionMethod = + getCreateSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.CreateSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SessionServiceMethodDescriptorSupplier("CreateSession")) + .build(); + } + } + } + return getCreateSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.GetSessionRequest, com.google.cloud.aiplatform.v1.Session> + getGetSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSession", + requestType = com.google.cloud.aiplatform.v1.GetSessionRequest.class, + responseType = com.google.cloud.aiplatform.v1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.GetSessionRequest, com.google.cloud.aiplatform.v1.Session> + getGetSessionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.GetSessionRequest, + com.google.cloud.aiplatform.v1.Session> + getGetSessionMethod; + if ((getGetSessionMethod = SessionServiceGrpc.getGetSessionMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getGetSessionMethod = SessionServiceGrpc.getGetSessionMethod) == null) { + SessionServiceGrpc.getGetSessionMethod = + getGetSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.GetSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.Session.getDefaultInstance())) + .setSchemaDescriptor(new SessionServiceMethodDescriptorSupplier("GetSession")) + .build(); + } + } + } + return getGetSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ListSessionsRequest, + com.google.cloud.aiplatform.v1.ListSessionsResponse> + getListSessionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSessions", + requestType = com.google.cloud.aiplatform.v1.ListSessionsRequest.class, + responseType = com.google.cloud.aiplatform.v1.ListSessionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ListSessionsRequest, + com.google.cloud.aiplatform.v1.ListSessionsResponse> + getListSessionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ListSessionsRequest, + com.google.cloud.aiplatform.v1.ListSessionsResponse> + getListSessionsMethod; + if ((getListSessionsMethod = SessionServiceGrpc.getListSessionsMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getListSessionsMethod = SessionServiceGrpc.getListSessionsMethod) == null) { + SessionServiceGrpc.getListSessionsMethod = + getListSessionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSessions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.ListSessionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.ListSessionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionServiceMethodDescriptorSupplier("ListSessions")) + .build(); + } + } + } + return getListSessionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.UpdateSessionRequest, + com.google.cloud.aiplatform.v1.Session> + getUpdateSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSession", + requestType = com.google.cloud.aiplatform.v1.UpdateSessionRequest.class, + responseType = com.google.cloud.aiplatform.v1.Session.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.UpdateSessionRequest, + com.google.cloud.aiplatform.v1.Session> + getUpdateSessionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.UpdateSessionRequest, + com.google.cloud.aiplatform.v1.Session> + getUpdateSessionMethod; + if ((getUpdateSessionMethod = SessionServiceGrpc.getUpdateSessionMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getUpdateSessionMethod = SessionServiceGrpc.getUpdateSessionMethod) == null) { + SessionServiceGrpc.getUpdateSessionMethod = + getUpdateSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.UpdateSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.Session.getDefaultInstance())) + .setSchemaDescriptor( + new SessionServiceMethodDescriptorSupplier("UpdateSession")) + .build(); + } + } + } + return getUpdateSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.DeleteSessionRequest, com.google.longrunning.Operation> + getDeleteSessionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSession", + requestType = com.google.cloud.aiplatform.v1.DeleteSessionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.DeleteSessionRequest, com.google.longrunning.Operation> + getDeleteSessionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.DeleteSessionRequest, com.google.longrunning.Operation> + getDeleteSessionMethod; + if ((getDeleteSessionMethod = SessionServiceGrpc.getDeleteSessionMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getDeleteSessionMethod = SessionServiceGrpc.getDeleteSessionMethod) == null) { + SessionServiceGrpc.getDeleteSessionMethod = + getDeleteSessionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSession")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.DeleteSessionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new SessionServiceMethodDescriptorSupplier("DeleteSession")) + .build(); + } + } + } + return getDeleteSessionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ListEventsRequest, + com.google.cloud.aiplatform.v1.ListEventsResponse> + getListEventsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListEvents", + requestType = com.google.cloud.aiplatform.v1.ListEventsRequest.class, + responseType = com.google.cloud.aiplatform.v1.ListEventsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ListEventsRequest, + com.google.cloud.aiplatform.v1.ListEventsResponse> + getListEventsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.ListEventsRequest, + com.google.cloud.aiplatform.v1.ListEventsResponse> + getListEventsMethod; + if ((getListEventsMethod = SessionServiceGrpc.getListEventsMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getListEventsMethod = SessionServiceGrpc.getListEventsMethod) == null) { + SessionServiceGrpc.getListEventsMethod = + getListEventsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListEvents")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.ListEventsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.ListEventsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new SessionServiceMethodDescriptorSupplier("ListEvents")) + .build(); + } + } + } + return getListEventsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.AppendEventRequest, + com.google.cloud.aiplatform.v1.AppendEventResponse> + getAppendEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AppendEvent", + requestType = com.google.cloud.aiplatform.v1.AppendEventRequest.class, + responseType = com.google.cloud.aiplatform.v1.AppendEventResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.AppendEventRequest, + com.google.cloud.aiplatform.v1.AppendEventResponse> + getAppendEventMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1.AppendEventRequest, + com.google.cloud.aiplatform.v1.AppendEventResponse> + getAppendEventMethod; + if ((getAppendEventMethod = SessionServiceGrpc.getAppendEventMethod) == null) { + synchronized (SessionServiceGrpc.class) { + if ((getAppendEventMethod = SessionServiceGrpc.getAppendEventMethod) == null) { + SessionServiceGrpc.getAppendEventMethod = + getAppendEventMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "AppendEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.AppendEventRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1.AppendEventResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SessionServiceMethodDescriptorSupplier("AppendEvent")) + .build(); + } + } + } + return getAppendEventMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SessionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceStub(channel, callOptions); + } + }; + return SessionServiceStub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static SessionServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceBlockingV2Stub(channel, callOptions); + } + }; + return SessionServiceBlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SessionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceBlockingStub(channel, callOptions); + } + }; + return SessionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SessionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SessionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceFutureStub(channel, callOptions); + } + }; + return SessionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * The service that manages Vertex Session related resources.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a new [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + default void createSession( + com.google.cloud.aiplatform.v1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + default void getSession( + com.google.cloud.aiplatform.v1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning
+     * engine.
+     * 
+ */ + default void listSessions( + com.google.cloud.aiplatform.v1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSessionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + default void updateSession( + com.google.cloud.aiplatform.v1.UpdateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes details of the specific
+     * [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + default void deleteSession( + com.google.cloud.aiplatform.v1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.
+     * 
+ */ + default void listEvents( + com.google.cloud.aiplatform.v1.ListEventsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListEventsMethod(), responseObserver); + } + + /** + * + * + *
+     * Appends an event to a given session.
+     * 
+ */ + default void appendEvent( + com.google.cloud.aiplatform.v1.AppendEventRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAppendEventMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SessionService. + * + *
+   * The service that manages Vertex Session related resources.
+   * 
+ */ + public abstract static class SessionServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SessionServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SessionService. + * + *
+   * The service that manages Vertex Session related resources.
+   * 
+ */ + public static final class SessionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private SessionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public void createSession( + com.google.cloud.aiplatform.v1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public void getSession( + com.google.cloud.aiplatform.v1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning
+     * engine.
+     * 
+ */ + public void listSessions( + com.google.cloud.aiplatform.v1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public void updateSession( + com.google.cloud.aiplatform.v1.UpdateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes details of the specific
+     * [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public void deleteSession( + com.google.cloud.aiplatform.v1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.
+     * 
+ */ + public void listEvents( + com.google.cloud.aiplatform.v1.ListEventsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListEventsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Appends an event to a given session.
+     * 
+ */ + public void appendEvent( + com.google.cloud.aiplatform.v1.AppendEventRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getAppendEventMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SessionService. + * + *
+   * The service that manages Vertex Session related resources.
+   * 
+ */ + public static final class SessionServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SessionServiceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.longrunning.Operation createSession( + com.google.cloud.aiplatform.v1.CreateSessionRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.cloud.aiplatform.v1.Session getSession( + com.google.cloud.aiplatform.v1.GetSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning
+     * engine.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.ListSessionsResponse listSessions( + com.google.cloud.aiplatform.v1.ListSessionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.cloud.aiplatform.v1.Session updateSession( + com.google.cloud.aiplatform.v1.UpdateSessionRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes details of the specific
+     * [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.longrunning.Operation deleteSession( + com.google.cloud.aiplatform.v1.DeleteSessionRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.ListEventsResponse listEvents( + com.google.cloud.aiplatform.v1.ListEventsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Appends an event to a given session.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.AppendEventResponse appendEvent( + com.google.cloud.aiplatform.v1.AppendEventRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAppendEventMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service SessionService. + * + *
+   * The service that manages Vertex Session related resources.
+   * 
+ */ + public static final class SessionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private SessionServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.longrunning.Operation createSession( + com.google.cloud.aiplatform.v1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.cloud.aiplatform.v1.Session getSession( + com.google.cloud.aiplatform.v1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning
+     * engine.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.ListSessionsResponse listSessions( + com.google.cloud.aiplatform.v1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.cloud.aiplatform.v1.Session updateSession( + com.google.cloud.aiplatform.v1.UpdateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes details of the specific
+     * [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.longrunning.Operation deleteSession( + com.google.cloud.aiplatform.v1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.ListEventsResponse listEvents( + com.google.cloud.aiplatform.v1.ListEventsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListEventsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Appends an event to a given session.
+     * 
+ */ + public com.google.cloud.aiplatform.v1.AppendEventResponse appendEvent( + com.google.cloud.aiplatform.v1.AppendEventRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAppendEventMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SessionService. + * + *
+   * The service that manages Vertex Session related resources.
+   * 
+ */ + public static final class SessionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private SessionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SessionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SessionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSession(com.google.cloud.aiplatform.v1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets details of the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.Session> + getSession(com.google.cloud.aiplatform.v1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning
+     * engine.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.ListSessionsResponse> + listSessions(com.google.cloud.aiplatform.v1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specific [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.Session> + updateSession(com.google.cloud.aiplatform.v1.UpdateSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes details of the specific
+     * [Session][google.cloud.aiplatform.v1.Session].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteSession(com.google.cloud.aiplatform.v1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists [Events][google.cloud.aiplatform.v1.Event] in a given session.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.ListEventsResponse> + listEvents(com.google.cloud.aiplatform.v1.ListEventsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListEventsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Appends an event to a given session.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1.AppendEventResponse> + appendEvent(com.google.cloud.aiplatform.v1.AppendEventRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getAppendEventMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SESSION = 0; + private static final int METHODID_GET_SESSION = 1; + private static final int METHODID_LIST_SESSIONS = 2; + private static final int METHODID_UPDATE_SESSION = 3; + private static final int METHODID_DELETE_SESSION = 4; + private static final int METHODID_LIST_EVENTS = 5; + private static final int METHODID_APPEND_EVENT = 6; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SESSION: + serviceImpl.createSession( + (com.google.cloud.aiplatform.v1.CreateSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SESSION: + serviceImpl.getSession( + (com.google.cloud.aiplatform.v1.GetSessionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SESSIONS: + serviceImpl.listSessions( + (com.google.cloud.aiplatform.v1.ListSessionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_SESSION: + serviceImpl.updateSession( + (com.google.cloud.aiplatform.v1.UpdateSessionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SESSION: + serviceImpl.deleteSession( + (com.google.cloud.aiplatform.v1.DeleteSessionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_EVENTS: + serviceImpl.listEvents( + (com.google.cloud.aiplatform.v1.ListEventsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_APPEND_EVENT: + serviceImpl.appendEvent( + (com.google.cloud.aiplatform.v1.AppendEventRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.CreateSessionRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.GetSessionRequest, + com.google.cloud.aiplatform.v1.Session>(service, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.ListSessionsRequest, + com.google.cloud.aiplatform.v1.ListSessionsResponse>( + service, METHODID_LIST_SESSIONS))) + .addMethod( + getUpdateSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.UpdateSessionRequest, + com.google.cloud.aiplatform.v1.Session>(service, METHODID_UPDATE_SESSION))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.DeleteSessionRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_SESSION))) + .addMethod( + getListEventsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.ListEventsRequest, + com.google.cloud.aiplatform.v1.ListEventsResponse>( + service, METHODID_LIST_EVENTS))) + .addMethod( + getAppendEventMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1.AppendEventRequest, + com.google.cloud.aiplatform.v1.AppendEventResponse>( + service, METHODID_APPEND_EVENT))) + .build(); + } + + private abstract static class SessionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SessionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SessionService"); + } + } + + private static final class SessionServiceFileDescriptorSupplier + extends SessionServiceBaseDescriptorSupplier { + SessionServiceFileDescriptorSupplier() {} + } + + private static final class SessionServiceMethodDescriptorSupplier + extends SessionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SessionServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SessionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SessionServiceFileDescriptorSupplier()) + .addMethod(getCreateSessionMethod()) + .addMethod(getGetSessionMethod()) + .addMethod(getListSessionsMethod()) + .addMethod(getUpdateSessionMethod()) + .addMethod(getDeleteSessionMethod()) + .addMethod(getListEventsMethod()) + .addMethod(getAppendEventMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventRequest.java new file mode 100644 index 000000000000..82108fd52459 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventRequest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.AppendEvent][google.cloud.aiplatform.v1.SessionService.AppendEvent].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.AppendEventRequest} + */ +@com.google.protobuf.Generated +public final class AppendEventRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.AppendEventRequest) + AppendEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AppendEventRequest"); + } + + // Use AppendEventRequest.newBuilder() to construct. + private AppendEventRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AppendEventRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.AppendEventRequest.class, + com.google.cloud.aiplatform.v1.AppendEventRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the session to append event to.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the session to append event to.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_FIELD_NUMBER = 2; + private com.google.cloud.aiplatform.v1.SessionEvent event_; + + /** + * + * + *
+   * Required. The event to append to the session.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the event field is set. + */ + @java.lang.Override + public boolean hasEvent() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The event to append to the session.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The event. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEvent getEvent() { + return event_ == null + ? com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance() + : event_; + } + + /** + * + * + *
+   * Required. The event to append to the session.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEventOrBuilder getEventOrBuilder() { + return event_ == null + ? com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance() + : event_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getEvent()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEvent()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.AppendEventRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.AppendEventRequest other = + (com.google.cloud.aiplatform.v1.AppendEventRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent().equals(other.getEvent())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.AppendEventRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.AppendEvent][google.cloud.aiplatform.v1.SessionService.AppendEvent].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.AppendEventRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.AppendEventRequest) + com.google.cloud.aiplatform.v1.AppendEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.AppendEventRequest.class, + com.google.cloud.aiplatform.v1.AppendEventRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.AppendEventRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetEventFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + event_ = null; + if (eventBuilder_ != null) { + eventBuilder_.dispose(); + eventBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.AppendEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventRequest build() { + com.google.cloud.aiplatform.v1.AppendEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventRequest buildPartial() { + com.google.cloud.aiplatform.v1.AppendEventRequest result = + new com.google.cloud.aiplatform.v1.AppendEventRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.AppendEventRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.event_ = eventBuilder_ == null ? event_ : eventBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.AppendEventRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.AppendEventRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.AppendEventRequest other) { + if (other == com.google.cloud.aiplatform.v1.AppendEventRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetEventFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the session to append event to.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session to append event to.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session to append event to.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session to append event to.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session to append event to.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.aiplatform.v1.SessionEvent event_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.SessionEvent, + com.google.cloud.aiplatform.v1.SessionEvent.Builder, + com.google.cloud.aiplatform.v1.SessionEventOrBuilder> + eventBuilder_; + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the event field is set. + */ + public boolean hasEvent() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The event. + */ + public com.google.cloud.aiplatform.v1.SessionEvent getEvent() { + if (eventBuilder_ == null) { + return event_ == null + ? com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance() + : event_; + } else { + return eventBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEvent(com.google.cloud.aiplatform.v1.SessionEvent value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + } else { + eventBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEvent(com.google.cloud.aiplatform.v1.SessionEvent.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeEvent(com.google.cloud.aiplatform.v1.SessionEvent value) { + if (eventBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && event_ != null + && event_ != com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance()) { + getEventBuilder().mergeFrom(value); + } else { + event_ = value; + } + } else { + eventBuilder_.mergeFrom(value); + } + if (event_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEvent() { + bitField0_ = (bitField0_ & ~0x00000002); + event_ = null; + if (eventBuilder_ != null) { + eventBuilder_.dispose(); + eventBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.SessionEvent.Builder getEventBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetEventFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.SessionEventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null + ? com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance() + : event_; + } + } + + /** + * + * + *
+     * Required. The event to append to the session.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.SessionEvent, + com.google.cloud.aiplatform.v1.SessionEvent.Builder, + com.google.cloud.aiplatform.v1.SessionEventOrBuilder> + internalGetEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.SessionEvent, + com.google.cloud.aiplatform.v1.SessionEvent.Builder, + com.google.cloud.aiplatform.v1.SessionEventOrBuilder>( + getEvent(), getParentForChildren(), isClean()); + event_ = null; + } + return eventBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.AppendEventRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.AppendEventRequest) + private static final com.google.cloud.aiplatform.v1.AppendEventRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.AppendEventRequest(); + } + + public static com.google.cloud.aiplatform.v1.AppendEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppendEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventRequestOrBuilder.java new file mode 100644 index 000000000000..9e34ca7a5bf9 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface AppendEventRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.AppendEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the session to append event to.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the session to append event to.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The event to append to the session.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the event field is set. + */ + boolean hasEvent(); + + /** + * + * + *
+   * Required. The event to append to the session.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The event. + */ + com.google.cloud.aiplatform.v1.SessionEvent getEvent(); + + /** + * + * + *
+   * Required. The event to append to the session.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.SessionEvent event = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1.SessionEventOrBuilder getEventOrBuilder(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventResponse.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventResponse.java new file mode 100644 index 000000000000..f63100ee41eb --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventResponse.java @@ -0,0 +1,398 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Response message for
+ * [SessionService.AppendEvent][google.cloud.aiplatform.v1.SessionService.AppendEvent].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.AppendEventResponse} + */ +@com.google.protobuf.Generated +public final class AppendEventResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.AppendEventResponse) + AppendEventResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "AppendEventResponse"); + } + + // Use AppendEventResponse.newBuilder() to construct. + private AppendEventResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private AppendEventResponse() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.AppendEventResponse.class, + com.google.cloud.aiplatform.v1.AppendEventResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.AppendEventResponse)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.AppendEventResponse other = + (com.google.cloud.aiplatform.v1.AppendEventResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.AppendEventResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [SessionService.AppendEvent][google.cloud.aiplatform.v1.SessionService.AppendEvent].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.AppendEventResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.AppendEventResponse) + com.google.cloud.aiplatform.v1.AppendEventResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.AppendEventResponse.class, + com.google.cloud.aiplatform.v1.AppendEventResponse.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.AppendEventResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_AppendEventResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventResponse getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.AppendEventResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventResponse build() { + com.google.cloud.aiplatform.v1.AppendEventResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventResponse buildPartial() { + com.google.cloud.aiplatform.v1.AppendEventResponse result = + new com.google.cloud.aiplatform.v1.AppendEventResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.AppendEventResponse) { + return mergeFrom((com.google.cloud.aiplatform.v1.AppendEventResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.AppendEventResponse other) { + if (other == com.google.cloud.aiplatform.v1.AppendEventResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.AppendEventResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.AppendEventResponse) + private static final com.google.cloud.aiplatform.v1.AppendEventResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.AppendEventResponse(); + } + + public static com.google.cloud.aiplatform.v1.AppendEventResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AppendEventResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.AppendEventResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventResponseOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventResponseOrBuilder.java new file mode 100644 index 000000000000..34e23eafd53c --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/AppendEventResponseOrBuilder.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface AppendEventResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.AppendEventResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionOperationMetadata.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionOperationMetadata.java new file mode 100644 index 000000000000..d9e99147f5ed --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionOperationMetadata.java @@ -0,0 +1,715 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Metadata associated with the
+ * [SessionService.CreateSession][google.cloud.aiplatform.v1.SessionService.CreateSession]
+ * operation.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.CreateSessionOperationMetadata} + */ +@com.google.protobuf.Generated +public final class CreateSessionOperationMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.CreateSessionOperationMetadata) + CreateSessionOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSessionOperationMetadata"); + } + + // Use CreateSessionOperationMetadata.newBuilder() to construct. + private CreateSessionOperationMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSessionOperationMetadata() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.class, + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.Builder.class); + } + + private int bitField0_; + public static final int GENERIC_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.aiplatform.v1.GenericOperationMetadata genericMetadata_; + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + @java.lang.Override + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.GenericOperationMetadata getGenericMetadata() { + return genericMetadata_ == null + ? com.google.cloud.aiplatform.v1.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + return genericMetadata_ == null + ? com.google.cloud.aiplatform.v1.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getGenericMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata other = + (com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata) obj; + + if (hasGenericMetadata() != other.hasGenericMetadata()) return false; + if (hasGenericMetadata()) { + if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGenericMetadata()) { + hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGenericMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata associated with the
+   * [SessionService.CreateSession][google.cloud.aiplatform.v1.SessionService.CreateSession]
+   * operation.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.CreateSessionOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.CreateSessionOperationMetadata) + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.class, + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetGenericMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata build() { + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata buildPartial() { + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata result = + new com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.genericMetadata_ = + genericMetadataBuilder_ == null ? genericMetadata_ : genericMetadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata) { + return mergeFrom((com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata other) { + if (other + == com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata.getDefaultInstance()) + return this; + if (other.hasGenericMetadata()) { + mergeGenericMetadata(other.getGenericMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetGenericMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.aiplatform.v1.GenericOperationMetadata genericMetadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.GenericOperationMetadata, + com.google.cloud.aiplatform.v1.GenericOperationMetadata.Builder, + com.google.cloud.aiplatform.v1.GenericOperationMetadataOrBuilder> + genericMetadataBuilder_; + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + public boolean hasGenericMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + public com.google.cloud.aiplatform.v1.GenericOperationMetadata getGenericMetadata() { + if (genericMetadataBuilder_ == null) { + return genericMetadata_ == null + ? com.google.cloud.aiplatform.v1.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } else { + return genericMetadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.aiplatform.v1.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + genericMetadata_ = value; + } else { + genericMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder setGenericMetadata( + com.google.cloud.aiplatform.v1.GenericOperationMetadata.Builder builderForValue) { + if (genericMetadataBuilder_ == null) { + genericMetadata_ = builderForValue.build(); + } else { + genericMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder mergeGenericMetadata( + com.google.cloud.aiplatform.v1.GenericOperationMetadata value) { + if (genericMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && genericMetadata_ != null + && genericMetadata_ + != com.google.cloud.aiplatform.v1.GenericOperationMetadata.getDefaultInstance()) { + getGenericMetadataBuilder().mergeFrom(value); + } else { + genericMetadata_ = value; + } + } else { + genericMetadataBuilder_.mergeFrom(value); + } + if (genericMetadata_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + public Builder clearGenericMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + genericMetadata_ = null; + if (genericMetadataBuilder_ != null) { + genericMetadataBuilder_.dispose(); + genericMetadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.aiplatform.v1.GenericOperationMetadata.Builder + getGenericMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetGenericMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + public com.google.cloud.aiplatform.v1.GenericOperationMetadataOrBuilder + getGenericMetadataOrBuilder() { + if (genericMetadataBuilder_ != null) { + return genericMetadataBuilder_.getMessageOrBuilder(); + } else { + return genericMetadata_ == null + ? com.google.cloud.aiplatform.v1.GenericOperationMetadata.getDefaultInstance() + : genericMetadata_; + } + } + + /** + * + * + *
+     * The common part of the operation metadata.
+     * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.GenericOperationMetadata, + com.google.cloud.aiplatform.v1.GenericOperationMetadata.Builder, + com.google.cloud.aiplatform.v1.GenericOperationMetadataOrBuilder> + internalGetGenericMetadataFieldBuilder() { + if (genericMetadataBuilder_ == null) { + genericMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.GenericOperationMetadata, + com.google.cloud.aiplatform.v1.GenericOperationMetadata.Builder, + com.google.cloud.aiplatform.v1.GenericOperationMetadataOrBuilder>( + getGenericMetadata(), getParentForChildren(), isClean()); + genericMetadata_ = null; + } + return genericMetadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.CreateSessionOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.CreateSessionOperationMetadata) + private static final com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata(); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionOperationMetadataOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionOperationMetadataOrBuilder.java new file mode 100644 index 000000000000..95202587a883 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionOperationMetadataOrBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface CreateSessionOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.CreateSessionOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + * + * @return Whether the genericMetadata field is set. + */ + boolean hasGenericMetadata(); + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + * + * @return The genericMetadata. + */ + com.google.cloud.aiplatform.v1.GenericOperationMetadata getGenericMetadata(); + + /** + * + * + *
+   * The common part of the operation metadata.
+   * 
+ * + * .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; + */ + com.google.cloud.aiplatform.v1.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionRequest.java new file mode 100644 index 000000000000..9845c6b03cd9 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionRequest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.CreateSession][google.cloud.aiplatform.v1.SessionService.CreateSession].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.CreateSessionRequest} + */ +@com.google.protobuf.Generated +public final class CreateSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.CreateSessionRequest) + CreateSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateSessionRequest"); + } + + // Use CreateSessionRequest.newBuilder() to construct. + private CreateSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CreateSessionRequest() { + parent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.CreateSessionRequest.class, + com.google.cloud.aiplatform.v1.CreateSessionRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource name of the location to create the session in.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the location to create the session in.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SESSION_FIELD_NUMBER = 2; + private com.google.cloud.aiplatform.v1.Session session_; + + /** + * + * + *
+   * Required. The session to create.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the session field is set. + */ + @java.lang.Override + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The session to create.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The session. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session getSession() { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } + + /** + * + * + *
+   * Required. The session to create.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionOrBuilder() { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSession()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSession()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.CreateSessionRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.CreateSessionRequest other = + (com.google.cloud.aiplatform.v1.CreateSessionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSession() != other.hasSession()) return false; + if (hasSession()) { + if (!getSession().equals(other.getSession())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSession()) { + hash = (37 * hash) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.CreateSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.CreateSession][google.cloud.aiplatform.v1.SessionService.CreateSession].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.CreateSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.CreateSessionRequest) + com.google.cloud.aiplatform.v1.CreateSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.CreateSessionRequest.class, + com.google.cloud.aiplatform.v1.CreateSessionRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.CreateSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSessionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.CreateSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionRequest build() { + com.google.cloud.aiplatform.v1.CreateSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionRequest buildPartial() { + com.google.cloud.aiplatform.v1.CreateSessionRequest result = + new com.google.cloud.aiplatform.v1.CreateSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.CreateSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.session_ = sessionBuilder_ == null ? session_ : sessionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.CreateSessionRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.CreateSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.CreateSessionRequest other) { + if (other == com.google.cloud.aiplatform.v1.CreateSessionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSession()) { + mergeSession(other.getSession()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetSessionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource name of the location to create the session in.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the location to create the session in.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the location to create the session in.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the location to create the session in.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the location to create the session in.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.aiplatform.v1.Session session_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder> + sessionBuilder_; + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the session field is set. + */ + public boolean hasSession() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The session. + */ + public com.google.cloud.aiplatform.v1.Session getSession() { + if (sessionBuilder_ == null) { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } else { + return sessionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSession(com.google.cloud.aiplatform.v1.Session value) { + if (sessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + session_ = value; + } else { + sessionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSession(com.google.cloud.aiplatform.v1.Session.Builder builderForValue) { + if (sessionBuilder_ == null) { + session_ = builderForValue.build(); + } else { + sessionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSession(com.google.cloud.aiplatform.v1.Session value) { + if (sessionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && session_ != null + && session_ != com.google.cloud.aiplatform.v1.Session.getDefaultInstance()) { + getSessionBuilder().mergeFrom(value); + } else { + session_ = value; + } + } else { + sessionBuilder_.mergeFrom(value); + } + if (session_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSession() { + bitField0_ = (bitField0_ & ~0x00000002); + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.Session.Builder getSessionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionOrBuilder() { + if (sessionBuilder_ != null) { + return sessionBuilder_.getMessageOrBuilder(); + } else { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } + } + + /** + * + * + *
+     * Required. The session to create.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder> + internalGetSessionFieldBuilder() { + if (sessionBuilder_ == null) { + sessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder>( + getSession(), getParentForChildren(), isClean()); + session_ = null; + } + return sessionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.CreateSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.CreateSessionRequest) + private static final com.google.cloud.aiplatform.v1.CreateSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.CreateSessionRequest(); + } + + public static com.google.cloud.aiplatform.v1.CreateSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.CreateSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionRequestOrBuilder.java new file mode 100644 index 000000000000..6c59208f3d4e --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/CreateSessionRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface CreateSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.CreateSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the location to create the session in.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource name of the location to create the session in.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The session to create.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the session field is set. + */ + boolean hasSession(); + + /** + * + * + *
+   * Required. The session to create.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The session. + */ + com.google.cloud.aiplatform.v1.Session getSession(); + + /** + * + * + *
+   * Required. The session to create.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionOrBuilder(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/DeleteSessionRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/DeleteSessionRequest.java new file mode 100644 index 000000000000..c38994e29213 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/DeleteSessionRequest.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.DeleteSession][google.cloud.aiplatform.v1.SessionService.DeleteSession].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.DeleteSessionRequest} + */ +@com.google.protobuf.Generated +public final class DeleteSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.DeleteSessionRequest) + DeleteSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteSessionRequest"); + } + + // Use DeleteSessionRequest.newBuilder() to construct. + private DeleteSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private DeleteSessionRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.DeleteSessionRequest.class, + com.google.cloud.aiplatform.v1.DeleteSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.DeleteSessionRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.DeleteSessionRequest other = + (com.google.cloud.aiplatform.v1.DeleteSessionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.DeleteSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.DeleteSession][google.cloud.aiplatform.v1.SessionService.DeleteSession].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.DeleteSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.DeleteSessionRequest) + com.google.cloud.aiplatform.v1.DeleteSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.DeleteSessionRequest.class, + com.google.cloud.aiplatform.v1.DeleteSessionRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.DeleteSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.DeleteSessionRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.DeleteSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.DeleteSessionRequest build() { + com.google.cloud.aiplatform.v1.DeleteSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.DeleteSessionRequest buildPartial() { + com.google.cloud.aiplatform.v1.DeleteSessionRequest result = + new com.google.cloud.aiplatform.v1.DeleteSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.DeleteSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.DeleteSessionRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.DeleteSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.DeleteSessionRequest other) { + if (other == com.google.cloud.aiplatform.v1.DeleteSessionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.DeleteSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.DeleteSessionRequest) + private static final com.google.cloud.aiplatform.v1.DeleteSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.DeleteSessionRequest(); + } + + public static com.google.cloud.aiplatform.v1.DeleteSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.DeleteSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/DeleteSessionRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/DeleteSessionRequestOrBuilder.java new file mode 100644 index 000000000000..55dfcd33cd52 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/DeleteSessionRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface DeleteSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.DeleteSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventActions.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventActions.java new file mode 100644 index 000000000000..ae61af10430f --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventActions.java @@ -0,0 +1,1811 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Actions are parts of events that are executed by the agent.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.EventActions} + */ +@com.google.protobuf.Generated +public final class EventActions extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.EventActions) + EventActionsOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EventActions"); + } + + // Use EventActions.newBuilder() to construct. + private EventActions(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EventActions() { + transferAgent_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventActions_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetArtifactDelta(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventActions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.EventActions.class, + com.google.cloud.aiplatform.v1.EventActions.Builder.class); + } + + private int bitField0_; + public static final int SKIP_SUMMARIZATION_FIELD_NUMBER = 1; + private boolean skipSummarization_ = false; + + /** + * + * + *
+   * Optional. If true, it won't call model to summarize function response.
+   * Only used for function_response event.
+   * 
+ * + * bool skip_summarization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The skipSummarization. + */ + @java.lang.Override + public boolean getSkipSummarization() { + return skipSummarization_; + } + + public static final int STATE_DELTA_FIELD_NUMBER = 2; + private com.google.protobuf.Struct stateDelta_; + + /** + * + * + *
+   * Optional. Indicates that the event is updating the state with the given
+   * delta.
+   * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the stateDelta field is set. + */ + @java.lang.Override + public boolean hasStateDelta() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Indicates that the event is updating the state with the given
+   * delta.
+   * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stateDelta. + */ + @java.lang.Override + public com.google.protobuf.Struct getStateDelta() { + return stateDelta_ == null ? com.google.protobuf.Struct.getDefaultInstance() : stateDelta_; + } + + /** + * + * + *
+   * Optional. Indicates that the event is updating the state with the given
+   * delta.
+   * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getStateDeltaOrBuilder() { + return stateDelta_ == null ? com.google.protobuf.Struct.getDefaultInstance() : stateDelta_; + } + + public static final int ARTIFACT_DELTA_FIELD_NUMBER = 3; + + private static final class ArtifactDeltaDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventActions_ArtifactDeltaEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField artifactDelta_; + + private com.google.protobuf.MapField + internalGetArtifactDelta() { + if (artifactDelta_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ArtifactDeltaDefaultEntryHolder.defaultEntry); + } + return artifactDelta_; + } + + public int getArtifactDeltaCount() { + return internalGetArtifactDelta().getMap().size(); + } + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsArtifactDelta(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetArtifactDelta().getMap().containsKey(key); + } + + /** Use {@link #getArtifactDeltaMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getArtifactDelta() { + return getArtifactDeltaMap(); + } + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getArtifactDeltaMap() { + return internalGetArtifactDelta().getMap(); + } + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getArtifactDeltaOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetArtifactDelta().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getArtifactDeltaOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetArtifactDelta().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ESCALATE_FIELD_NUMBER = 6; + private boolean escalate_ = false; + + /** + * + * + *
+   * Optional. The agent is escalating to a higher level agent.
+   * 
+ * + * bool escalate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The escalate. + */ + @java.lang.Override + public boolean getEscalate() { + return escalate_; + } + + public static final int REQUESTED_AUTH_CONFIGS_FIELD_NUMBER = 7; + private com.google.protobuf.Struct requestedAuthConfigs_; + + /** + * + * + *
+   * Optional. Will only be set by a tool response indicating tool request euc.
+   * Struct key is the function call id since one function call response (from
+   * model) could correspond to multiple function calls. Struct value is the
+   * required auth config, which can be another struct.
+   * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the requestedAuthConfigs field is set. + */ + @java.lang.Override + public boolean hasRequestedAuthConfigs() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Will only be set by a tool response indicating tool request euc.
+   * Struct key is the function call id since one function call response (from
+   * model) could correspond to multiple function calls. Struct value is the
+   * required auth config, which can be another struct.
+   * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The requestedAuthConfigs. + */ + @java.lang.Override + public com.google.protobuf.Struct getRequestedAuthConfigs() { + return requestedAuthConfigs_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : requestedAuthConfigs_; + } + + /** + * + * + *
+   * Optional. Will only be set by a tool response indicating tool request euc.
+   * Struct key is the function call id since one function call response (from
+   * model) could correspond to multiple function calls. Struct value is the
+   * required auth config, which can be another struct.
+   * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getRequestedAuthConfigsOrBuilder() { + return requestedAuthConfigs_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : requestedAuthConfigs_; + } + + public static final int TRANSFER_AGENT_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object transferAgent_ = ""; + + /** + * + * + *
+   * Optional. If set, the event transfers to the specified agent.
+   * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The transferAgent. + */ + @java.lang.Override + public java.lang.String getTransferAgent() { + java.lang.Object ref = transferAgent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transferAgent_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If set, the event transfers to the specified agent.
+   * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for transferAgent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTransferAgentBytes() { + java.lang.Object ref = transferAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transferAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (skipSummarization_ != false) { + output.writeBool(1, skipSummarization_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getStateDelta()); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetArtifactDelta(), ArtifactDeltaDefaultEntryHolder.defaultEntry, 3); + if (escalate_ != false) { + output.writeBool(6, escalate_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getRequestedAuthConfigs()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(transferAgent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 8, transferAgent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (skipSummarization_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, skipSummarization_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStateDelta()); + } + for (java.util.Map.Entry entry : + internalGetArtifactDelta().getMap().entrySet()) { + com.google.protobuf.MapEntry artifactDelta__ = + ArtifactDeltaDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, artifactDelta__); + } + if (escalate_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, escalate_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(7, getRequestedAuthConfigs()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(transferAgent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(8, transferAgent_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.EventActions)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.EventActions other = + (com.google.cloud.aiplatform.v1.EventActions) obj; + + if (getSkipSummarization() != other.getSkipSummarization()) return false; + if (hasStateDelta() != other.hasStateDelta()) return false; + if (hasStateDelta()) { + if (!getStateDelta().equals(other.getStateDelta())) return false; + } + if (!internalGetArtifactDelta().equals(other.internalGetArtifactDelta())) return false; + if (getEscalate() != other.getEscalate()) return false; + if (hasRequestedAuthConfigs() != other.hasRequestedAuthConfigs()) return false; + if (hasRequestedAuthConfigs()) { + if (!getRequestedAuthConfigs().equals(other.getRequestedAuthConfigs())) return false; + } + if (!getTransferAgent().equals(other.getTransferAgent())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SKIP_SUMMARIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSkipSummarization()); + if (hasStateDelta()) { + hash = (37 * hash) + STATE_DELTA_FIELD_NUMBER; + hash = (53 * hash) + getStateDelta().hashCode(); + } + if (!internalGetArtifactDelta().getMap().isEmpty()) { + hash = (37 * hash) + ARTIFACT_DELTA_FIELD_NUMBER; + hash = (53 * hash) + internalGetArtifactDelta().hashCode(); + } + hash = (37 * hash) + ESCALATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEscalate()); + if (hasRequestedAuthConfigs()) { + hash = (37 * hash) + REQUESTED_AUTH_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getRequestedAuthConfigs().hashCode(); + } + hash = (37 * hash) + TRANSFER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getTransferAgent().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.EventActions parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.EventActions prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Actions are parts of events that are executed by the agent.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.EventActions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.EventActions) + com.google.cloud.aiplatform.v1.EventActionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventActions_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetArtifactDelta(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableArtifactDelta(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventActions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.EventActions.class, + com.google.cloud.aiplatform.v1.EventActions.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.EventActions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStateDeltaFieldBuilder(); + internalGetRequestedAuthConfigsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + skipSummarization_ = false; + stateDelta_ = null; + if (stateDeltaBuilder_ != null) { + stateDeltaBuilder_.dispose(); + stateDeltaBuilder_ = null; + } + internalGetMutableArtifactDelta().clear(); + escalate_ = false; + requestedAuthConfigs_ = null; + if (requestedAuthConfigsBuilder_ != null) { + requestedAuthConfigsBuilder_.dispose(); + requestedAuthConfigsBuilder_ = null; + } + transferAgent_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventActions_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventActions getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventActions build() { + com.google.cloud.aiplatform.v1.EventActions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventActions buildPartial() { + com.google.cloud.aiplatform.v1.EventActions result = + new com.google.cloud.aiplatform.v1.EventActions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.EventActions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.skipSummarization_ = skipSummarization_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.stateDelta_ = stateDeltaBuilder_ == null ? stateDelta_ : stateDeltaBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.artifactDelta_ = internalGetArtifactDelta(); + result.artifactDelta_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.escalate_ = escalate_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.requestedAuthConfigs_ = + requestedAuthConfigsBuilder_ == null + ? requestedAuthConfigs_ + : requestedAuthConfigsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.transferAgent_ = transferAgent_; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.EventActions) { + return mergeFrom((com.google.cloud.aiplatform.v1.EventActions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.EventActions other) { + if (other == com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance()) return this; + if (other.getSkipSummarization() != false) { + setSkipSummarization(other.getSkipSummarization()); + } + if (other.hasStateDelta()) { + mergeStateDelta(other.getStateDelta()); + } + internalGetMutableArtifactDelta().mergeFrom(other.internalGetArtifactDelta()); + bitField0_ |= 0x00000004; + if (other.getEscalate() != false) { + setEscalate(other.getEscalate()); + } + if (other.hasRequestedAuthConfigs()) { + mergeRequestedAuthConfigs(other.getRequestedAuthConfigs()); + } + if (!other.getTransferAgent().isEmpty()) { + transferAgent_ = other.transferAgent_; + bitField0_ |= 0x00000020; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + skipSummarization_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + internalGetStateDeltaFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry artifactDelta__ = + input.readMessage( + ArtifactDeltaDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableArtifactDelta() + .getMutableMap() + .put(artifactDelta__.getKey(), artifactDelta__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 48: + { + escalate_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 48 + case 58: + { + input.readMessage( + internalGetRequestedAuthConfigsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + case 66: + { + transferAgent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean skipSummarization_; + + /** + * + * + *
+     * Optional. If true, it won't call model to summarize function response.
+     * Only used for function_response event.
+     * 
+ * + * bool skip_summarization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The skipSummarization. + */ + @java.lang.Override + public boolean getSkipSummarization() { + return skipSummarization_; + } + + /** + * + * + *
+     * Optional. If true, it won't call model to summarize function response.
+     * Only used for function_response event.
+     * 
+ * + * bool skip_summarization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The skipSummarization to set. + * @return This builder for chaining. + */ + public Builder setSkipSummarization(boolean value) { + + skipSummarization_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If true, it won't call model to summarize function response.
+     * Only used for function_response event.
+     * 
+ * + * bool skip_summarization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSkipSummarization() { + bitField0_ = (bitField0_ & ~0x00000001); + skipSummarization_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Struct stateDelta_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + stateDeltaBuilder_; + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the stateDelta field is set. + */ + public boolean hasStateDelta() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The stateDelta. + */ + public com.google.protobuf.Struct getStateDelta() { + if (stateDeltaBuilder_ == null) { + return stateDelta_ == null ? com.google.protobuf.Struct.getDefaultInstance() : stateDelta_; + } else { + return stateDeltaBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStateDelta(com.google.protobuf.Struct value) { + if (stateDeltaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateDelta_ = value; + } else { + stateDeltaBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setStateDelta(com.google.protobuf.Struct.Builder builderForValue) { + if (stateDeltaBuilder_ == null) { + stateDelta_ = builderForValue.build(); + } else { + stateDeltaBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeStateDelta(com.google.protobuf.Struct value) { + if (stateDeltaBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && stateDelta_ != null + && stateDelta_ != com.google.protobuf.Struct.getDefaultInstance()) { + getStateDeltaBuilder().mergeFrom(value); + } else { + stateDelta_ = value; + } + } else { + stateDeltaBuilder_.mergeFrom(value); + } + if (stateDelta_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearStateDelta() { + bitField0_ = (bitField0_ & ~0x00000002); + stateDelta_ = null; + if (stateDeltaBuilder_ != null) { + stateDeltaBuilder_.dispose(); + stateDeltaBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Struct.Builder getStateDeltaBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetStateDeltaFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StructOrBuilder getStateDeltaOrBuilder() { + if (stateDeltaBuilder_ != null) { + return stateDeltaBuilder_.getMessageOrBuilder(); + } else { + return stateDelta_ == null ? com.google.protobuf.Struct.getDefaultInstance() : stateDelta_; + } + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating the state with the given
+     * delta.
+     * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetStateDeltaFieldBuilder() { + if (stateDeltaBuilder_ == null) { + stateDeltaBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getStateDelta(), getParentForChildren(), isClean()); + stateDelta_ = null; + } + return stateDeltaBuilder_; + } + + private com.google.protobuf.MapField artifactDelta_; + + private com.google.protobuf.MapField + internalGetArtifactDelta() { + if (artifactDelta_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ArtifactDeltaDefaultEntryHolder.defaultEntry); + } + return artifactDelta_; + } + + private com.google.protobuf.MapField + internalGetMutableArtifactDelta() { + if (artifactDelta_ == null) { + artifactDelta_ = + com.google.protobuf.MapField.newMapField(ArtifactDeltaDefaultEntryHolder.defaultEntry); + } + if (!artifactDelta_.isMutable()) { + artifactDelta_ = artifactDelta_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return artifactDelta_; + } + + public int getArtifactDeltaCount() { + return internalGetArtifactDelta().getMap().size(); + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsArtifactDelta(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetArtifactDelta().getMap().containsKey(key); + } + + /** Use {@link #getArtifactDeltaMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getArtifactDelta() { + return getArtifactDeltaMap(); + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getArtifactDeltaMap() { + return internalGetArtifactDelta().getMap(); + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getArtifactDeltaOrDefault(java.lang.String key, int defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetArtifactDelta().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getArtifactDeltaOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetArtifactDelta().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearArtifactDelta() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableArtifactDelta().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeArtifactDelta(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableArtifactDelta().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableArtifactDelta() { + bitField0_ |= 0x00000004; + return internalGetMutableArtifactDelta().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putArtifactDelta(java.lang.String key, int value) { + if (key == null) { + throw new NullPointerException("map key"); + } + + internalGetMutableArtifactDelta().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * Optional. Indicates that the event is updating an artifact. key is the
+     * filename, value is the version.
+     * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllArtifactDelta(java.util.Map values) { + internalGetMutableArtifactDelta().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + private boolean escalate_; + + /** + * + * + *
+     * Optional. The agent is escalating to a higher level agent.
+     * 
+ * + * bool escalate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The escalate. + */ + @java.lang.Override + public boolean getEscalate() { + return escalate_; + } + + /** + * + * + *
+     * Optional. The agent is escalating to a higher level agent.
+     * 
+ * + * bool escalate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The escalate to set. + * @return This builder for chaining. + */ + public Builder setEscalate(boolean value) { + + escalate_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The agent is escalating to a higher level agent.
+     * 
+ * + * bool escalate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearEscalate() { + bitField0_ = (bitField0_ & ~0x00000008); + escalate_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Struct requestedAuthConfigs_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + requestedAuthConfigsBuilder_; + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the requestedAuthConfigs field is set. + */ + public boolean hasRequestedAuthConfigs() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The requestedAuthConfigs. + */ + public com.google.protobuf.Struct getRequestedAuthConfigs() { + if (requestedAuthConfigsBuilder_ == null) { + return requestedAuthConfigs_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : requestedAuthConfigs_; + } else { + return requestedAuthConfigsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRequestedAuthConfigs(com.google.protobuf.Struct value) { + if (requestedAuthConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestedAuthConfigs_ = value; + } else { + requestedAuthConfigsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRequestedAuthConfigs(com.google.protobuf.Struct.Builder builderForValue) { + if (requestedAuthConfigsBuilder_ == null) { + requestedAuthConfigs_ = builderForValue.build(); + } else { + requestedAuthConfigsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRequestedAuthConfigs(com.google.protobuf.Struct value) { + if (requestedAuthConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && requestedAuthConfigs_ != null + && requestedAuthConfigs_ != com.google.protobuf.Struct.getDefaultInstance()) { + getRequestedAuthConfigsBuilder().mergeFrom(value); + } else { + requestedAuthConfigs_ = value; + } + } else { + requestedAuthConfigsBuilder_.mergeFrom(value); + } + if (requestedAuthConfigs_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRequestedAuthConfigs() { + bitField0_ = (bitField0_ & ~0x00000010); + requestedAuthConfigs_ = null; + if (requestedAuthConfigsBuilder_ != null) { + requestedAuthConfigsBuilder_.dispose(); + requestedAuthConfigsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Struct.Builder getRequestedAuthConfigsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetRequestedAuthConfigsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StructOrBuilder getRequestedAuthConfigsOrBuilder() { + if (requestedAuthConfigsBuilder_ != null) { + return requestedAuthConfigsBuilder_.getMessageOrBuilder(); + } else { + return requestedAuthConfigs_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : requestedAuthConfigs_; + } + } + + /** + * + * + *
+     * Optional. Will only be set by a tool response indicating tool request euc.
+     * Struct key is the function call id since one function call response (from
+     * model) could correspond to multiple function calls. Struct value is the
+     * required auth config, which can be another struct.
+     * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetRequestedAuthConfigsFieldBuilder() { + if (requestedAuthConfigsBuilder_ == null) { + requestedAuthConfigsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getRequestedAuthConfigs(), getParentForChildren(), isClean()); + requestedAuthConfigs_ = null; + } + return requestedAuthConfigsBuilder_; + } + + private java.lang.Object transferAgent_ = ""; + + /** + * + * + *
+     * Optional. If set, the event transfers to the specified agent.
+     * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The transferAgent. + */ + public java.lang.String getTransferAgent() { + java.lang.Object ref = transferAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transferAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If set, the event transfers to the specified agent.
+     * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for transferAgent. + */ + public com.google.protobuf.ByteString getTransferAgentBytes() { + java.lang.Object ref = transferAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + transferAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If set, the event transfers to the specified agent.
+     * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The transferAgent to set. + * @return This builder for chaining. + */ + public Builder setTransferAgent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + transferAgent_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, the event transfers to the specified agent.
+     * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTransferAgent() { + transferAgent_ = getDefaultInstance().getTransferAgent(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set, the event transfers to the specified agent.
+     * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for transferAgent to set. + * @return This builder for chaining. + */ + public Builder setTransferAgentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + transferAgent_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.EventActions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.EventActions) + private static final com.google.cloud.aiplatform.v1.EventActions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.EventActions(); + } + + public static com.google.cloud.aiplatform.v1.EventActions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventActions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventActions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventActionsOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventActionsOrBuilder.java new file mode 100644 index 000000000000..1df701ae7abe --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventActionsOrBuilder.java @@ -0,0 +1,242 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface EventActionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.EventActions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. If true, it won't call model to summarize function response.
+   * Only used for function_response event.
+   * 
+ * + * bool skip_summarization = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The skipSummarization. + */ + boolean getSkipSummarization(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating the state with the given
+   * delta.
+   * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the stateDelta field is set. + */ + boolean hasStateDelta(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating the state with the given
+   * delta.
+   * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The stateDelta. + */ + com.google.protobuf.Struct getStateDelta(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating the state with the given
+   * delta.
+   * 
+ * + * .google.protobuf.Struct state_delta = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.StructOrBuilder getStateDeltaOrBuilder(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getArtifactDeltaCount(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsArtifactDelta(java.lang.String key); + + /** Use {@link #getArtifactDeltaMap()} instead. */ + @java.lang.Deprecated + java.util.Map getArtifactDelta(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getArtifactDeltaMap(); + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getArtifactDeltaOrDefault(java.lang.String key, int defaultValue); + + /** + * + * + *
+   * Optional. Indicates that the event is updating an artifact. key is the
+   * filename, value is the version.
+   * 
+ * + * map<string, int32> artifact_delta = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getArtifactDeltaOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. The agent is escalating to a higher level agent.
+   * 
+ * + * bool escalate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The escalate. + */ + boolean getEscalate(); + + /** + * + * + *
+   * Optional. Will only be set by a tool response indicating tool request euc.
+   * Struct key is the function call id since one function call response (from
+   * model) could correspond to multiple function calls. Struct value is the
+   * required auth config, which can be another struct.
+   * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the requestedAuthConfigs field is set. + */ + boolean hasRequestedAuthConfigs(); + + /** + * + * + *
+   * Optional. Will only be set by a tool response indicating tool request euc.
+   * Struct key is the function call id since one function call response (from
+   * model) could correspond to multiple function calls. Struct value is the
+   * required auth config, which can be another struct.
+   * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The requestedAuthConfigs. + */ + com.google.protobuf.Struct getRequestedAuthConfigs(); + + /** + * + * + *
+   * Optional. Will only be set by a tool response indicating tool request euc.
+   * Struct key is the function call id since one function call response (from
+   * model) could correspond to multiple function calls. Struct value is the
+   * required auth config, which can be another struct.
+   * 
+ * + * + * .google.protobuf.Struct requested_auth_configs = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.StructOrBuilder getRequestedAuthConfigsOrBuilder(); + + /** + * + * + *
+   * Optional. If set, the event transfers to the specified agent.
+   * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The transferAgent. + */ + java.lang.String getTransferAgent(); + + /** + * + * + *
+   * Optional. If set, the event transfers to the specified agent.
+   * 
+ * + * string transfer_agent = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for transferAgent. + */ + com.google.protobuf.ByteString getTransferAgentBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventMetadata.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventMetadata.java new file mode 100644 index 000000000000..fd2cda50ec39 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventMetadata.java @@ -0,0 +1,2480 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Metadata relating to a LLM response event.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.EventMetadata} + */ +@com.google.protobuf.Generated +public final class EventMetadata extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.EventMetadata) + EventMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "EventMetadata"); + } + + // Use EventMetadata.newBuilder() to construct. + private EventMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private EventMetadata() { + longRunningToolIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + branch_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.EventMetadata.class, + com.google.cloud.aiplatform.v1.EventMetadata.Builder.class); + } + + private int bitField0_; + public static final int GROUNDING_METADATA_FIELD_NUMBER = 1; + private com.google.cloud.aiplatform.v1.GroundingMetadata groundingMetadata_; + + /** + * + * + *
+   * Optional. Metadata returned to client when grounding is enabled.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the groundingMetadata field is set. + */ + @java.lang.Override + public boolean hasGroundingMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Metadata returned to client when grounding is enabled.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The groundingMetadata. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.GroundingMetadata getGroundingMetadata() { + return groundingMetadata_ == null + ? com.google.cloud.aiplatform.v1.GroundingMetadata.getDefaultInstance() + : groundingMetadata_; + } + + /** + * + * + *
+   * Optional. Metadata returned to client when grounding is enabled.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.GroundingMetadataOrBuilder getGroundingMetadataOrBuilder() { + return groundingMetadata_ == null + ? com.google.cloud.aiplatform.v1.GroundingMetadata.getDefaultInstance() + : groundingMetadata_; + } + + public static final int PARTIAL_FIELD_NUMBER = 2; + private boolean partial_ = false; + + /** + * + * + *
+   * Optional. Indicates whether the text content is part of a unfinished text
+   * stream. Only used for streaming mode and when the content is plain text.
+   * 
+ * + * bool partial = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The partial. + */ + @java.lang.Override + public boolean getPartial() { + return partial_; + } + + public static final int TURN_COMPLETE_FIELD_NUMBER = 3; + private boolean turnComplete_ = false; + + /** + * + * + *
+   * Optional. Indicates whether the response from the model is complete.
+   * Only used for streaming mode.
+   * 
+ * + * bool turn_complete = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The turnComplete. + */ + @java.lang.Override + public boolean getTurnComplete() { + return turnComplete_; + } + + public static final int INTERRUPTED_FIELD_NUMBER = 4; + private boolean interrupted_ = false; + + /** + * + * + *
+   * Optional. Flag indicating that LLM was interrupted when generating the
+   * content. Usually it's due to user interruption during a bidi streaming.
+   * 
+ * + * bool interrupted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interrupted. + */ + @java.lang.Override + public boolean getInterrupted() { + return interrupted_; + } + + public static final int LONG_RUNNING_TOOL_IDS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList longRunningToolIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the longRunningToolIds. + */ + public com.google.protobuf.ProtocolStringList getLongRunningToolIdsList() { + return longRunningToolIds_; + } + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of longRunningToolIds. + */ + public int getLongRunningToolIdsCount() { + return longRunningToolIds_.size(); + } + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The longRunningToolIds at the given index. + */ + public java.lang.String getLongRunningToolIds(int index) { + return longRunningToolIds_.get(index); + } + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the longRunningToolIds at the given index. + */ + public com.google.protobuf.ByteString getLongRunningToolIdsBytes(int index) { + return longRunningToolIds_.getByteString(index); + } + + public static final int BRANCH_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object branch_ = ""; + + /** + * + * + *
+   * Optional. The branch of the event.
+   * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+   * agent_2, and agent_2 is the parent of agent_3.
+   * Branch is used when multiple child agents shouldn't see their siblings'
+   * conversation history.
+   * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The branch. + */ + @java.lang.Override + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The branch of the event.
+   * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+   * agent_2, and agent_2 is the parent of agent_3.
+   * Branch is used when multiple child agents shouldn't see their siblings'
+   * conversation history.
+   * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for branch. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_METADATA_FIELD_NUMBER = 7; + private com.google.protobuf.Struct customMetadata_; + + /** + * + * + *
+   * The custom metadata of the LlmResponse.
+   * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + * + * @return Whether the customMetadata field is set. + */ + @java.lang.Override + public boolean hasCustomMetadata() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The custom metadata of the LlmResponse.
+   * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + * + * @return The customMetadata. + */ + @java.lang.Override + public com.google.protobuf.Struct getCustomMetadata() { + return customMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : customMetadata_; + } + + /** + * + * + *
+   * The custom metadata of the LlmResponse.
+   * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getCustomMetadataOrBuilder() { + return customMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : customMetadata_; + } + + public static final int INPUT_TRANSCRIPTION_FIELD_NUMBER = 10; + private com.google.cloud.aiplatform.v1.Transcription inputTranscription_; + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputTranscription field is set. + */ + @java.lang.Override + public boolean hasInputTranscription() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputTranscription. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Transcription getInputTranscription() { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : inputTranscription_; + } + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.TranscriptionOrBuilder getInputTranscriptionOrBuilder() { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : inputTranscription_; + } + + public static final int OUTPUT_TRANSCRIPTION_FIELD_NUMBER = 11; + private com.google.cloud.aiplatform.v1.Transcription outputTranscription_; + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the outputTranscription field is set. + */ + @java.lang.Override + public boolean hasOutputTranscription() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The outputTranscription. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Transcription getOutputTranscription() { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : outputTranscription_; + } + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.TranscriptionOrBuilder getOutputTranscriptionOrBuilder() { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : outputTranscription_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getGroundingMetadata()); + } + if (partial_ != false) { + output.writeBool(2, partial_); + } + if (turnComplete_ != false) { + output.writeBool(3, turnComplete_); + } + if (interrupted_ != false) { + output.writeBool(4, interrupted_); + } + for (int i = 0; i < longRunningToolIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, longRunningToolIds_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(branch_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 6, branch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(7, getCustomMetadata()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getInputTranscription()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(11, getOutputTranscription()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGroundingMetadata()); + } + if (partial_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, partial_); + } + if (turnComplete_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, turnComplete_); + } + if (interrupted_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, interrupted_); + } + { + int dataSize = 0; + for (int i = 0; i < longRunningToolIds_.size(); i++) { + dataSize += computeStringSizeNoTag(longRunningToolIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getLongRunningToolIdsList().size(); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(branch_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, branch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCustomMetadata()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getInputTranscription()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, getOutputTranscription()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.EventMetadata)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.EventMetadata other = + (com.google.cloud.aiplatform.v1.EventMetadata) obj; + + if (hasGroundingMetadata() != other.hasGroundingMetadata()) return false; + if (hasGroundingMetadata()) { + if (!getGroundingMetadata().equals(other.getGroundingMetadata())) return false; + } + if (getPartial() != other.getPartial()) return false; + if (getTurnComplete() != other.getTurnComplete()) return false; + if (getInterrupted() != other.getInterrupted()) return false; + if (!getLongRunningToolIdsList().equals(other.getLongRunningToolIdsList())) return false; + if (!getBranch().equals(other.getBranch())) return false; + if (hasCustomMetadata() != other.hasCustomMetadata()) return false; + if (hasCustomMetadata()) { + if (!getCustomMetadata().equals(other.getCustomMetadata())) return false; + } + if (hasInputTranscription() != other.hasInputTranscription()) return false; + if (hasInputTranscription()) { + if (!getInputTranscription().equals(other.getInputTranscription())) return false; + } + if (hasOutputTranscription() != other.hasOutputTranscription()) return false; + if (hasOutputTranscription()) { + if (!getOutputTranscription().equals(other.getOutputTranscription())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasGroundingMetadata()) { + hash = (37 * hash) + GROUNDING_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getGroundingMetadata().hashCode(); + } + hash = (37 * hash) + PARTIAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPartial()); + hash = (37 * hash) + TURN_COMPLETE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTurnComplete()); + hash = (37 * hash) + INTERRUPTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInterrupted()); + if (getLongRunningToolIdsCount() > 0) { + hash = (37 * hash) + LONG_RUNNING_TOOL_IDS_FIELD_NUMBER; + hash = (53 * hash) + getLongRunningToolIdsList().hashCode(); + } + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + if (hasCustomMetadata()) { + hash = (37 * hash) + CUSTOM_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCustomMetadata().hashCode(); + } + if (hasInputTranscription()) { + hash = (37 * hash) + INPUT_TRANSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getInputTranscription().hashCode(); + } + if (hasOutputTranscription()) { + hash = (37 * hash) + OUTPUT_TRANSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getOutputTranscription().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.EventMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Metadata relating to a LLM response event.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.EventMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.EventMetadata) + com.google.cloud.aiplatform.v1.EventMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.EventMetadata.class, + com.google.cloud.aiplatform.v1.EventMetadata.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.EventMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetGroundingMetadataFieldBuilder(); + internalGetCustomMetadataFieldBuilder(); + internalGetInputTranscriptionFieldBuilder(); + internalGetOutputTranscriptionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + groundingMetadata_ = null; + if (groundingMetadataBuilder_ != null) { + groundingMetadataBuilder_.dispose(); + groundingMetadataBuilder_ = null; + } + partial_ = false; + turnComplete_ = false; + interrupted_ = false; + longRunningToolIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + branch_ = ""; + customMetadata_ = null; + if (customMetadataBuilder_ != null) { + customMetadataBuilder_.dispose(); + customMetadataBuilder_ = null; + } + inputTranscription_ = null; + if (inputTranscriptionBuilder_ != null) { + inputTranscriptionBuilder_.dispose(); + inputTranscriptionBuilder_ = null; + } + outputTranscription_ = null; + if (outputTranscriptionBuilder_ != null) { + outputTranscriptionBuilder_.dispose(); + outputTranscriptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_EventMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventMetadata getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventMetadata build() { + com.google.cloud.aiplatform.v1.EventMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventMetadata buildPartial() { + com.google.cloud.aiplatform.v1.EventMetadata result = + new com.google.cloud.aiplatform.v1.EventMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.EventMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.groundingMetadata_ = + groundingMetadataBuilder_ == null + ? groundingMetadata_ + : groundingMetadataBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.partial_ = partial_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.turnComplete_ = turnComplete_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.interrupted_ = interrupted_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + longRunningToolIds_.makeImmutable(); + result.longRunningToolIds_ = longRunningToolIds_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.branch_ = branch_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.customMetadata_ = + customMetadataBuilder_ == null ? customMetadata_ : customMetadataBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.inputTranscription_ = + inputTranscriptionBuilder_ == null + ? inputTranscription_ + : inputTranscriptionBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.outputTranscription_ = + outputTranscriptionBuilder_ == null + ? outputTranscription_ + : outputTranscriptionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.EventMetadata) { + return mergeFrom((com.google.cloud.aiplatform.v1.EventMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.EventMetadata other) { + if (other == com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance()) return this; + if (other.hasGroundingMetadata()) { + mergeGroundingMetadata(other.getGroundingMetadata()); + } + if (other.getPartial() != false) { + setPartial(other.getPartial()); + } + if (other.getTurnComplete() != false) { + setTurnComplete(other.getTurnComplete()); + } + if (other.getInterrupted() != false) { + setInterrupted(other.getInterrupted()); + } + if (!other.longRunningToolIds_.isEmpty()) { + if (longRunningToolIds_.isEmpty()) { + longRunningToolIds_ = other.longRunningToolIds_; + bitField0_ |= 0x00000010; + } else { + ensureLongRunningToolIdsIsMutable(); + longRunningToolIds_.addAll(other.longRunningToolIds_); + } + onChanged(); + } + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.hasCustomMetadata()) { + mergeCustomMetadata(other.getCustomMetadata()); + } + if (other.hasInputTranscription()) { + mergeInputTranscription(other.getInputTranscription()); + } + if (other.hasOutputTranscription()) { + mergeOutputTranscription(other.getOutputTranscription()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + internalGetGroundingMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + partial_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + turnComplete_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + interrupted_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLongRunningToolIdsIsMutable(); + longRunningToolIds_.add(s); + break; + } // case 42 + case 50: + { + branch_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + input.readMessage( + internalGetCustomMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 82: + { + input.readMessage( + internalGetInputTranscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetOutputTranscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.aiplatform.v1.GroundingMetadata groundingMetadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.GroundingMetadata, + com.google.cloud.aiplatform.v1.GroundingMetadata.Builder, + com.google.cloud.aiplatform.v1.GroundingMetadataOrBuilder> + groundingMetadataBuilder_; + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the groundingMetadata field is set. + */ + public boolean hasGroundingMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The groundingMetadata. + */ + public com.google.cloud.aiplatform.v1.GroundingMetadata getGroundingMetadata() { + if (groundingMetadataBuilder_ == null) { + return groundingMetadata_ == null + ? com.google.cloud.aiplatform.v1.GroundingMetadata.getDefaultInstance() + : groundingMetadata_; + } else { + return groundingMetadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGroundingMetadata(com.google.cloud.aiplatform.v1.GroundingMetadata value) { + if (groundingMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + groundingMetadata_ = value; + } else { + groundingMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setGroundingMetadata( + com.google.cloud.aiplatform.v1.GroundingMetadata.Builder builderForValue) { + if (groundingMetadataBuilder_ == null) { + groundingMetadata_ = builderForValue.build(); + } else { + groundingMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeGroundingMetadata(com.google.cloud.aiplatform.v1.GroundingMetadata value) { + if (groundingMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && groundingMetadata_ != null + && groundingMetadata_ + != com.google.cloud.aiplatform.v1.GroundingMetadata.getDefaultInstance()) { + getGroundingMetadataBuilder().mergeFrom(value); + } else { + groundingMetadata_ = value; + } + } else { + groundingMetadataBuilder_.mergeFrom(value); + } + if (groundingMetadata_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearGroundingMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + groundingMetadata_ = null; + if (groundingMetadataBuilder_ != null) { + groundingMetadataBuilder_.dispose(); + groundingMetadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.GroundingMetadata.Builder getGroundingMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetGroundingMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.GroundingMetadataOrBuilder + getGroundingMetadataOrBuilder() { + if (groundingMetadataBuilder_ != null) { + return groundingMetadataBuilder_.getMessageOrBuilder(); + } else { + return groundingMetadata_ == null + ? com.google.cloud.aiplatform.v1.GroundingMetadata.getDefaultInstance() + : groundingMetadata_; + } + } + + /** + * + * + *
+     * Optional. Metadata returned to client when grounding is enabled.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.GroundingMetadata, + com.google.cloud.aiplatform.v1.GroundingMetadata.Builder, + com.google.cloud.aiplatform.v1.GroundingMetadataOrBuilder> + internalGetGroundingMetadataFieldBuilder() { + if (groundingMetadataBuilder_ == null) { + groundingMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.GroundingMetadata, + com.google.cloud.aiplatform.v1.GroundingMetadata.Builder, + com.google.cloud.aiplatform.v1.GroundingMetadataOrBuilder>( + getGroundingMetadata(), getParentForChildren(), isClean()); + groundingMetadata_ = null; + } + return groundingMetadataBuilder_; + } + + private boolean partial_; + + /** + * + * + *
+     * Optional. Indicates whether the text content is part of a unfinished text
+     * stream. Only used for streaming mode and when the content is plain text.
+     * 
+ * + * bool partial = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The partial. + */ + @java.lang.Override + public boolean getPartial() { + return partial_; + } + + /** + * + * + *
+     * Optional. Indicates whether the text content is part of a unfinished text
+     * stream. Only used for streaming mode and when the content is plain text.
+     * 
+ * + * bool partial = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The partial to set. + * @return This builder for chaining. + */ + public Builder setPartial(boolean value) { + + partial_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates whether the text content is part of a unfinished text
+     * stream. Only used for streaming mode and when the content is plain text.
+     * 
+ * + * bool partial = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPartial() { + bitField0_ = (bitField0_ & ~0x00000002); + partial_ = false; + onChanged(); + return this; + } + + private boolean turnComplete_; + + /** + * + * + *
+     * Optional. Indicates whether the response from the model is complete.
+     * Only used for streaming mode.
+     * 
+ * + * bool turn_complete = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The turnComplete. + */ + @java.lang.Override + public boolean getTurnComplete() { + return turnComplete_; + } + + /** + * + * + *
+     * Optional. Indicates whether the response from the model is complete.
+     * Only used for streaming mode.
+     * 
+ * + * bool turn_complete = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The turnComplete to set. + * @return This builder for chaining. + */ + public Builder setTurnComplete(boolean value) { + + turnComplete_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Indicates whether the response from the model is complete.
+     * Only used for streaming mode.
+     * 
+ * + * bool turn_complete = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTurnComplete() { + bitField0_ = (bitField0_ & ~0x00000004); + turnComplete_ = false; + onChanged(); + return this; + } + + private boolean interrupted_; + + /** + * + * + *
+     * Optional. Flag indicating that LLM was interrupted when generating the
+     * content. Usually it's due to user interruption during a bidi streaming.
+     * 
+ * + * bool interrupted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interrupted. + */ + @java.lang.Override + public boolean getInterrupted() { + return interrupted_; + } + + /** + * + * + *
+     * Optional. Flag indicating that LLM was interrupted when generating the
+     * content. Usually it's due to user interruption during a bidi streaming.
+     * 
+ * + * bool interrupted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The interrupted to set. + * @return This builder for chaining. + */ + public Builder setInterrupted(boolean value) { + + interrupted_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Flag indicating that LLM was interrupted when generating the
+     * content. Usually it's due to user interruption during a bidi streaming.
+     * 
+ * + * bool interrupted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearInterrupted() { + bitField0_ = (bitField0_ & ~0x00000008); + interrupted_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList longRunningToolIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureLongRunningToolIdsIsMutable() { + if (!longRunningToolIds_.isModifiable()) { + longRunningToolIds_ = new com.google.protobuf.LazyStringArrayList(longRunningToolIds_); + } + bitField0_ |= 0x00000010; + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the longRunningToolIds. + */ + public com.google.protobuf.ProtocolStringList getLongRunningToolIdsList() { + longRunningToolIds_.makeImmutable(); + return longRunningToolIds_; + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of longRunningToolIds. + */ + public int getLongRunningToolIdsCount() { + return longRunningToolIds_.size(); + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The longRunningToolIds at the given index. + */ + public java.lang.String getLongRunningToolIds(int index) { + return longRunningToolIds_.get(index); + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the longRunningToolIds at the given index. + */ + public com.google.protobuf.ByteString getLongRunningToolIdsBytes(int index) { + return longRunningToolIds_.getByteString(index); + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The longRunningToolIds to set. + * @return This builder for chaining. + */ + public Builder setLongRunningToolIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLongRunningToolIdsIsMutable(); + longRunningToolIds_.set(index, value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The longRunningToolIds to add. + * @return This builder for chaining. + */ + public Builder addLongRunningToolIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLongRunningToolIdsIsMutable(); + longRunningToolIds_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The longRunningToolIds to add. + * @return This builder for chaining. + */ + public Builder addAllLongRunningToolIds(java.lang.Iterable values) { + ensureLongRunningToolIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, longRunningToolIds_); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearLongRunningToolIds() { + longRunningToolIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set of ids of the long running function calls.
+     * Agent client will know from this field about which function call is long
+     * running. Only valid for function call event.
+     * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the longRunningToolIds to add. + * @return This builder for chaining. + */ + public Builder addLongRunningToolIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLongRunningToolIdsIsMutable(); + longRunningToolIds_.add(value); + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object branch_ = ""; + + /** + * + * + *
+     * Optional. The branch of the event.
+     * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+     * agent_2, and agent_2 is the parent of agent_3.
+     * Branch is used when multiple child agents shouldn't see their siblings'
+     * conversation history.
+     * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The branch. + */ + public java.lang.String getBranch() { + java.lang.Object ref = branch_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The branch of the event.
+     * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+     * agent_2, and agent_2 is the parent of agent_3.
+     * Branch is used when multiple child agents shouldn't see their siblings'
+     * conversation history.
+     * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString getBranchBytes() { + java.lang.Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The branch of the event.
+     * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+     * agent_2, and agent_2 is the parent of agent_3.
+     * Branch is used when multiple child agents shouldn't see their siblings'
+     * conversation history.
+     * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + branch_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The branch of the event.
+     * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+     * agent_2, and agent_2 is the parent of agent_3.
+     * Branch is used when multiple child agents shouldn't see their siblings'
+     * conversation history.
+     * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearBranch() { + branch_ = getDefaultInstance().getBranch(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The branch of the event.
+     * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+     * agent_2, and agent_2 is the parent of agent_3.
+     * Branch is used when multiple child agents shouldn't see their siblings'
+     * conversation history.
+     * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + branch_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.Struct customMetadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + customMetadataBuilder_; + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + * + * @return Whether the customMetadata field is set. + */ + public boolean hasCustomMetadata() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + * + * @return The customMetadata. + */ + public com.google.protobuf.Struct getCustomMetadata() { + if (customMetadataBuilder_ == null) { + return customMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : customMetadata_; + } else { + return customMetadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + public Builder setCustomMetadata(com.google.protobuf.Struct value) { + if (customMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customMetadata_ = value; + } else { + customMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + public Builder setCustomMetadata(com.google.protobuf.Struct.Builder builderForValue) { + if (customMetadataBuilder_ == null) { + customMetadata_ = builderForValue.build(); + } else { + customMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + public Builder mergeCustomMetadata(com.google.protobuf.Struct value) { + if (customMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && customMetadata_ != null + && customMetadata_ != com.google.protobuf.Struct.getDefaultInstance()) { + getCustomMetadataBuilder().mergeFrom(value); + } else { + customMetadata_ = value; + } + } else { + customMetadataBuilder_.mergeFrom(value); + } + if (customMetadata_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + public Builder clearCustomMetadata() { + bitField0_ = (bitField0_ & ~0x00000040); + customMetadata_ = null; + if (customMetadataBuilder_ != null) { + customMetadataBuilder_.dispose(); + customMetadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + public com.google.protobuf.Struct.Builder getCustomMetadataBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return internalGetCustomMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + public com.google.protobuf.StructOrBuilder getCustomMetadataOrBuilder() { + if (customMetadataBuilder_ != null) { + return customMetadataBuilder_.getMessageOrBuilder(); + } else { + return customMetadata_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : customMetadata_; + } + } + + /** + * + * + *
+     * The custom metadata of the LlmResponse.
+     * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetCustomMetadataFieldBuilder() { + if (customMetadataBuilder_ == null) { + customMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getCustomMetadata(), getParentForChildren(), isClean()); + customMetadata_ = null; + } + return customMetadataBuilder_; + } + + private com.google.cloud.aiplatform.v1.Transcription inputTranscription_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Transcription, + com.google.cloud.aiplatform.v1.Transcription.Builder, + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder> + inputTranscriptionBuilder_; + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputTranscription field is set. + */ + public boolean hasInputTranscription() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputTranscription. + */ + public com.google.cloud.aiplatform.v1.Transcription getInputTranscription() { + if (inputTranscriptionBuilder_ == null) { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : inputTranscription_; + } else { + return inputTranscriptionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInputTranscription(com.google.cloud.aiplatform.v1.Transcription value) { + if (inputTranscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputTranscription_ = value; + } else { + inputTranscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInputTranscription( + com.google.cloud.aiplatform.v1.Transcription.Builder builderForValue) { + if (inputTranscriptionBuilder_ == null) { + inputTranscription_ = builderForValue.build(); + } else { + inputTranscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeInputTranscription(com.google.cloud.aiplatform.v1.Transcription value) { + if (inputTranscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && inputTranscription_ != null + && inputTranscription_ + != com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance()) { + getInputTranscriptionBuilder().mergeFrom(value); + } else { + inputTranscription_ = value; + } + } else { + inputTranscriptionBuilder_.mergeFrom(value); + } + if (inputTranscription_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearInputTranscription() { + bitField0_ = (bitField0_ & ~0x00000080); + inputTranscription_ = null; + if (inputTranscriptionBuilder_ != null) { + inputTranscriptionBuilder_.dispose(); + inputTranscriptionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.Transcription.Builder getInputTranscriptionBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetInputTranscriptionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.TranscriptionOrBuilder getInputTranscriptionOrBuilder() { + if (inputTranscriptionBuilder_ != null) { + return inputTranscriptionBuilder_.getMessageOrBuilder(); + } else { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : inputTranscription_; + } + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Transcription, + com.google.cloud.aiplatform.v1.Transcription.Builder, + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder> + internalGetInputTranscriptionFieldBuilder() { + if (inputTranscriptionBuilder_ == null) { + inputTranscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Transcription, + com.google.cloud.aiplatform.v1.Transcription.Builder, + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder>( + getInputTranscription(), getParentForChildren(), isClean()); + inputTranscription_ = null; + } + return inputTranscriptionBuilder_; + } + + private com.google.cloud.aiplatform.v1.Transcription outputTranscription_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Transcription, + com.google.cloud.aiplatform.v1.Transcription.Builder, + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder> + outputTranscriptionBuilder_; + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the outputTranscription field is set. + */ + public boolean hasOutputTranscription() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The outputTranscription. + */ + public com.google.cloud.aiplatform.v1.Transcription getOutputTranscription() { + if (outputTranscriptionBuilder_ == null) { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : outputTranscription_; + } else { + return outputTranscriptionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOutputTranscription(com.google.cloud.aiplatform.v1.Transcription value) { + if (outputTranscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputTranscription_ = value; + } else { + outputTranscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOutputTranscription( + com.google.cloud.aiplatform.v1.Transcription.Builder builderForValue) { + if (outputTranscriptionBuilder_ == null) { + outputTranscription_ = builderForValue.build(); + } else { + outputTranscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeOutputTranscription(com.google.cloud.aiplatform.v1.Transcription value) { + if (outputTranscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && outputTranscription_ != null + && outputTranscription_ + != com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance()) { + getOutputTranscriptionBuilder().mergeFrom(value); + } else { + outputTranscription_ = value; + } + } else { + outputTranscriptionBuilder_.mergeFrom(value); + } + if (outputTranscription_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearOutputTranscription() { + bitField0_ = (bitField0_ & ~0x00000100); + outputTranscription_ = null; + if (outputTranscriptionBuilder_ != null) { + outputTranscriptionBuilder_.dispose(); + outputTranscriptionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.Transcription.Builder getOutputTranscriptionBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetOutputTranscriptionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.TranscriptionOrBuilder getOutputTranscriptionOrBuilder() { + if (outputTranscriptionBuilder_ != null) { + return outputTranscriptionBuilder_.getMessageOrBuilder(); + } else { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance() + : outputTranscription_; + } + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Transcription, + com.google.cloud.aiplatform.v1.Transcription.Builder, + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder> + internalGetOutputTranscriptionFieldBuilder() { + if (outputTranscriptionBuilder_ == null) { + outputTranscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Transcription, + com.google.cloud.aiplatform.v1.Transcription.Builder, + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder>( + getOutputTranscription(), getParentForChildren(), isClean()); + outputTranscription_ = null; + } + return outputTranscriptionBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.EventMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.EventMetadata) + private static final com.google.cloud.aiplatform.v1.EventMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.EventMetadata(); + } + + public static com.google.cloud.aiplatform.v1.EventMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventMetadataOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventMetadataOrBuilder.java new file mode 100644 index 000000000000..fe7f0429ab01 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/EventMetadataOrBuilder.java @@ -0,0 +1,336 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface EventMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.EventMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Metadata returned to client when grounding is enabled.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the groundingMetadata field is set. + */ + boolean hasGroundingMetadata(); + + /** + * + * + *
+   * Optional. Metadata returned to client when grounding is enabled.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The groundingMetadata. + */ + com.google.cloud.aiplatform.v1.GroundingMetadata getGroundingMetadata(); + + /** + * + * + *
+   * Optional. Metadata returned to client when grounding is enabled.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.GroundingMetadata grounding_metadata = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.GroundingMetadataOrBuilder getGroundingMetadataOrBuilder(); + + /** + * + * + *
+   * Optional. Indicates whether the text content is part of a unfinished text
+   * stream. Only used for streaming mode and when the content is plain text.
+   * 
+ * + * bool partial = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The partial. + */ + boolean getPartial(); + + /** + * + * + *
+   * Optional. Indicates whether the response from the model is complete.
+   * Only used for streaming mode.
+   * 
+ * + * bool turn_complete = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The turnComplete. + */ + boolean getTurnComplete(); + + /** + * + * + *
+   * Optional. Flag indicating that LLM was interrupted when generating the
+   * content. Usually it's due to user interruption during a bidi streaming.
+   * 
+ * + * bool interrupted = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The interrupted. + */ + boolean getInterrupted(); + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the longRunningToolIds. + */ + java.util.List getLongRunningToolIdsList(); + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of longRunningToolIds. + */ + int getLongRunningToolIdsCount(); + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The longRunningToolIds at the given index. + */ + java.lang.String getLongRunningToolIds(int index); + + /** + * + * + *
+   * Optional. Set of ids of the long running function calls.
+   * Agent client will know from this field about which function call is long
+   * running. Only valid for function call event.
+   * 
+ * + * repeated string long_running_tool_ids = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the longRunningToolIds at the given index. + */ + com.google.protobuf.ByteString getLongRunningToolIdsBytes(int index); + + /** + * + * + *
+   * Optional. The branch of the event.
+   * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+   * agent_2, and agent_2 is the parent of agent_3.
+   * Branch is used when multiple child agents shouldn't see their siblings'
+   * conversation history.
+   * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The branch. + */ + java.lang.String getBranch(); + + /** + * + * + *
+   * Optional. The branch of the event.
+   * The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of
+   * agent_2, and agent_2 is the parent of agent_3.
+   * Branch is used when multiple child agents shouldn't see their siblings'
+   * conversation history.
+   * 
+ * + * string branch = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for branch. + */ + com.google.protobuf.ByteString getBranchBytes(); + + /** + * + * + *
+   * The custom metadata of the LlmResponse.
+   * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + * + * @return Whether the customMetadata field is set. + */ + boolean hasCustomMetadata(); + + /** + * + * + *
+   * The custom metadata of the LlmResponse.
+   * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + * + * @return The customMetadata. + */ + com.google.protobuf.Struct getCustomMetadata(); + + /** + * + * + *
+   * The custom metadata of the LlmResponse.
+   * 
+ * + * .google.protobuf.Struct custom_metadata = 7; + */ + com.google.protobuf.StructOrBuilder getCustomMetadataOrBuilder(); + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputTranscription field is set. + */ + boolean hasInputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputTranscription. + */ + com.google.cloud.aiplatform.v1.Transcription getInputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder getInputTranscriptionOrBuilder(); + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the outputTranscription field is set. + */ + boolean hasOutputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The outputTranscription. + */ + com.google.cloud.aiplatform.v1.Transcription getOutputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder getOutputTranscriptionOrBuilder(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/GetSessionRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/GetSessionRequest.java new file mode 100644 index 000000000000..a7a124bd32af --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/GetSessionRequest.java @@ -0,0 +1,626 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.GetSession][google.cloud.aiplatform.v1.SessionService.GetSession].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.GetSessionRequest} + */ +@com.google.protobuf.Generated +public final class GetSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.GetSessionRequest) + GetSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "GetSessionRequest"); + } + + // Use GetSessionRequest.newBuilder() to construct. + private GetSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private GetSessionRequest() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.GetSessionRequest.class, + com.google.cloud.aiplatform.v1.GetSessionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.GetSessionRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.GetSessionRequest other = + (com.google.cloud.aiplatform.v1.GetSessionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.GetSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.GetSession][google.cloud.aiplatform.v1.SessionService.GetSession].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.GetSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.GetSessionRequest) + com.google.cloud.aiplatform.v1.GetSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_GetSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_GetSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.GetSessionRequest.class, + com.google.cloud.aiplatform.v1.GetSessionRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.GetSessionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_GetSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.GetSessionRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.GetSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.GetSessionRequest build() { + com.google.cloud.aiplatform.v1.GetSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.GetSessionRequest buildPartial() { + com.google.cloud.aiplatform.v1.GetSessionRequest result = + new com.google.cloud.aiplatform.v1.GetSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.GetSessionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.GetSessionRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.GetSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.GetSessionRequest other) { + if (other == com.google.cloud.aiplatform.v1.GetSessionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.GetSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.GetSessionRequest) + private static final com.google.cloud.aiplatform.v1.GetSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.GetSessionRequest(); + } + + public static com.google.cloud.aiplatform.v1.GetSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.GetSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/GetSessionRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/GetSessionRequestOrBuilder.java new file mode 100644 index 000000000000..6ed078aa54a9 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/GetSessionRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface GetSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.GetSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the session.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsRequest.java new file mode 100644 index 000000000000..98aca7402900 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsRequest.java @@ -0,0 +1,1389 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListEventsRequest} + */ +@com.google.protobuf.Generated +public final class ListEventsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ListEventsRequest) + ListEventsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListEventsRequest"); + } + + // Use ListEventsRequest.newBuilder() to construct. + private ListEventsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListEventsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListEventsRequest.class, + com.google.cloud.aiplatform.v1.ListEventsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource name of the session to list events from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the session to list events from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of events to return. The service may return
+   * fewer than this value. If unspecified, at most 100 events will be returned.
+   * These events are ordered by timestamp in ascending order.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+   * the timestamp is in RFC 3339 format)
+   *
+   * More detail in [AIP-160](https://google.aip.dev/160).
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+   * the timestamp is in RFC 3339 format)
+   *
+   * More detail in [AIP-160](https://google.aip.dev/160).
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `timestamp`
+   *
+   * Example: `timestamp desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `timestamp`
+   *
+   * Example: `timestamp desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.ListEventsRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ListEventsRequest other = + (com.google.cloud.aiplatform.v1.ListEventsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.ListEventsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListEventsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ListEventsRequest) + com.google.cloud.aiplatform.v1.ListEventsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListEventsRequest.class, + com.google.cloud.aiplatform.v1.ListEventsRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.ListEventsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ListEventsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsRequest build() { + com.google.cloud.aiplatform.v1.ListEventsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsRequest buildPartial() { + com.google.cloud.aiplatform.v1.ListEventsRequest result = + new com.google.cloud.aiplatform.v1.ListEventsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.ListEventsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.ListEventsRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.ListEventsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.ListEventsRequest other) { + if (other == com.google.cloud.aiplatform.v1.ListEventsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource name of the session to list events from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session to list events from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the session to list events from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session to list events from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the session to list events from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of events to return. The service may return
+     * fewer than this value. If unspecified, at most 100 events will be returned.
+     * These events are ordered by timestamp in ascending order.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of events to return. The service may return
+     * fewer than this value. If unspecified, at most 100 events will be returned.
+     * These events are ordered by timestamp in ascending order.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of events to return. The service may return
+     * fewer than this value. If unspecified, at most 100 events will be returned.
+     * These events are ordered by timestamp in ascending order.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+     * the timestamp is in RFC 3339 format)
+     *
+     * More detail in [AIP-160](https://google.aip.dev/160).
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+     * the timestamp is in RFC 3339 format)
+     *
+     * More detail in [AIP-160](https://google.aip.dev/160).
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+     * the timestamp is in RFC 3339 format)
+     *
+     * More detail in [AIP-160](https://google.aip.dev/160).
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+     * the timestamp is in RFC 3339 format)
+     *
+     * More detail in [AIP-160](https://google.aip.dev/160).
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+     * the timestamp is in RFC 3339 format)
+     *
+     * More detail in [AIP-160](https://google.aip.dev/160).
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `timestamp`
+     *
+     * Example: `timestamp desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `timestamp`
+     *
+     * Example: `timestamp desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `timestamp`
+     *
+     * Example: `timestamp desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `timestamp`
+     *
+     * Example: `timestamp desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `timestamp`
+     *
+     * Example: `timestamp desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ListEventsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ListEventsRequest) + private static final com.google.cloud.aiplatform.v1.ListEventsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.ListEventsRequest(); + } + + public static com.google.cloud.aiplatform.v1.ListEventsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEventsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsRequestOrBuilder.java new file mode 100644 index 000000000000..c3ee122227e8 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsRequestOrBuilder.java @@ -0,0 +1,181 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface ListEventsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ListEventsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the session to list events from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource name of the session to list events from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of events to return. The service may return
+   * fewer than this value. If unspecified, at most 100 events will be returned.
+   * These events are ordered by timestamp in ascending order.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+   * the timestamp is in RFC 3339 format)
+   *
+   * More detail in [AIP-160](https://google.aip.dev/160).
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where
+   * the timestamp is in RFC 3339 format)
+   *
+   * More detail in [AIP-160](https://google.aip.dev/160).
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `timestamp`
+   *
+   * Example: `timestamp desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `timestamp`
+   *
+   * Example: `timestamp desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsResponse.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsResponse.java new file mode 100644 index 000000000000..a45d297f6979 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsResponse.java @@ -0,0 +1,1163 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Response message for
+ * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListEventsResponse} + */ +@com.google.protobuf.Generated +public final class ListEventsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ListEventsResponse) + ListEventsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListEventsResponse"); + } + + // Use ListEventsResponse.newBuilder() to construct. + private ListEventsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListEventsResponse() { + sessionEvents_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListEventsResponse.class, + com.google.cloud.aiplatform.v1.ListEventsResponse.Builder.class); + } + + public static final int SESSION_EVENTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List sessionEvents_; + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + @java.lang.Override + public java.util.List getSessionEventsList() { + return sessionEvents_; + } + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + @java.lang.Override + public java.util.List + getSessionEventsOrBuilderList() { + return sessionEvents_; + } + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + @java.lang.Override + public int getSessionEventsCount() { + return sessionEvents_.size(); + } + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEvent getSessionEvents(int index) { + return sessionEvents_.get(index); + } + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEventOrBuilder getSessionEventsOrBuilder(int index) { + return sessionEvents_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < sessionEvents_.size(); i++) { + output.writeMessage(1, sessionEvents_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sessionEvents_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sessionEvents_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.ListEventsResponse)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ListEventsResponse other = + (com.google.cloud.aiplatform.v1.ListEventsResponse) obj; + + if (!getSessionEventsList().equals(other.getSessionEventsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSessionEventsCount() > 0) { + hash = (37 * hash) + SESSION_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + getSessionEventsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.ListEventsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListEventsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ListEventsResponse) + com.google.cloud.aiplatform.v1.ListEventsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListEventsResponse.class, + com.google.cloud.aiplatform.v1.ListEventsResponse.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.ListEventsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sessionEventsBuilder_ == null) { + sessionEvents_ = java.util.Collections.emptyList(); + } else { + sessionEvents_ = null; + sessionEventsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListEventsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsResponse getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ListEventsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsResponse build() { + com.google.cloud.aiplatform.v1.ListEventsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsResponse buildPartial() { + com.google.cloud.aiplatform.v1.ListEventsResponse result = + new com.google.cloud.aiplatform.v1.ListEventsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.ListEventsResponse result) { + if (sessionEventsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessionEvents_ = java.util.Collections.unmodifiableList(sessionEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessionEvents_ = sessionEvents_; + } else { + result.sessionEvents_ = sessionEventsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.ListEventsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.ListEventsResponse) { + return mergeFrom((com.google.cloud.aiplatform.v1.ListEventsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.ListEventsResponse other) { + if (other == com.google.cloud.aiplatform.v1.ListEventsResponse.getDefaultInstance()) + return this; + if (sessionEventsBuilder_ == null) { + if (!other.sessionEvents_.isEmpty()) { + if (sessionEvents_.isEmpty()) { + sessionEvents_ = other.sessionEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionEventsIsMutable(); + sessionEvents_.addAll(other.sessionEvents_); + } + onChanged(); + } + } else { + if (!other.sessionEvents_.isEmpty()) { + if (sessionEventsBuilder_.isEmpty()) { + sessionEventsBuilder_.dispose(); + sessionEventsBuilder_ = null; + sessionEvents_ = other.sessionEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionEventsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSessionEventsFieldBuilder() + : null; + } else { + sessionEventsBuilder_.addAllMessages(other.sessionEvents_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.aiplatform.v1.SessionEvent m = + input.readMessage( + com.google.cloud.aiplatform.v1.SessionEvent.parser(), extensionRegistry); + if (sessionEventsBuilder_ == null) { + ensureSessionEventsIsMutable(); + sessionEvents_.add(m); + } else { + sessionEventsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List sessionEvents_ = + java.util.Collections.emptyList(); + + private void ensureSessionEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessionEvents_ = + new java.util.ArrayList(sessionEvents_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.aiplatform.v1.SessionEvent, + com.google.cloud.aiplatform.v1.SessionEvent.Builder, + com.google.cloud.aiplatform.v1.SessionEventOrBuilder> + sessionEventsBuilder_; + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public java.util.List getSessionEventsList() { + if (sessionEventsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessionEvents_); + } else { + return sessionEventsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public int getSessionEventsCount() { + if (sessionEventsBuilder_ == null) { + return sessionEvents_.size(); + } else { + return sessionEventsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public com.google.cloud.aiplatform.v1.SessionEvent getSessionEvents(int index) { + if (sessionEventsBuilder_ == null) { + return sessionEvents_.get(index); + } else { + return sessionEventsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder setSessionEvents(int index, com.google.cloud.aiplatform.v1.SessionEvent value) { + if (sessionEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEventsIsMutable(); + sessionEvents_.set(index, value); + onChanged(); + } else { + sessionEventsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder setSessionEvents( + int index, com.google.cloud.aiplatform.v1.SessionEvent.Builder builderForValue) { + if (sessionEventsBuilder_ == null) { + ensureSessionEventsIsMutable(); + sessionEvents_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionEventsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder addSessionEvents(com.google.cloud.aiplatform.v1.SessionEvent value) { + if (sessionEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEventsIsMutable(); + sessionEvents_.add(value); + onChanged(); + } else { + sessionEventsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder addSessionEvents(int index, com.google.cloud.aiplatform.v1.SessionEvent value) { + if (sessionEventsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionEventsIsMutable(); + sessionEvents_.add(index, value); + onChanged(); + } else { + sessionEventsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder addSessionEvents( + com.google.cloud.aiplatform.v1.SessionEvent.Builder builderForValue) { + if (sessionEventsBuilder_ == null) { + ensureSessionEventsIsMutable(); + sessionEvents_.add(builderForValue.build()); + onChanged(); + } else { + sessionEventsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder addSessionEvents( + int index, com.google.cloud.aiplatform.v1.SessionEvent.Builder builderForValue) { + if (sessionEventsBuilder_ == null) { + ensureSessionEventsIsMutable(); + sessionEvents_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionEventsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder addAllSessionEvents( + java.lang.Iterable values) { + if (sessionEventsBuilder_ == null) { + ensureSessionEventsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessionEvents_); + onChanged(); + } else { + sessionEventsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder clearSessionEvents() { + if (sessionEventsBuilder_ == null) { + sessionEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionEventsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public Builder removeSessionEvents(int index) { + if (sessionEventsBuilder_ == null) { + ensureSessionEventsIsMutable(); + sessionEvents_.remove(index); + onChanged(); + } else { + sessionEventsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public com.google.cloud.aiplatform.v1.SessionEvent.Builder getSessionEventsBuilder(int index) { + return internalGetSessionEventsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public com.google.cloud.aiplatform.v1.SessionEventOrBuilder getSessionEventsOrBuilder( + int index) { + if (sessionEventsBuilder_ == null) { + return sessionEvents_.get(index); + } else { + return sessionEventsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public java.util.List + getSessionEventsOrBuilderList() { + if (sessionEventsBuilder_ != null) { + return sessionEventsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessionEvents_); + } + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public com.google.cloud.aiplatform.v1.SessionEvent.Builder addSessionEventsBuilder() { + return internalGetSessionEventsFieldBuilder() + .addBuilder(com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public com.google.cloud.aiplatform.v1.SessionEvent.Builder addSessionEventsBuilder(int index) { + return internalGetSessionEventsFieldBuilder() + .addBuilder(index, com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of events matching the request. Ordered by timestamp in ascending
+     * order.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + public java.util.List + getSessionEventsBuilderList() { + return internalGetSessionEventsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.aiplatform.v1.SessionEvent, + com.google.cloud.aiplatform.v1.SessionEvent.Builder, + com.google.cloud.aiplatform.v1.SessionEventOrBuilder> + internalGetSessionEventsFieldBuilder() { + if (sessionEventsBuilder_ == null) { + sessionEventsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.aiplatform.v1.SessionEvent, + com.google.cloud.aiplatform.v1.SessionEvent.Builder, + com.google.cloud.aiplatform.v1.SessionEventOrBuilder>( + sessionEvents_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + sessionEvents_ = null; + } + return sessionEventsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ListEventsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ListEventsResponse) + private static final com.google.cloud.aiplatform.v1.ListEventsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.ListEventsResponse(); + } + + public static com.google.cloud.aiplatform.v1.ListEventsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListEventsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListEventsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsResponseOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsResponseOrBuilder.java new file mode 100644 index 000000000000..7306d86e2ada --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListEventsResponseOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface ListEventsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ListEventsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + java.util.List getSessionEventsList(); + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + com.google.cloud.aiplatform.v1.SessionEvent getSessionEvents(int index); + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + int getSessionEventsCount(); + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + java.util.List + getSessionEventsOrBuilderList(); + + /** + * + * + *
+   * A list of events matching the request. Ordered by timestamp in ascending
+   * order.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.SessionEvent session_events = 1; + */ + com.google.cloud.aiplatform.v1.SessionEventOrBuilder getSessionEventsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsRequest.java new file mode 100644 index 000000000000..b32f62d6f583 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsRequest.java @@ -0,0 +1,1403 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListSessionsRequest} + */ +@com.google.protobuf.Generated +public final class ListSessionsRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ListSessionsRequest) + ListSessionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSessionsRequest"); + } + + // Use ListSessionsRequest.newBuilder() to construct. + private ListSessionsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSessionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListSessionsRequest.class, + com.google.cloud.aiplatform.v1.ListSessionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource name of the location to list sessions from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the location to list sessions from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of sessions to return. The service may return
+   * fewer than this value. If unspecified, at most 100 sessions will be
+   * returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `display_name`
+   * * `user_id`
+   * * `labels`
+   *
+   * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `display_name`
+   * * `user_id`
+   * * `labels`
+   *
+   * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `create_time`
+   * * `update_time`
+   *
+   * Example: `create_time desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `create_time`
+   * * `update_time`
+   *
+   * Example: `create_time desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.ListSessionsRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ListSessionsRequest other = + (com.google.cloud.aiplatform.v1.ListSessionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.ListSessionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListSessionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ListSessionsRequest) + com.google.cloud.aiplatform.v1.ListSessionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListSessionsRequest.class, + com.google.cloud.aiplatform.v1.ListSessionsRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.ListSessionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ListSessionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsRequest build() { + com.google.cloud.aiplatform.v1.ListSessionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsRequest buildPartial() { + com.google.cloud.aiplatform.v1.ListSessionsRequest result = + new com.google.cloud.aiplatform.v1.ListSessionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.ListSessionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.ListSessionsRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.ListSessionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.ListSessionsRequest other) { + if (other == com.google.cloud.aiplatform.v1.ListSessionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource name of the location to list sessions from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the location to list sessions from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the location to list sessions from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the location to list sessions from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the location to list sessions from.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of sessions to return. The service may return
+     * fewer than this value. If unspecified, at most 100 sessions will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of sessions to return. The service may return
+     * fewer than this value. If unspecified, at most 100 sessions will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of sessions to return. The service may return
+     * fewer than this value. If unspecified, at most 100 sessions will be
+     * returned.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The
+     * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+     * value returned from a previous list
+     * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+     * call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `display_name`
+     * * `user_id`
+     * * `labels`
+     *
+     * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `display_name`
+     * * `user_id`
+     * * `labels`
+     *
+     * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `display_name`
+     * * `user_id`
+     * * `labels`
+     *
+     * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `display_name`
+     * * `user_id`
+     * * `labels`
+     *
+     * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The standard list filter.
+     * Supported fields:
+     * * `display_name`
+     * * `user_id`
+     * * `labels`
+     *
+     * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `create_time`
+     * * `update_time`
+     *
+     * Example: `create_time desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `create_time`
+     * * `update_time`
+     *
+     * Example: `create_time desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `create_time`
+     * * `update_time`
+     *
+     * Example: `create_time desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `create_time`
+     * * `update_time`
+     *
+     * Example: `create_time desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A comma-separated list of fields to order by, sorted in ascending
+     * order. Use "desc" after a field name for descending. Supported fields:
+     * * `create_time`
+     * * `update_time`
+     *
+     * Example: `create_time desc`.
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ListSessionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ListSessionsRequest) + private static final com.google.cloud.aiplatform.v1.ListSessionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.ListSessionsRequest(); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsRequestOrBuilder.java new file mode 100644 index 000000000000..584bfebde9df --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsRequestOrBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface ListSessionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ListSessionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the location to list sessions from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource name of the location to list sessions from.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of sessions to return. The service may return
+   * fewer than this value. If unspecified, at most 100 sessions will be
+   * returned.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. The
+   * [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token]
+   * value returned from a previous list
+   * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]
+   * call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `display_name`
+   * * `user_id`
+   * * `labels`
+   *
+   * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. The standard list filter.
+   * Supported fields:
+   * * `display_name`
+   * * `user_id`
+   * * `labels`
+   *
+   * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `create_time`
+   * * `update_time`
+   *
+   * Example: `create_time desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Optional. A comma-separated list of fields to order by, sorted in ascending
+   * order. Use "desc" after a field name for descending. Supported fields:
+   * * `create_time`
+   * * `update_time`
+   *
+   * Example: `create_time desc`.
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsResponse.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsResponse.java new file mode 100644 index 000000000000..6c614068a93a --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsResponse.java @@ -0,0 +1,1133 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Response message for
+ * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListSessionsResponse} + */ +@com.google.protobuf.Generated +public final class ListSessionsResponse extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ListSessionsResponse) + ListSessionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ListSessionsResponse"); + } + + // Use ListSessionsResponse.newBuilder() to construct. + private ListSessionsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ListSessionsResponse() { + sessions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListSessionsResponse.class, + com.google.cloud.aiplatform.v1.ListSessionsResponse.Builder.class); + } + + public static final int SESSIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List sessions_; + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List getSessionsList() { + return sessions_; + } + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + @java.lang.Override + public java.util.List + getSessionsOrBuilderList() { + return sessions_; + } + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + @java.lang.Override + public int getSessionsCount() { + return sessions_.size(); + } + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session getSessions(int index) { + return sessions_.get(index); + } + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionsOrBuilder(int index) { + return sessions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < sessions_.size(); i++) { + output.writeMessage(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sessions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sessions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.ListSessionsResponse)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ListSessionsResponse other = + (com.google.cloud.aiplatform.v1.ListSessionsResponse) obj; + + if (!getSessionsList().equals(other.getSessionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSessionsCount() > 0) { + hash = (37 * hash) + SESSIONS_FIELD_NUMBER; + hash = (53 * hash) + getSessionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.ListSessionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Response message for
+   * [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ListSessionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ListSessionsResponse) + com.google.cloud.aiplatform.v1.ListSessionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ListSessionsResponse.class, + com.google.cloud.aiplatform.v1.ListSessionsResponse.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.ListSessionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + } else { + sessions_ = null; + sessionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsResponse getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ListSessionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsResponse build() { + com.google.cloud.aiplatform.v1.ListSessionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsResponse buildPartial() { + com.google.cloud.aiplatform.v1.ListSessionsResponse result = + new com.google.cloud.aiplatform.v1.ListSessionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.aiplatform.v1.ListSessionsResponse result) { + if (sessionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sessions_ = java.util.Collections.unmodifiableList(sessions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sessions_ = sessions_; + } else { + result.sessions_ = sessionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.ListSessionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.ListSessionsResponse) { + return mergeFrom((com.google.cloud.aiplatform.v1.ListSessionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.ListSessionsResponse other) { + if (other == com.google.cloud.aiplatform.v1.ListSessionsResponse.getDefaultInstance()) + return this; + if (sessionsBuilder_ == null) { + if (!other.sessions_.isEmpty()) { + if (sessions_.isEmpty()) { + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSessionsIsMutable(); + sessions_.addAll(other.sessions_); + } + onChanged(); + } + } else { + if (!other.sessions_.isEmpty()) { + if (sessionsBuilder_.isEmpty()) { + sessionsBuilder_.dispose(); + sessionsBuilder_ = null; + sessions_ = other.sessions_; + bitField0_ = (bitField0_ & ~0x00000001); + sessionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetSessionsFieldBuilder() + : null; + } else { + sessionsBuilder_.addAllMessages(other.sessions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.aiplatform.v1.Session m = + input.readMessage( + com.google.cloud.aiplatform.v1.Session.parser(), extensionRegistry); + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(m); + } else { + sessionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List sessions_ = + java.util.Collections.emptyList(); + + private void ensureSessionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sessions_ = new java.util.ArrayList(sessions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder> + sessionsBuilder_; + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public java.util.List getSessionsList() { + if (sessionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(sessions_); + } else { + return sessionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public int getSessionsCount() { + if (sessionsBuilder_ == null) { + return sessions_.size(); + } else { + return sessionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public com.google.cloud.aiplatform.v1.Session getSessions(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder setSessions(int index, com.google.cloud.aiplatform.v1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.set(index, value); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder setSessions( + int index, com.google.cloud.aiplatform.v1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.set(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder addSessions(com.google.cloud.aiplatform.v1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(value); + onChanged(); + } else { + sessionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder addSessions(int index, com.google.cloud.aiplatform.v1.Session value) { + if (sessionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSessionsIsMutable(); + sessions_.add(index, value); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder addSessions(com.google.cloud.aiplatform.v1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder addSessions( + int index, com.google.cloud.aiplatform.v1.Session.Builder builderForValue) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.add(index, builderForValue.build()); + onChanged(); + } else { + sessionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder addAllSessions( + java.lang.Iterable values) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sessions_); + onChanged(); + } else { + sessionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder clearSessions() { + if (sessionsBuilder_ == null) { + sessions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sessionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public Builder removeSessions(int index) { + if (sessionsBuilder_ == null) { + ensureSessionsIsMutable(); + sessions_.remove(index); + onChanged(); + } else { + sessionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public com.google.cloud.aiplatform.v1.Session.Builder getSessionsBuilder(int index) { + return internalGetSessionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionsOrBuilder(int index) { + if (sessionsBuilder_ == null) { + return sessions_.get(index); + } else { + return sessionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public java.util.List + getSessionsOrBuilderList() { + if (sessionsBuilder_ != null) { + return sessionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sessions_); + } + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public com.google.cloud.aiplatform.v1.Session.Builder addSessionsBuilder() { + return internalGetSessionsFieldBuilder() + .addBuilder(com.google.cloud.aiplatform.v1.Session.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public com.google.cloud.aiplatform.v1.Session.Builder addSessionsBuilder(int index) { + return internalGetSessionsFieldBuilder() + .addBuilder(index, com.google.cloud.aiplatform.v1.Session.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of sessions matching the request.
+     * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + public java.util.List getSessionsBuilderList() { + return internalGetSessionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder> + internalGetSessionsFieldBuilder() { + if (sessionsBuilder_ == null) { + sessionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder>( + sessions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sessions_ = null; + } + return sessionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * A token, which can be sent as
+     * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+     * to retrieve the next page. Absence of this field indicates there are no
+     * subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ListSessionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ListSessionsResponse) + private static final com.google.cloud.aiplatform.v1.ListSessionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.ListSessionsResponse(); + } + + public static com.google.cloud.aiplatform.v1.ListSessionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSessionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ListSessionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsResponseOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsResponseOrBuilder.java new file mode 100644 index 000000000000..a8982c025e80 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ListSessionsResponseOrBuilder.java @@ -0,0 +1,116 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface ListSessionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ListSessionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + java.util.List getSessionsList(); + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + com.google.cloud.aiplatform.v1.Session getSessions(int index); + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + int getSessionsCount(); + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + java.util.List + getSessionsOrBuilderList(); + + /** + * + * + *
+   * A list of sessions matching the request.
+   * 
+ * + * repeated .google.cloud.aiplatform.v1.Session sessions = 1; + */ + com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * A token, which can be sent as
+   * [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token]
+   * to retrieve the next page. Absence of this field indicates there are no
+   * subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineProto.java index 306c62880c2d..5ebddcce85ed 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineProto.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineProto.java @@ -64,6 +64,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_InlineSource_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_InlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -99,7 +107,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\037google/api/field_behavior.proto\032\031google" + "/api/resource.proto\0320google/cloud/aiplatform/v1/encryption_spec.proto\032(google/cl" + "oud/aiplatform/v1/env_var.proto\0323google/cloud/aiplatform/v1/service_networking.p" - + "roto\032\034google/protobuf/struct.proto\032\037google/protobuf/timestamp.proto\"\333\017\n" + + "roto\032\034google/protobuf/struct.proto\032\037google/protobuf/timestamp.proto\"\362\021\n" + "\023ReasoningEngineSpec\022Z\n" + "\020source_code_spec\030\013 \001(\0132>." + "google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpecH\000\022!\n" @@ -132,7 +140,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005value\030\002 \001(\t:\0028\001B\020\n" + "\016_min_instancesB\020\n" + "\016_max_instancesB\030\n" - + "\026_container_concurrency\032\306\006\n" + + "\026_container_concurrency\032\335\010\n" + "\016SourceCodeSpec\022d\n\r" + "inline_source\030\001 \001(\0132K.google.cloud.aiplatform.v1.Reasoning" + "EngineSpec.SourceCodeSpec.InlineSourceH\000\022y\n" @@ -140,17 +148,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gle.cloud.aiplatform.v1.ReasoningEngineS" + "pec.SourceCodeSpec.DeveloperConnectSourceH\000\022`\n" + "\013python_spec\030\002 \001(\0132I.google.cloud." - + "aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.PythonSpecH\001\032.\n" + + "aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.PythonSpecH\001\022c\n\n" + + "image_spec\030\005 \001(\0132H.google.cloud.aiplatform.v1.Reasoning" + + "EngineSpec.SourceCodeSpec.ImageSpecB\003\340A\001H\001\032.\n" + "\014InlineSource\022\036\n" - + "\016source_archive\030\001 \001(\014B\006\340A\002\340A\004\032\231\001\n" + + "\016source_archive\030\001 \001(\014B\006\340A\002\340A\004\032\257\001\n" + + "\tImageSpec\022p\n\n" + + "build_args\030\001 \003(\0132W.google.cloud.aiplatform.v1.Reason" + + "ingEngineSpec.SourceCodeSpec.ImageSpec.BuildArgsEntryB\003\340A\001\0320\n" + + "\016BuildArgsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\032\231\001\n" + "\026DeveloperConnectConfig\022V\n" + "\023git_repository_link\030\001 \001(\tB9\340A\002\372A3\n" + "1developerconnect.googleapis.com/GitRepositoryLink\022\020\n" + "\003dir\030\002 \001(\tB\003\340A\002\022\025\n" + "\010revision\030\003 \001(\tB\003\340A\002\032\204\001\n" + "\026DeveloperConnectSource\022j\n" - + "\006config\030\001 \001(\0132U.google.cloud.aiplatform.v1.ReasoningEngineSpec.So" - + "urceCodeSpec.DeveloperConnectConfigB\003\340A\002\032\202\001\n\n" + + "\006config\030\001 \001(\0132U.google.cloud.aiplatform.v1.ReasoningEngineSpec.Sou" + + "rceCodeSpec.DeveloperConnectConfigB\003\340A\002\032\202\001\n\n" + "PythonSpec\022\024\n" + "\007version\030\001 \001(\tB\003\340A\001\022\036\n" + "\021entrypoint_module\030\002 \001(\tB\003\340A\001\022\036\n" @@ -164,8 +180,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004name\030\001 \001(\tB\003\340A\010\022\031\n" + "\014display_name\030\002 \001(\tB\003\340A\002\022\030\n" + "\013description\030\007 \001(\tB\003\340A\001\022B\n" - + "\004spec\030\003 \001(\0132/.google.clo" - + "ud.aiplatform.v1.ReasoningEngineSpecB\003\340A\001\0224\n" + + "\004spec\030\003 \001(\0132/.google.clou" + + "d.aiplatform.v1.ReasoningEngineSpecB\003\340A\001\0224\n" + "\013create_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + "\013update_time\030\005" + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\021\n" @@ -177,16 +193,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013LabelsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\t:\0028\001:\237\001\352A\233\001\n" - + ")aiplatform.googleapis.com/ReasoningEngine\022Kprojects/{project}/locations/{l" - + "ocation}/reasoningEngines/{reasoning_eng" - + "ine}*\020reasoningEngines2\017reasoningEngineB\364\002\n" - + "\036com.google.cloud.aiplatform.v1B\024ReasoningEngineProtoP\001Z>cloud.google.com/go/" - + "aiplatform/apiv1/aiplatformpb;aiplatform" - + "pb\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Google" - + "\\Cloud\\AIPlatform\\V1\352\002\035Google::Cloud::AIPlatform::V1\352A\236\001\n" - + "1developerconnect.googleapis.com/GitRepositoryLink\022iprojects/{p" - + "roject}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_re" - + "pository_link}b\006proto3" + + ")aiplatform.googleapis.com/ReasoningEngine\022Kprojects/{project}/locations/{lo" + + "cation}/reasoningEngines/{reasoning_engi" + + "ne}*\020reasoningEngines2\017reasoningEngineB\364\002\n" + + "\036com.google.cloud.aiplatform.v1B\024Reaso" + + "ningEngineProtoP\001Z>cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformp" + + "b\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Google\\" + + "Cloud\\AIPlatform\\V1\352\002\035Google::Cloud::AIPlatform::V1\352A\236\001\n" + + "1developerconnect.googleapis.com/GitRepositoryLink\022iprojects/{pr" + + "oject}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_rep" + + "ository_link}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -251,7 +267,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_descriptor, new java.lang.String[] { - "InlineSource", "DeveloperConnectSource", "PythonSpec", "Source", "LanguageSpec", + "InlineSource", + "DeveloperConnectSource", + "PythonSpec", + "ImageSpec", + "Source", + "LanguageSpec", }); internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_InlineSource_descriptor = internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_descriptor @@ -262,9 +283,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "SourceArchive", }); - internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor = + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor = internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_descriptor .getNestedType(1); + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor, + new java.lang.String[] { + "BuildArgs", + }); + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor = + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor + .getNestedType(0); + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor = + internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_descriptor + .getNestedType(2); internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor, @@ -273,7 +312,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectSource_descriptor = internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_descriptor - .getNestedType(2); + .getNestedType(3); internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectSource_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectSource_descriptor, @@ -282,7 +321,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_PythonSpec_descriptor = internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_descriptor - .getNestedType(3); + .getNestedType(4); internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_PythonSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_PythonSpec_descriptor, diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineSpec.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineSpec.java index 8d59a9ae4ac1..02b188e862df 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineSpec.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ReasoningEngineSpec.java @@ -4798,6 +4798,50 @@ public interface SourceCodeSpecOrBuilder com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.PythonSpecOrBuilder getPythonSpecOrBuilder(); + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the imageSpec field is set. + */ + boolean hasImageSpec(); + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The imageSpec. + */ + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec getImageSpec(); + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder + getImageSpecOrBuilder(); + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.SourceCase getSourceCase(); com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.LanguageSpecCase @@ -5337,45 +5381,920 @@ public Builder setSourceArchive(com.google.protobuf.ByteString value) { * * *
-         * Required. Input only. The application source code archive, provided as
-         * a compressed tarball (.tar.gz) file.
+         * Required. Input only. The application source code archive, provided as
+         * a compressed tarball (.tar.gz) file.
+         * 
+ * + * + * bytes source_archive = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSourceArchive() { + bitField0_ = (bitField0_ & ~0x00000001); + sourceArchive_ = getDefaultInstance().getSourceArchive(); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + private static final com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec + .InlineSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource(); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ImageSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getBuildArgsCount(); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsBuildArgs(java.lang.String key); + + /** Use {@link #getBuildArgsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getBuildArgs(); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getBuildArgsMap(); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getBuildArgsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getBuildArgsOrThrow(java.lang.String key); + } + + /** + * + * + *
+     * The image spec for building an image (within a single build step), based
+     * on the config file (i.e. Dockerfile) in the source directory.
+     * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec} + */ + public static final class ImageSpec extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + ImageSpecOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ImageSpec"); + } + + // Use ImageSpec.newBuilder() to construct. + private ImageSpec(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ImageSpec() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetBuildArgs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.class, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.Builder + .class); + } + + public static final int BUILD_ARGS_FIELD_NUMBER = 1; + + private static final class BuildArgsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.aiplatform.v1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField buildArgs_; + + private com.google.protobuf.MapField + internalGetBuildArgs() { + if (buildArgs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuildArgsDefaultEntryHolder.defaultEntry); + } + return buildArgs_; + } + + public int getBuildArgsCount() { + return internalGetBuildArgs().getMap().size(); + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsBuildArgs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetBuildArgs().getMap().containsKey(key); + } + + /** Use {@link #getBuildArgsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBuildArgs() { + return getBuildArgsMap(); + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getBuildArgsMap() { + return internalGetBuildArgs().getMap(); + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getBuildArgsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getBuildArgsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetBuildArgs(), BuildArgsDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetBuildArgs().getMap().entrySet()) { + com.google.protobuf.MapEntry buildArgs__ = + BuildArgsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, buildArgs__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec other = + (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) obj; + + if (!internalGetBuildArgs().equals(other.internalGetBuildArgs())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetBuildArgs().getMap().isEmpty()) { + hash = (37 * hash) + BUILD_ARGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetBuildArgs().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * The image spec for building an image (within a single build step), based
+       * on the config file (i.e. Dockerfile) in the source directory.
+       * 
+ * + * Protobuf type {@code + * google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetBuildArgs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor + internalGetMutableMapFieldReflection(int number) { + switch (number) { + case 1: + return internalGetMutableBuildArgs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.class, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder.class); + } + + // Construct using + // com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableBuildArgs().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec build() { + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + buildPartial() { + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec result = + new com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.buildArgs_ = internalGetBuildArgs(); + result.buildArgs_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) { + return mergeFrom( + (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec other) { + if (other + == com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance()) return this; + internalGetMutableBuildArgs().mergeFrom(other.internalGetBuildArgs()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry buildArgs__ = + input.readMessage( + BuildArgsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableBuildArgs() + .getMutableMap() + .put(buildArgs__.getKey(), buildArgs__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField buildArgs_; + + private com.google.protobuf.MapField + internalGetBuildArgs() { + if (buildArgs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuildArgsDefaultEntryHolder.defaultEntry); + } + return buildArgs_; + } + + private com.google.protobuf.MapField + internalGetMutableBuildArgs() { + if (buildArgs_ == null) { + buildArgs_ = + com.google.protobuf.MapField.newMapField(BuildArgsDefaultEntryHolder.defaultEntry); + } + if (!buildArgs_.isMutable()) { + buildArgs_ = buildArgs_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return buildArgs_; + } + + public int getBuildArgsCount() { + return internalGetBuildArgs().getMap().size(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsBuildArgs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetBuildArgs().getMap().containsKey(key); + } + + /** Use {@link #getBuildArgsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBuildArgs() { + return getBuildArgsMap(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getBuildArgsMap() { + return internalGetBuildArgs().getMap(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getBuildArgsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getBuildArgsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearBuildArgs() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableBuildArgs().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeBuildArgs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableBuildArgs().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableBuildArgs() { + bitField0_ |= 0x00000001; + return internalGetMutableBuildArgs().getMutableMap(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putBuildArgs(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableBuildArgs().getMutableMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
          * 
* - * - * bytes source_archive = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = INPUT_ONLY]; + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; * - * - * @return This builder for chaining. */ - public Builder clearSourceArchive() { - bitField0_ = (bitField0_ & ~0x00000001); - sourceArchive_ = getDefaultInstance().getSourceArchive(); - onChanged(); + public Builder putAllBuildArgs(java.util.Map values) { + internalGetMutableBuildArgs().getMutableMap().putAll(values); + bitField0_ |= 0x00000001; return this; } - // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) } - // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) private static final com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec - .InlineSource + .ImageSpec DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = - new com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource(); + new com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec(); } - public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource + public static com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public InlineSource parsePartialFrom( + public ImageSpec parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -5395,17 +6314,17 @@ public InlineSource parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.InlineSource + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -8891,6 +9810,7 @@ public enum LanguageSpecCase com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { PYTHON_SPEC(2), + IMAGE_SPEC(5), LANGUAGESPEC_NOT_SET(0); private final int value; @@ -8912,6 +9832,8 @@ public static LanguageSpecCase forNumber(int value) { switch (value) { case 2: return PYTHON_SPEC; + case 5: + return IMAGE_SPEC; case 0: return LANGUAGESPEC_NOT_SET; default: @@ -9129,6 +10051,72 @@ public boolean hasPythonSpec() { .getDefaultInstance(); } + public static final int IMAGE_SPEC_FIELD_NUMBER = 5; + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the imageSpec field is set. + */ + @java.lang.Override + public boolean hasImageSpec() { + return languageSpecCase_ == 5; + } + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The imageSpec. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + getImageSpec() { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder + getImageSpecOrBuilder() { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -9162,6 +10150,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .DeveloperConnectSource) source_); } + if (languageSpecCase_ == 5) { + output.writeMessage( + 5, + (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_); + } getUnknownFields().writeTo(output); } @@ -9193,6 +10187,13 @@ public int getSerializedSize() { .DeveloperConnectSource) source_); } + if (languageSpecCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -9225,6 +10226,9 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getPythonSpec().equals(other.getPythonSpec())) return false; break; + case 5: + if (!getImageSpec().equals(other.getImageSpec())) return false; + break; case 0: default: } @@ -9256,6 +10260,10 @@ public int hashCode() { hash = (37 * hash) + PYTHON_SPEC_FIELD_NUMBER; hash = (53 * hash) + getPythonSpec().hashCode(); break; + case 5: + hash = (37 * hash) + IMAGE_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getImageSpec().hashCode(); + break; case 0: default: } @@ -9411,6 +10419,9 @@ public Builder clear() { if (pythonSpecBuilder_ != null) { pythonSpecBuilder_.clear(); } + if (imageSpecBuilder_ != null) { + imageSpecBuilder_.clear(); + } sourceCase_ = 0; source_ = null; languageSpecCase_ = 0; @@ -9472,6 +10483,9 @@ private void buildPartialOneofs( if (languageSpecCase_ == 2 && pythonSpecBuilder_ != null) { result.languageSpec_ = pythonSpecBuilder_.build(); } + if (languageSpecCase_ == 5 && imageSpecBuilder_ != null) { + result.languageSpec_ = imageSpecBuilder_.build(); + } } @java.lang.Override @@ -9512,6 +10526,11 @@ public Builder mergeFrom( mergePythonSpec(other.getPythonSpec()); break; } + case IMAGE_SPEC: + { + mergeImageSpec(other.getImageSpec()); + break; + } case LANGUAGESPEC_NOT_SET: { break; @@ -9565,6 +10584,13 @@ public Builder mergeFrom( sourceCase_ = 3; break; } // case 26 + case 42: + { + input.readMessage( + internalGetImageSpecFieldBuilder().getBuilder(), extensionRegistry); + languageSpecCase_ = 5; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -10403,6 +11429,263 @@ public Builder clearPythonSpec() { return pythonSpecBuilder_; } + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.Builder, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder> + imageSpecBuilder_; + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the imageSpec field is set. + */ + @java.lang.Override + public boolean hasImageSpec() { + return languageSpecCase_ == 5; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The imageSpec. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + getImageSpec() { + if (imageSpecBuilder_ == null) { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } else { + if (languageSpecCase_ == 5) { + return imageSpecBuilder_.getMessage(); + } + return com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setImageSpec( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec value) { + if (imageSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + languageSpec_ = value; + onChanged(); + } else { + imageSpecBuilder_.setMessage(value); + } + languageSpecCase_ = 5; + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setImageSpec( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.Builder + builderForValue) { + if (imageSpecBuilder_ == null) { + languageSpec_ = builderForValue.build(); + onChanged(); + } else { + imageSpecBuilder_.setMessage(builderForValue.build()); + } + languageSpecCase_ = 5; + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeImageSpec( + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec value) { + if (imageSpecBuilder_ == null) { + if (languageSpecCase_ == 5 + && languageSpec_ + != com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance()) { + languageSpec_ = + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .newBuilder( + (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpec) + languageSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + languageSpec_ = value; + } + onChanged(); + } else { + if (languageSpecCase_ == 5) { + imageSpecBuilder_.mergeFrom(value); + } else { + imageSpecBuilder_.setMessage(value); + } + } + languageSpecCase_ = 5; + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearImageSpec() { + if (imageSpecBuilder_ == null) { + if (languageSpecCase_ == 5) { + languageSpecCase_ = 0; + languageSpec_ = null; + onChanged(); + } + } else { + if (languageSpecCase_ == 5) { + languageSpecCase_ = 0; + languageSpec_ = null; + } + imageSpecBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.Builder + getImageSpecBuilder() { + return internalGetImageSpecFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder + getImageSpecOrBuilder() { + if ((languageSpecCase_ == 5) && (imageSpecBuilder_ != null)) { + return imageSpecBuilder_.getMessageOrBuilder(); + } else { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.Builder, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder> + internalGetImageSpecFieldBuilder() { + if (imageSpecBuilder_ == null) { + if (!(languageSpecCase_ == 5)) { + languageSpec_ = + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + imageSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder, + com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpecOrBuilder>( + (com.google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_, + getParentForChildren(), + isClean()); + languageSpec_ = null; + } + languageSpecCase_ = 5; + onChanged(); + return imageSpecBuilder_; + } + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.ReasoningEngineSpec.SourceCodeSpec) } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Session.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Session.java new file mode 100644 index 000000000000..c9443d09840a --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Session.java @@ -0,0 +1,3084 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * A session contains a set of actions between users and Vertex agents.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Session} + */ +@com.google.protobuf.Generated +public final class Session extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.Session) + SessionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Session"); + } + + // Use Session.newBuilder() to construct. + private Session(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Session() { + name_ = ""; + displayName_ = ""; + userId_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Session_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Session.class, + com.google.cloud.aiplatform.v1.Session.Builder.class); + } + + private int bitField0_; + private int expirationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object expiration_; + + public enum ExpirationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + EXPIRE_TIME(13), + TTL(14), + EXPIRATION_NOT_SET(0); + private final int value; + + private ExpirationCase(int value) { + this.value = value; + } + + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExpirationCase valueOf(int value) { + return forNumber(value); + } + + public static ExpirationCase forNumber(int value) { + switch (value) { + case 13: + return EXPIRE_TIME; + case 14: + return TTL; + case 0: + return EXPIRATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public static final int EXPIRE_TIME_FIELD_NUMBER = 13; + + /** + * + * + *
+   * Optional. Timestamp of when this session is considered expired.
+   * This is *always* provided on output, regardless of what was sent
+   * on input.
+   * The minimum value is 24 hours from the time of creation.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 13; + } + + /** + * + * + *
+   * Optional. Timestamp of when this session is considered expired.
+   * This is *always* provided on output, regardless of what was sent
+   * on input.
+   * The minimum value is 24 hours from the time of creation.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. Timestamp of when this session is considered expired.
+   * This is *always* provided on output, regardless of what was sent
+   * on input.
+   * The minimum value is 24 hours from the time of creation.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + + public static final int TTL_FIELD_NUMBER = 14; + + /** + * + * + *
+   * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
+   * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 14; + } + + /** + * + * + *
+   * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
+   * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
+   * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The resource name of the session.
+   * Format:
+   * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The resource name of the session.
+   * Format:
+   * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. Timestamp when the session was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. Timestamp when the session was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. Timestamp when the session was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. Timestamp when the session was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. Timestamp when the session was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. Timestamp when the session was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + + /** + * + * + *
+   * Optional. The display name of the session.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The display name of the session.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Session_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SESSION_STATE_FIELD_NUMBER = 10; + private com.google.protobuf.Struct sessionState_; + + /** + * + * + *
+   * Optional. Session specific memory which stores key conversation points.
+   * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sessionState field is set. + */ + @java.lang.Override + public boolean hasSessionState() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Session specific memory which stores key conversation points.
+   * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sessionState. + */ + @java.lang.Override + public com.google.protobuf.Struct getSessionState() { + return sessionState_ == null ? com.google.protobuf.Struct.getDefaultInstance() : sessionState_; + } + + /** + * + * + *
+   * Optional. Session specific memory which stores key conversation points.
+   * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getSessionStateOrBuilder() { + return sessionState_ == null ? com.google.protobuf.Struct.getDefaultInstance() : sessionState_; + } + + public static final int USER_ID_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object userId_ = ""; + + /** + * + * + *
+   * Required. Immutable. String id provided by the user
+   * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userId. + */ + @java.lang.Override + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Immutable. String id provided by the user
+   * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for userId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, displayName_); + } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getSessionState()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(userId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 12, userId_); + } + if (expirationCase_ == 13) { + output.writeMessage(13, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 14) { + output.writeMessage(14, (com.google.protobuf.Duration) expiration_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, displayName_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getSessionState()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(userId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(12, userId_); + } + if (expirationCase_ == 13) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 13, (com.google.protobuf.Timestamp) expiration_); + } + if (expirationCase_ == 14) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 14, (com.google.protobuf.Duration) expiration_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.Session)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.Session other = (com.google.cloud.aiplatform.v1.Session) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasSessionState() != other.hasSessionState()) return false; + if (hasSessionState()) { + if (!getSessionState().equals(other.getSessionState())) return false; + } + if (!getUserId().equals(other.getUserId())) return false; + if (!getExpirationCase().equals(other.getExpirationCase())) return false; + switch (expirationCase_) { + case 13: + if (!getExpireTime().equals(other.getExpireTime())) return false; + break; + case 14: + if (!getTtl().equals(other.getTtl())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasSessionState()) { + hash = (37 * hash) + SESSION_STATE_FIELD_NUMBER; + hash = (53 * hash) + getSessionState().hashCode(); + } + hash = (37 * hash) + USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getUserId().hashCode(); + switch (expirationCase_) { + case 13: + hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpireTime().hashCode(); + break; + case 14: + hash = (37 * hash) + TTL_FIELD_NUMBER; + hash = (53 * hash) + getTtl().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Session parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.Session parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.Session parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.Session prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * A session contains a set of actions between users and Vertex agents.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Session} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.Session) + com.google.cloud.aiplatform.v1.SessionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Session_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Session_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Session.class, + com.google.cloud.aiplatform.v1.Session.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.Session.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + internalGetUpdateTimeFieldBuilder(); + internalGetSessionStateFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.clear(); + } + if (ttlBuilder_ != null) { + ttlBuilder_.clear(); + } + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + displayName_ = ""; + internalGetMutableLabels().clear(); + sessionState_ = null; + if (sessionStateBuilder_ != null) { + sessionStateBuilder_.dispose(); + sessionStateBuilder_ = null; + } + userId_ = ""; + expirationCase_ = 0; + expiration_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Session_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.Session.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session build() { + com.google.cloud.aiplatform.v1.Session result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session buildPartial() { + com.google.cloud.aiplatform.v1.Session result = + new com.google.cloud.aiplatform.v1.Session(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.Session result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sessionState_ = + sessionStateBuilder_ == null ? sessionState_ : sessionStateBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.userId_ = userId_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.aiplatform.v1.Session result) { + result.expirationCase_ = expirationCase_; + result.expiration_ = this.expiration_; + if (expirationCase_ == 13 && expireTimeBuilder_ != null) { + result.expiration_ = expireTimeBuilder_.build(); + } + if (expirationCase_ == 14 && ttlBuilder_ != null) { + result.expiration_ = ttlBuilder_.build(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.Session) { + return mergeFrom((com.google.cloud.aiplatform.v1.Session) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.Session other) { + if (other == com.google.cloud.aiplatform.v1.Session.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + bitField0_ |= 0x00000020; + onChanged(); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; + if (other.hasSessionState()) { + mergeSessionState(other.getSessionState()); + } + if (!other.getUserId().isEmpty()) { + userId_ = other.userId_; + bitField0_ |= 0x00000100; + onChanged(); + } + switch (other.getExpirationCase()) { + case EXPIRE_TIME: + { + mergeExpireTime(other.getExpireTime()); + break; + } + case TTL: + { + mergeTtl(other.getTtl()); + break; + } + case EXPIRATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 10 + case 26: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage( + internalGetUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + displayName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 66: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 66 + case 82: + { + input.readMessage( + internalGetSessionStateFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 98: + { + userId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 98 + case 106: + { + input.readMessage( + internalGetExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 13; + break; + } // case 106 + case 114: + { + input.readMessage(internalGetTtlFieldBuilder().getBuilder(), extensionRegistry); + expirationCase_ = 14; + break; + } // case 114 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int expirationCase_ = 0; + private java.lang.Object expiration_; + + public ExpirationCase getExpirationCase() { + return ExpirationCase.forNumber(expirationCase_); + } + + public Builder clearExpiration() { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + expireTimeBuilder_; + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the expireTime field is set. + */ + @java.lang.Override + public boolean hasExpireTime() { + return expirationCase_ == 13; + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The expireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } else { + if (expirationCase_ == 13) { + return expireTimeBuilder_.getMessage(); + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + expireTimeBuilder_.setMessage(value); + } + expirationCase_ = 13; + return this; + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (expireTimeBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + expireTimeBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 13; + return this; + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 13 + && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 13) { + expireTimeBuilder_.mergeFrom(value); + } else { + expireTimeBuilder_.setMessage(value); + } + } + expirationCase_ = 13; + return this; + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExpireTime() { + if (expireTimeBuilder_ == null) { + if (expirationCase_ == 13) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 13) { + expirationCase_ = 0; + expiration_ = null; + } + expireTimeBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { + return internalGetExpireTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { + if ((expirationCase_ == 13) && (expireTimeBuilder_ != null)) { + return expireTimeBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 13) { + return (com.google.protobuf.Timestamp) expiration_; + } + return com.google.protobuf.Timestamp.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Timestamp of when this session is considered expired.
+     * This is *always* provided on output, regardless of what was sent
+     * on input.
+     * The minimum value is 24 hours from the time of creation.
+     * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + if (!(expirationCase_ == 13)) { + expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 13; + onChanged(); + return expireTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + ttlBuilder_; + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the ttl field is set. + */ + @java.lang.Override + public boolean hasTtl() { + return expirationCase_ == 14; + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The ttl. + */ + @java.lang.Override + public com.google.protobuf.Duration getTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } else { + if (expirationCase_ == 14) { + return ttlBuilder_.getMessage(); + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expiration_ = value; + onChanged(); + } else { + ttlBuilder_.setMessage(value); + } + expirationCase_ = 14; + return this; + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { + if (ttlBuilder_ == null) { + expiration_ = builderForValue.build(); + onChanged(); + } else { + ttlBuilder_.setMessage(builderForValue.build()); + } + expirationCase_ = 14; + return this; + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder mergeTtl(com.google.protobuf.Duration value) { + if (ttlBuilder_ == null) { + if (expirationCase_ == 14 + && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { + expiration_ = + com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) + .mergeFrom(value) + .buildPartial(); + } else { + expiration_ = value; + } + onChanged(); + } else { + if (expirationCase_ == 14) { + ttlBuilder_.mergeFrom(value); + } else { + ttlBuilder_.setMessage(value); + } + } + expirationCase_ = 14; + return this; + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public Builder clearTtl() { + if (ttlBuilder_ == null) { + if (expirationCase_ == 14) { + expirationCase_ = 0; + expiration_ = null; + onChanged(); + } + } else { + if (expirationCase_ == 14) { + expirationCase_ = 0; + expiration_ = null; + } + ttlBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + public com.google.protobuf.Duration.Builder getTtlBuilder() { + return internalGetTtlFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { + if ((expirationCase_ == 14) && (ttlBuilder_ != null)) { + return ttlBuilder_.getMessageOrBuilder(); + } else { + if (expirationCase_ == 14) { + return (com.google.protobuf.Duration) expiration_; + } + return com.google.protobuf.Duration.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
+     * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + internalGetTtlFieldBuilder() { + if (ttlBuilder_ == null) { + if (!(expirationCase_ == 14)) { + expiration_ = com.google.protobuf.Duration.getDefaultInstance(); + } + ttlBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); + expiration_ = null; + } + expirationCase_ = 14; + onChanged(); + return ttlBuilder_; + } + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The resource name of the session.
+     * Format:
+     * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the session.
+     * Format:
+     * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the session.
+     * Format:
+     * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the session.
+     * Format:
+     * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the session.
+     * Format:
+     * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return internalGetCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. Timestamp when the session was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. Timestamp when the session was updated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object displayName_ = ""; + + /** + * + * + *
+     * Optional. The display name of the session.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The display name of the session.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The display name of the session.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + displayName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The display name of the session.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The display name of the session.
+     * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + displayName_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + + private com.google.protobuf.Struct sessionState_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + sessionStateBuilder_; + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sessionState field is set. + */ + public boolean hasSessionState() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sessionState. + */ + public com.google.protobuf.Struct getSessionState() { + if (sessionStateBuilder_ == null) { + return sessionState_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : sessionState_; + } else { + return sessionStateBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSessionState(com.google.protobuf.Struct value) { + if (sessionStateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sessionState_ = value; + } else { + sessionStateBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSessionState(com.google.protobuf.Struct.Builder builderForValue) { + if (sessionStateBuilder_ == null) { + sessionState_ = builderForValue.build(); + } else { + sessionStateBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSessionState(com.google.protobuf.Struct value) { + if (sessionStateBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && sessionState_ != null + && sessionState_ != com.google.protobuf.Struct.getDefaultInstance()) { + getSessionStateBuilder().mergeFrom(value); + } else { + sessionState_ = value; + } + } else { + sessionStateBuilder_.mergeFrom(value); + } + if (sessionState_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSessionState() { + bitField0_ = (bitField0_ & ~0x00000080); + sessionState_ = null; + if (sessionStateBuilder_ != null) { + sessionStateBuilder_.dispose(); + sessionStateBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Struct.Builder getSessionStateBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetSessionStateFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.StructOrBuilder getSessionStateOrBuilder() { + if (sessionStateBuilder_ != null) { + return sessionStateBuilder_.getMessageOrBuilder(); + } else { + return sessionState_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : sessionState_; + } + } + + /** + * + * + *
+     * Optional. Session specific memory which stores key conversation points.
+     * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + internalGetSessionStateFieldBuilder() { + if (sessionStateBuilder_ == null) { + sessionStateBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getSessionState(), getParentForChildren(), isClean()); + sessionState_ = null; + } + return sessionStateBuilder_; + } + + private java.lang.Object userId_ = ""; + + /** + * + * + *
+     * Required. Immutable. String id provided by the user
+     * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userId. + */ + public java.lang.String getUserId() { + java.lang.Object ref = userId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. String id provided by the user
+     * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for userId. + */ + public com.google.protobuf.ByteString getUserIdBytes() { + java.lang.Object ref = userId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Immutable. String id provided by the user
+     * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The userId to set. + * @return This builder for chaining. + */ + public Builder setUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + userId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. String id provided by the user
+     * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearUserId() { + userId_ = getDefaultInstance().getUserId(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Immutable. String id provided by the user
+     * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for userId to set. + * @return This builder for chaining. + */ + public Builder setUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + userId_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.Session) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.Session) + private static final com.google.cloud.aiplatform.v1.Session DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.Session(); + } + + public static com.google.cloud.aiplatform.v1.Session getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Session parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionEvent.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionEvent.java new file mode 100644 index 000000000000..f3193f571c75 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionEvent.java @@ -0,0 +1,2577 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * An event represents a message from either the user or agent.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.SessionEvent} + */ +@com.google.protobuf.Generated +public final class SessionEvent extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.SessionEvent) + SessionEventOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionEvent"); + } + + // Use SessionEvent.newBuilder() to construct. + private SessionEvent(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private SessionEvent() { + name_ = ""; + author_ = ""; + invocationId_ = ""; + errorCode_ = ""; + errorMessage_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_SessionEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_SessionEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.SessionEvent.class, + com.google.cloud.aiplatform.v1.SessionEvent.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Identifier. The resource name of the event.
+   * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Identifier. The resource name of the event.
+   * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUTHOR_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object author_ = ""; + + /** + * + * + *
+   * Required. The name of the agent that sent the event, or user.
+   * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The author. + */ + @java.lang.Override + public java.lang.String getAuthor() { + java.lang.Object ref = author_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + author_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the agent that sent the event, or user.
+   * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for author. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorBytes() { + java.lang.Object ref = author_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + author_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 4; + private com.google.cloud.aiplatform.v1.Content content_; + + /** + * + * + *
+   * Optional. Content of the event provided by the author.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. Content of the event provided by the author.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The content. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Content getContent() { + return content_ == null + ? com.google.cloud.aiplatform.v1.Content.getDefaultInstance() + : content_; + } + + /** + * + * + *
+   * Optional. Content of the event provided by the author.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.ContentOrBuilder getContentOrBuilder() { + return content_ == null + ? com.google.cloud.aiplatform.v1.Content.getDefaultInstance() + : content_; + } + + public static final int INVOCATION_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object invocationId_ = ""; + + /** + * + * + *
+   * Required. The invocation id of the event, multiple events can have the same
+   * invocation id.
+   * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The invocationId. + */ + @java.lang.Override + public java.lang.String getInvocationId() { + java.lang.Object ref = invocationId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + invocationId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The invocation id of the event, multiple events can have the same
+   * invocation id.
+   * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for invocationId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInvocationIdBytes() { + java.lang.Object ref = invocationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + invocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTIONS_FIELD_NUMBER = 6; + private com.google.cloud.aiplatform.v1.EventActions actions_; + + /** + * + * + *
+   * Optional. Actions executed by the agent.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the actions field is set. + */ + @java.lang.Override + public boolean hasActions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Actions executed by the agent.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The actions. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventActions getActions() { + return actions_ == null + ? com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance() + : actions_; + } + + /** + * + * + *
+   * Optional. Actions executed by the agent.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventActionsOrBuilder getActionsOrBuilder() { + return actions_ == null + ? com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance() + : actions_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp timestamp_; + + /** + * + * + *
+   * Required. Timestamp when the event was created on client side.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Required. Timestamp when the event was created on client side.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + /** + * + * + *
+   * Required. Timestamp when the event was created on client side.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + public static final int ERROR_CODE_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorCode_ = ""; + + /** + * + * + *
+   * Optional. Error code if the response is an error. Code varies by model.
+   * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorCode. + */ + @java.lang.Override + public java.lang.String getErrorCode() { + java.lang.Object ref = errorCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorCode_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Error code if the response is an error. Code varies by model.
+   * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorCodeBytes() { + java.lang.Object ref = errorCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 10; + + @SuppressWarnings("serial") + private volatile java.lang.Object errorMessage_ = ""; + + /** + * + * + *
+   * Optional. Error message if the response is an error.
+   * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Error message if the response is an error.
+   * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_METADATA_FIELD_NUMBER = 11; + private com.google.cloud.aiplatform.v1.EventMetadata eventMetadata_; + + /** + * + * + *
+   * Optional. Metadata relating to this event.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventMetadata field is set. + */ + @java.lang.Override + public boolean hasEventMetadata() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Metadata relating to this event.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventMetadata. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventMetadata getEventMetadata() { + return eventMetadata_ == null + ? com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance() + : eventMetadata_; + } + + /** + * + * + *
+   * Optional. Metadata relating to this event.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.EventMetadataOrBuilder getEventMetadataOrBuilder() { + return eventMetadata_ == null + ? com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance() + : eventMetadata_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(author_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, author_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getContent()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(invocationId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, invocationId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getActions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(8, getTimestamp()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorCode_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 9, errorCode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorMessage_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 10, errorMessage_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(11, getEventMetadata()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(author_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, author_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getContent()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(invocationId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, invocationId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getActions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getTimestamp()); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorCode_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, errorCode_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(errorMessage_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, errorMessage_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getEventMetadata()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.SessionEvent)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.SessionEvent other = + (com.google.cloud.aiplatform.v1.SessionEvent) obj; + + if (!getName().equals(other.getName())) return false; + if (!getAuthor().equals(other.getAuthor())) return false; + if (hasContent() != other.hasContent()) return false; + if (hasContent()) { + if (!getContent().equals(other.getContent())) return false; + } + if (!getInvocationId().equals(other.getInvocationId())) return false; + if (hasActions() != other.hasActions()) return false; + if (hasActions()) { + if (!getActions().equals(other.getActions())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp().equals(other.getTimestamp())) return false; + } + if (!getErrorCode().equals(other.getErrorCode())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) return false; + if (hasEventMetadata() != other.hasEventMetadata()) return false; + if (hasEventMetadata()) { + if (!getEventMetadata().equals(other.getEventMetadata())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + AUTHOR_FIELD_NUMBER; + hash = (53 * hash) + getAuthor().hashCode(); + if (hasContent()) { + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + } + hash = (37 * hash) + INVOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getInvocationId().hashCode(); + if (hasActions()) { + hash = (37 * hash) + ACTIONS_FIELD_NUMBER; + hash = (53 * hash) + getActions().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + hash = (37 * hash) + ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getErrorCode().hashCode(); + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + if (hasEventMetadata()) { + hash = (37 * hash) + EVENT_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getEventMetadata().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.SessionEvent prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * An event represents a message from either the user or agent.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.SessionEvent} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.SessionEvent) + com.google.cloud.aiplatform.v1.SessionEventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_SessionEvent_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_SessionEvent_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.SessionEvent.class, + com.google.cloud.aiplatform.v1.SessionEvent.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.SessionEvent.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetContentFieldBuilder(); + internalGetActionsFieldBuilder(); + internalGetTimestampFieldBuilder(); + internalGetEventMetadataFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + author_ = ""; + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + invocationId_ = ""; + actions_ = null; + if (actionsBuilder_ != null) { + actionsBuilder_.dispose(); + actionsBuilder_ = null; + } + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + errorCode_ = ""; + errorMessage_ = ""; + eventMetadata_ = null; + if (eventMetadataBuilder_ != null) { + eventMetadataBuilder_.dispose(); + eventMetadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_SessionEvent_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEvent getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEvent build() { + com.google.cloud.aiplatform.v1.SessionEvent result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEvent buildPartial() { + com.google.cloud.aiplatform.v1.SessionEvent result = + new com.google.cloud.aiplatform.v1.SessionEvent(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.SessionEvent result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.author_ = author_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.content_ = contentBuilder_ == null ? content_ : contentBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.invocationId_ = invocationId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.actions_ = actionsBuilder_ == null ? actions_ : actionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.errorCode_ = errorCode_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.errorMessage_ = errorMessage_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.eventMetadata_ = + eventMetadataBuilder_ == null ? eventMetadata_ : eventMetadataBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.SessionEvent) { + return mergeFrom((com.google.cloud.aiplatform.v1.SessionEvent) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.SessionEvent other) { + if (other == com.google.cloud.aiplatform.v1.SessionEvent.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAuthor().isEmpty()) { + author_ = other.author_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasContent()) { + mergeContent(other.getContent()); + } + if (!other.getInvocationId().isEmpty()) { + invocationId_ = other.invocationId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasActions()) { + mergeActions(other.getActions()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (!other.getErrorCode().isEmpty()) { + errorCode_ = other.errorCode_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.hasEventMetadata()) { + mergeEventMetadata(other.getEventMetadata()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + author_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + input.readMessage(internalGetContentFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + invocationId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + input.readMessage(internalGetActionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 66: + { + input.readMessage( + internalGetTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 74: + { + errorCode_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 74 + case 82: + { + errorMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetEventMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 90 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Identifier. The resource name of the event.
+     * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the event.
+     * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Identifier. The resource name of the event.
+     * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the event.
+     * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifier. The resource name of the event.
+     * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object author_ = ""; + + /** + * + * + *
+     * Required. The name of the agent that sent the event, or user.
+     * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The author. + */ + public java.lang.String getAuthor() { + java.lang.Object ref = author_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + author_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the agent that sent the event, or user.
+     * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for author. + */ + public com.google.protobuf.ByteString getAuthorBytes() { + java.lang.Object ref = author_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + author_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the agent that sent the event, or user.
+     * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The author to set. + * @return This builder for chaining. + */ + public Builder setAuthor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + author_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the agent that sent the event, or user.
+     * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAuthor() { + author_ = getDefaultInstance().getAuthor(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the agent that sent the event, or user.
+     * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for author to set. + * @return This builder for chaining. + */ + public Builder setAuthorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + author_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.aiplatform.v1.Content content_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Content, + com.google.cloud.aiplatform.v1.Content.Builder, + com.google.cloud.aiplatform.v1.ContentOrBuilder> + contentBuilder_; + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the content field is set. + */ + public boolean hasContent() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The content. + */ + public com.google.cloud.aiplatform.v1.Content getContent() { + if (contentBuilder_ == null) { + return content_ == null + ? com.google.cloud.aiplatform.v1.Content.getDefaultInstance() + : content_; + } else { + return contentBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContent(com.google.cloud.aiplatform.v1.Content value) { + if (contentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + content_ = value; + } else { + contentBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContent(com.google.cloud.aiplatform.v1.Content.Builder builderForValue) { + if (contentBuilder_ == null) { + content_ = builderForValue.build(); + } else { + contentBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeContent(com.google.cloud.aiplatform.v1.Content value) { + if (contentBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && content_ != null + && content_ != com.google.cloud.aiplatform.v1.Content.getDefaultInstance()) { + getContentBuilder().mergeFrom(value); + } else { + content_ = value; + } + } else { + contentBuilder_.mergeFrom(value); + } + if (content_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearContent() { + bitField0_ = (bitField0_ & ~0x00000004); + content_ = null; + if (contentBuilder_ != null) { + contentBuilder_.dispose(); + contentBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.Content.Builder getContentBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return internalGetContentFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.ContentOrBuilder getContentOrBuilder() { + if (contentBuilder_ != null) { + return contentBuilder_.getMessageOrBuilder(); + } else { + return content_ == null + ? com.google.cloud.aiplatform.v1.Content.getDefaultInstance() + : content_; + } + } + + /** + * + * + *
+     * Optional. Content of the event provided by the author.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Content, + com.google.cloud.aiplatform.v1.Content.Builder, + com.google.cloud.aiplatform.v1.ContentOrBuilder> + internalGetContentFieldBuilder() { + if (contentBuilder_ == null) { + contentBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Content, + com.google.cloud.aiplatform.v1.Content.Builder, + com.google.cloud.aiplatform.v1.ContentOrBuilder>( + getContent(), getParentForChildren(), isClean()); + content_ = null; + } + return contentBuilder_; + } + + private java.lang.Object invocationId_ = ""; + + /** + * + * + *
+     * Required. The invocation id of the event, multiple events can have the same
+     * invocation id.
+     * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The invocationId. + */ + public java.lang.String getInvocationId() { + java.lang.Object ref = invocationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + invocationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The invocation id of the event, multiple events can have the same
+     * invocation id.
+     * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for invocationId. + */ + public com.google.protobuf.ByteString getInvocationIdBytes() { + java.lang.Object ref = invocationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + invocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The invocation id of the event, multiple events can have the same
+     * invocation id.
+     * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The invocationId to set. + * @return This builder for chaining. + */ + public Builder setInvocationId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + invocationId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The invocation id of the event, multiple events can have the same
+     * invocation id.
+     * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInvocationId() { + invocationId_ = getDefaultInstance().getInvocationId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The invocation id of the event, multiple events can have the same
+     * invocation id.
+     * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for invocationId to set. + * @return This builder for chaining. + */ + public Builder setInvocationIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + invocationId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.cloud.aiplatform.v1.EventActions actions_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.EventActions, + com.google.cloud.aiplatform.v1.EventActions.Builder, + com.google.cloud.aiplatform.v1.EventActionsOrBuilder> + actionsBuilder_; + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the actions field is set. + */ + public boolean hasActions() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The actions. + */ + public com.google.cloud.aiplatform.v1.EventActions getActions() { + if (actionsBuilder_ == null) { + return actions_ == null + ? com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance() + : actions_; + } else { + return actionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setActions(com.google.cloud.aiplatform.v1.EventActions value) { + if (actionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + actions_ = value; + } else { + actionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setActions(com.google.cloud.aiplatform.v1.EventActions.Builder builderForValue) { + if (actionsBuilder_ == null) { + actions_ = builderForValue.build(); + } else { + actionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeActions(com.google.cloud.aiplatform.v1.EventActions value) { + if (actionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && actions_ != null + && actions_ != com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance()) { + getActionsBuilder().mergeFrom(value); + } else { + actions_ = value; + } + } else { + actionsBuilder_.mergeFrom(value); + } + if (actions_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearActions() { + bitField0_ = (bitField0_ & ~0x00000010); + actions_ = null; + if (actionsBuilder_ != null) { + actionsBuilder_.dispose(); + actionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.EventActions.Builder getActionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetActionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.EventActionsOrBuilder getActionsOrBuilder() { + if (actionsBuilder_ != null) { + return actionsBuilder_.getMessageOrBuilder(); + } else { + return actions_ == null + ? com.google.cloud.aiplatform.v1.EventActions.getDefaultInstance() + : actions_; + } + } + + /** + * + * + *
+     * Optional. Actions executed by the agent.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.EventActions, + com.google.cloud.aiplatform.v1.EventActions.Builder, + com.google.cloud.aiplatform.v1.EventActionsOrBuilder> + internalGetActionsFieldBuilder() { + if (actionsBuilder_ == null) { + actionsBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.EventActions, + com.google.cloud.aiplatform.v1.EventActions.Builder, + com.google.cloud.aiplatform.v1.EventActionsOrBuilder>( + getActions(), getParentForChildren(), isClean()); + actions_ = null; + } + return actionsBuilder_; + } + + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + timestampBuilder_; + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The timestamp. + */ + public com.google.protobuf.Timestamp getTimestamp() { + if (timestampBuilder_ == null) { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } else { + return timestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && timestamp_ != null + && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000020); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return internalGetTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + + /** + * + * + *
+     * Required. Timestamp when the event was created on client side.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + internalGetTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getTimestamp(), getParentForChildren(), isClean()); + timestamp_ = null; + } + return timestampBuilder_; + } + + private java.lang.Object errorCode_ = ""; + + /** + * + * + *
+     * Optional. Error code if the response is an error. Code varies by model.
+     * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorCode. + */ + public java.lang.String getErrorCode() { + java.lang.Object ref = errorCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Error code if the response is an error. Code varies by model.
+     * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorCode. + */ + public com.google.protobuf.ByteString getErrorCodeBytes() { + java.lang.Object ref = errorCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Error code if the response is an error. Code varies by model.
+     * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The errorCode to set. + * @return This builder for chaining. + */ + public Builder setErrorCode(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorCode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Error code if the response is an error. Code varies by model.
+     * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearErrorCode() { + errorCode_ = getDefaultInstance().getErrorCode(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Error code if the response is an error. Code varies by model.
+     * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for errorCode to set. + * @return This builder for chaining. + */ + public Builder setErrorCodeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorCode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + + /** + * + * + *
+     * Optional. Error message if the response is an error.
+     * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Error message if the response is an error.
+     * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Error message if the response is an error.
+     * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + errorMessage_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Error message if the response is an error.
+     * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + errorMessage_ = getDefaultInstance().getErrorMessage(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Error message if the response is an error.
+     * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + errorMessage_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private com.google.cloud.aiplatform.v1.EventMetadata eventMetadata_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.EventMetadata, + com.google.cloud.aiplatform.v1.EventMetadata.Builder, + com.google.cloud.aiplatform.v1.EventMetadataOrBuilder> + eventMetadataBuilder_; + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventMetadata field is set. + */ + public boolean hasEventMetadata() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventMetadata. + */ + public com.google.cloud.aiplatform.v1.EventMetadata getEventMetadata() { + if (eventMetadataBuilder_ == null) { + return eventMetadata_ == null + ? com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance() + : eventMetadata_; + } else { + return eventMetadataBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventMetadata(com.google.cloud.aiplatform.v1.EventMetadata value) { + if (eventMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventMetadata_ = value; + } else { + eventMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEventMetadata( + com.google.cloud.aiplatform.v1.EventMetadata.Builder builderForValue) { + if (eventMetadataBuilder_ == null) { + eventMetadata_ = builderForValue.build(); + } else { + eventMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeEventMetadata(com.google.cloud.aiplatform.v1.EventMetadata value) { + if (eventMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && eventMetadata_ != null + && eventMetadata_ + != com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance()) { + getEventMetadataBuilder().mergeFrom(value); + } else { + eventMetadata_ = value; + } + } else { + eventMetadataBuilder_.mergeFrom(value); + } + if (eventMetadata_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEventMetadata() { + bitField0_ = (bitField0_ & ~0x00000100); + eventMetadata_ = null; + if (eventMetadataBuilder_ != null) { + eventMetadataBuilder_.dispose(); + eventMetadataBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.EventMetadata.Builder getEventMetadataBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetEventMetadataFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1.EventMetadataOrBuilder getEventMetadataOrBuilder() { + if (eventMetadataBuilder_ != null) { + return eventMetadataBuilder_.getMessageOrBuilder(); + } else { + return eventMetadata_ == null + ? com.google.cloud.aiplatform.v1.EventMetadata.getDefaultInstance() + : eventMetadata_; + } + } + + /** + * + * + *
+     * Optional. Metadata relating to this event.
+     * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.EventMetadata, + com.google.cloud.aiplatform.v1.EventMetadata.Builder, + com.google.cloud.aiplatform.v1.EventMetadataOrBuilder> + internalGetEventMetadataFieldBuilder() { + if (eventMetadataBuilder_ == null) { + eventMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.EventMetadata, + com.google.cloud.aiplatform.v1.EventMetadata.Builder, + com.google.cloud.aiplatform.v1.EventMetadataOrBuilder>( + getEventMetadata(), getParentForChildren(), isClean()); + eventMetadata_ = null; + } + return eventMetadataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.SessionEvent) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.SessionEvent) + private static final com.google.cloud.aiplatform.v1.SessionEvent DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.SessionEvent(); + } + + public static com.google.cloud.aiplatform.v1.SessionEvent getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SessionEvent parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionEvent getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionEventOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionEventOrBuilder.java new file mode 100644 index 000000000000..2b06d88d619b --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionEventOrBuilder.java @@ -0,0 +1,331 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface SessionEventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.SessionEvent) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The resource name of the event.
+   * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The resource name of the event.
+   * Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The name of the agent that sent the event, or user.
+   * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The author. + */ + java.lang.String getAuthor(); + + /** + * + * + *
+   * Required. The name of the agent that sent the event, or user.
+   * 
+ * + * string author = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for author. + */ + com.google.protobuf.ByteString getAuthorBytes(); + + /** + * + * + *
+   * Optional. Content of the event provided by the author.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the content field is set. + */ + boolean hasContent(); + + /** + * + * + *
+   * Optional. Content of the event provided by the author.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The content. + */ + com.google.cloud.aiplatform.v1.Content getContent(); + + /** + * + * + *
+   * Optional. Content of the event provided by the author.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Content content = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.ContentOrBuilder getContentOrBuilder(); + + /** + * + * + *
+   * Required. The invocation id of the event, multiple events can have the same
+   * invocation id.
+   * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The invocationId. + */ + java.lang.String getInvocationId(); + + /** + * + * + *
+   * Required. The invocation id of the event, multiple events can have the same
+   * invocation id.
+   * 
+ * + * string invocation_id = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for invocationId. + */ + com.google.protobuf.ByteString getInvocationIdBytes(); + + /** + * + * + *
+   * Optional. Actions executed by the agent.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the actions field is set. + */ + boolean hasActions(); + + /** + * + * + *
+   * Optional. Actions executed by the agent.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The actions. + */ + com.google.cloud.aiplatform.v1.EventActions getActions(); + + /** + * + * + *
+   * Optional. Actions executed by the agent.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventActions actions = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.EventActionsOrBuilder getActionsOrBuilder(); + + /** + * + * + *
+   * Required. Timestamp when the event was created on client side.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + + /** + * + * + *
+   * Required. Timestamp when the event was created on client side.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + * + * + *
+   * Required. Timestamp when the event was created on client side.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + + /** + * + * + *
+   * Optional. Error code if the response is an error. Code varies by model.
+   * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorCode. + */ + java.lang.String getErrorCode(); + + /** + * + * + *
+   * Optional. Error code if the response is an error. Code varies by model.
+   * 
+ * + * string error_code = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorCode. + */ + com.google.protobuf.ByteString getErrorCodeBytes(); + + /** + * + * + *
+   * Optional. Error message if the response is an error.
+   * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + + /** + * + * + *
+   * Optional. Error message if the response is an error.
+   * 
+ * + * string error_message = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + + /** + * + * + *
+   * Optional. Metadata relating to this event.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the eventMetadata field is set. + */ + boolean hasEventMetadata(); + + /** + * + * + *
+   * Optional. Metadata relating to this event.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The eventMetadata. + */ + com.google.cloud.aiplatform.v1.EventMetadata getEventMetadata(); + + /** + * + * + *
+   * Optional. Metadata relating to this event.
+   * 
+ * + * + * .google.cloud.aiplatform.v1.EventMetadata event_metadata = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1.EventMetadataOrBuilder getEventMetadataOrBuilder(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionName.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionName.java new file mode 100644 index 000000000000..e7fa46a8c2f2 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionName.java @@ -0,0 +1,269 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SessionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_REASONING_ENGINE_SESSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String reasoningEngine; + private final String session; + + @Deprecated + protected SessionName() { + project = null; + location = null; + reasoningEngine = null; + session = null; + } + + private SessionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + reasoningEngine = Preconditions.checkNotNull(builder.getReasoningEngine()); + session = Preconditions.checkNotNull(builder.getSession()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReasoningEngine() { + return reasoningEngine; + } + + public String getSession() { + return session; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SessionName of( + String project, String location, String reasoningEngine, String session) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReasoningEngine(reasoningEngine) + .setSession(session) + .build(); + } + + public static String format( + String project, String location, String reasoningEngine, String session) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setReasoningEngine(reasoningEngine) + .setSession(session) + .build() + .toString(); + } + + public static SessionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_REASONING_ENGINE_SESSION.validatedMatch( + formattedString, "SessionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("reasoning_engine"), + matchMap.get("session")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (SessionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_REASONING_ENGINE_SESSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (reasoningEngine != null) { + fieldMapBuilder.put("reasoning_engine", reasoningEngine); + } + if (session != null) { + fieldMapBuilder.put("session", session); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_REASONING_ENGINE_SESSION.instantiate( + "project", + project, + "location", + location, + "reasoning_engine", + reasoningEngine, + "session", + session); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.reasoningEngine, that.reasoningEngine) + && Objects.equals(this.session, that.session); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(reasoningEngine); + h *= 1000003; + h ^= Objects.hashCode(session); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}. + */ + public static class Builder { + private String project; + private String location; + private String reasoningEngine; + private String session; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getReasoningEngine() { + return reasoningEngine; + } + + public String getSession() { + return session; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setReasoningEngine(String reasoningEngine) { + this.reasoningEngine = reasoningEngine; + return this; + } + + public Builder setSession(String session) { + this.session = session; + return this; + } + + private Builder(SessionName sessionName) { + this.project = sessionName.project; + this.location = sessionName.location; + this.reasoningEngine = sessionName.reasoningEngine; + this.session = sessionName.session; + } + + public SessionName build() { + return new SessionName(this); + } + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionOrBuilder.java new file mode 100644 index 000000000000..086143a1ebe7 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionOrBuilder.java @@ -0,0 +1,424 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface SessionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.Session) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Timestamp of when this session is considered expired.
+   * This is *always* provided on output, regardless of what was sent
+   * on input.
+   * The minimum value is 24 hours from the time of creation.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the expireTime field is set. + */ + boolean hasExpireTime(); + + /** + * + * + *
+   * Optional. Timestamp of when this session is considered expired.
+   * This is *always* provided on output, regardless of what was sent
+   * on input.
+   * The minimum value is 24 hours from the time of creation.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The expireTime. + */ + com.google.protobuf.Timestamp getExpireTime(); + + /** + * + * + *
+   * Optional. Timestamp of when this session is considered expired.
+   * This is *always* provided on output, regardless of what was sent
+   * on input.
+   * The minimum value is 24 hours from the time of creation.
+   * 
+ * + * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
+   * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return Whether the ttl field is set. + */ + boolean hasTtl(); + + /** + * + * + *
+   * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
+   * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + * + * @return The ttl. + */ + com.google.protobuf.Duration getTtl(); + + /** + * + * + *
+   * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
+   * 
+ * + * + * .google.protobuf.Duration ttl = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = INPUT_ONLY]; + * + */ + com.google.protobuf.DurationOrBuilder getTtlOrBuilder(); + + /** + * + * + *
+   * Identifier. The resource name of the session.
+   * Format:
+   * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Identifier. The resource name of the session.
+   * Format:
+   * 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Timestamp when the session was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. Timestamp when the session was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. Timestamp when the session was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp when the session was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. Timestamp when the session was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. Timestamp when the session was updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. The display name of the session.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + + /** + * + * + *
+   * Optional. The display name of the session.
+   * 
+ * + * string display_name = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Session specific memory which stores key conversation points.
+   * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sessionState field is set. + */ + boolean hasSessionState(); + + /** + * + * + *
+   * Optional. Session specific memory which stores key conversation points.
+   * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sessionState. + */ + com.google.protobuf.Struct getSessionState(); + + /** + * + * + *
+   * Optional. Session specific memory which stores key conversation points.
+   * 
+ * + * .google.protobuf.Struct session_state = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.StructOrBuilder getSessionStateOrBuilder(); + + /** + * + * + *
+   * Required. Immutable. String id provided by the user
+   * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The userId. + */ + java.lang.String getUserId(); + + /** + * + * + *
+   * Required. Immutable. String id provided by the user
+   * 
+ * + * + * string user_id = 12 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for userId. + */ + com.google.protobuf.ByteString getUserIdBytes(); + + com.google.cloud.aiplatform.v1.Session.ExpirationCase getExpirationCase(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionProto.java new file mode 100644 index 000000000000..e0fe7690692d --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionProto.java @@ -0,0 +1,271 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public final class SessionProto extends com.google.protobuf.GeneratedFile { + private SessionProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_Session_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_Session_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_Session_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_Session_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_SessionEvent_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_SessionEvent_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_EventMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_EventMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_EventActions_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_EventActions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_EventActions_ArtifactDeltaEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_EventActions_ArtifactDeltaEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_Transcription_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_Transcription_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "(google/cloud/aiplatform/v1/session.pro" + + "to\022\032google.cloud.aiplatform.v1\032\037google/a" + + "pi/field_behavior.proto\032\031google/api/reso" + + "urce.proto\032(google/cloud/aiplatform/v1/c" + + "ontent.proto\032\036google/protobuf/duration.p" + + "roto\032\034google/protobuf/struct.proto\032\037google/protobuf/timestamp.proto\"\366\004\n" + + "\007Session\0226\n" + + "\013expire_time\030\r" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001H\000\0220\n" + + "\003ttl\030\016" + + " \001(\0132\031.google.protobuf.DurationB\006\340A\001\340A\004H\000\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\0224\n" + + "\013create_time\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\004" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\031\n" + + "\014display_name\030\005 \001(\tB\003\340A\001\022?\n" + + "\006labels\030\010 \003(\0132/.google.cloud.aiplatform.v1.Session.LabelsEntry\0223\n\r" + + "session_state\030\n" + + " \001(\0132\027.google.protobuf.StructB\003\340A\001\022\027\n" + + "\007user_id\030\014 \001(\tB\006\340A\005\340A\002\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001:\232\001\352A\226\001\n" + + "!aiplatform.googleapis.com/Session\022^projects/{project}/location" + + "s/{location}/reasoningEngines/{reasoning" + + "_engine}/sessions/{session}*\010sessions2\007sessionB\014\n\n" + + "expiration\"\271\004\n" + + "\014SessionEvent\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\010\022\023\n" + + "\006author\030\003 \001(\tB\003\340A\002\0229\n" + + "\007content\030\004" + + " \001(\0132#.google.cloud.aiplatform.v1.ContentB\003\340A\001\022\032\n\r" + + "invocation_id\030\005 \001(\tB\003\340A\002\022>\n" + + "\007actions\030\006" + + " \001(\0132(.google.cloud.aiplatform.v1.EventActionsB\003\340A\001\0222\n" + + "\ttimestamp\030\010 \001(\0132\032.google.protobuf.TimestampB\003\340A\002\022\027\n\n" + + "error_code\030\t \001(\tB\003\340A\001\022\032\n\r" + + "error_message\030\n" + + " \001(\tB\003\340A\001\022F\n" + + "\016event_metadata\030\013 \001(\0132)." + + "google.cloud.aiplatform.v1.EventMetadataB\003\340A\001:\270\001\352A\264\001\n" + + "&aiplatform.googleapis.com/SessionEvent\022mprojects/{project}/locatio" + + "ns/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}*\r" + + "sessionEvents2\014sessionEvent\"\261\003\n\r" + + "EventMetadata\022N\n" + + "\022grounding_metadata\030\001 \001(\0132-" + + ".google.cloud.aiplatform.v1.GroundingMetadataB\003\340A\001\022\024\n" + + "\007partial\030\002 \001(\010B\003\340A\001\022\032\n\r" + + "turn_complete\030\003 \001(\010B\003\340A\001\022\030\n" + + "\013interrupted\030\004 \001(\010B\003\340A\001\022\"\n" + + "\025long_running_tool_ids\030\005 \003(\tB\003\340A\001\022\023\n" + + "\006branch\030\006 \001(\tB\003\340A\001\0220\n" + + "\017custom_metadata\030\007 \001(\0132\027.google.protobuf.Struct\022K\n" + + "\023input_transcription\030\n" + + " \001(\0132).google.cloud.aiplatform.v1.TranscriptionB\003\340A\001\022L\n" + + "\024output_transcription\030\013" + + " \001(\0132).google.cloud.aiplatform.v1.TranscriptionB\003\340A\001\"\344\002\n" + + "\014EventActions\022\037\n" + + "\022skip_summarization\030\001 \001(\010B\003\340A\001\0221\n" + + "\013state_delta\030\002 \001(\0132\027.google.protobuf.StructB\003\340A\001\022X\n" + + "\016artifact_delta\030\003 \003(\0132;.goog" + + "le.cloud.aiplatform.v1.EventActions.ArtifactDeltaEntryB\003\340A\001\022\025\n" + + "\010escalate\030\006 \001(\010B\003\340A\001\022<\n" + + "\026requested_auth_configs\030\007" + + " \001(\0132\027.google.protobuf.StructB\003\340A\001\022\033\n" + + "\016transfer_agent\030\010 \001(\tB\003\340A\001\0324\n" + + "\022ArtifactDeltaEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\005:\0028\001\"9\n\r" + + "Transcription\022\021\n" + + "\004text\030\001 \001(\tB\003\340A\001\022\025\n" + + "\010finished\030\002 \001(\010B\003\340A\001B\312\001\n" + + "\036com.google.cloud.aiplatform.v1B\014SessionProtoP\001Z>cloud.google.com/go/a" + + "iplatform/apiv1/aiplatformpb;aiplatformp" + + "b\252\002\032Google.Cloud.AIPlatform.V1\312\002\032Google\\" + + "Cloud\\AIPlatform\\V1\352\002\035Google::Cloud::AIPlatform::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.aiplatform.v1.ContentProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_aiplatform_v1_Session_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_aiplatform_v1_Session_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_Session_descriptor, + new java.lang.String[] { + "ExpireTime", + "Ttl", + "Name", + "CreateTime", + "UpdateTime", + "DisplayName", + "Labels", + "SessionState", + "UserId", + "Expiration", + }); + internal_static_google_cloud_aiplatform_v1_Session_LabelsEntry_descriptor = + internal_static_google_cloud_aiplatform_v1_Session_descriptor.getNestedType(0); + internal_static_google_cloud_aiplatform_v1_Session_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_Session_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_aiplatform_v1_SessionEvent_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_aiplatform_v1_SessionEvent_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_SessionEvent_descriptor, + new java.lang.String[] { + "Name", + "Author", + "Content", + "InvocationId", + "Actions", + "Timestamp", + "ErrorCode", + "ErrorMessage", + "EventMetadata", + }); + internal_static_google_cloud_aiplatform_v1_EventMetadata_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_aiplatform_v1_EventMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_EventMetadata_descriptor, + new java.lang.String[] { + "GroundingMetadata", + "Partial", + "TurnComplete", + "Interrupted", + "LongRunningToolIds", + "Branch", + "CustomMetadata", + "InputTranscription", + "OutputTranscription", + }); + internal_static_google_cloud_aiplatform_v1_EventActions_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_aiplatform_v1_EventActions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_EventActions_descriptor, + new java.lang.String[] { + "SkipSummarization", + "StateDelta", + "ArtifactDelta", + "Escalate", + "RequestedAuthConfigs", + "TransferAgent", + }); + internal_static_google_cloud_aiplatform_v1_EventActions_ArtifactDeltaEntry_descriptor = + internal_static_google_cloud_aiplatform_v1_EventActions_descriptor.getNestedType(0); + internal_static_google_cloud_aiplatform_v1_EventActions_ArtifactDeltaEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_EventActions_ArtifactDeltaEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_aiplatform_v1_Transcription_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_aiplatform_v1_Transcription_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_Transcription_descriptor, + new java.lang.String[] { + "Text", "Finished", + }); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.aiplatform.v1.ContentProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceProto.java new file mode 100644 index 000000000000..dfb15de7f7d9 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/SessionServiceProto.java @@ -0,0 +1,313 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public final class SessionServiceProto extends com.google.protobuf.GeneratedFile { + private SessionServiceProto() {} + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "SessionServiceProto"); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_GetSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_GetSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ListEventsRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ListEventsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_ListEventsResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_ListEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_AppendEventRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_AppendEventRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1_AppendEventResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1_AppendEventResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n" + + "0google/cloud/aiplatform/v1/session_ser" + + "vice.proto\022\032google.cloud.aiplatform.v1\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032*googl" + + "e/cloud/aiplatform/v1/operation.proto\032(google/cloud/aiplatform/v1/session.proto\032" + + "#google/longrunning/operations.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\"\224\001\n" + + "\024CreateSessionRequest\022A\n" + + "\006parent\030\001 \001(\tB1\340A\002\372A+\n" + + ")aiplatform.googleapis.com/ReasoningEngine\0229\n" + + "\007session\030\002 \001(\0132#.google.cloud.aiplatform.v1.SessionB\003\340A\002\"p\n" + + "\036CreateSessionOperationMetadata\022N\n" + + "\020generic_metadata\030\001 \001(\01324.google." + + "cloud.aiplatform.v1.GenericOperationMetadata\"L\n" + + "\021GetSessionRequest\0227\n" + + "\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!aiplatform.googleapis.com/Session\"\265\001\n" + + "\023ListSessionsRequest\022A\n" + + "\006parent\030\001 \001(\tB1\340A\002\372A+\n" + + ")aiplatform.googleapis.com/ReasoningEngine\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n" + + "\n" + + "page_token\030\003 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\022\025\n" + + "\010order_by\030\005 \001(\tB\003\340A\001\"f\n" + + "\024ListSessionsResponse\0225\n" + + "\010sessions\030\001 \003(\0132#.google.cloud.aiplatform.v1.Session\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\207\001\n" + + "\024UpdateSessionRequest\0229\n" + + "\007session\030\001" + + " \001(\0132#.google.cloud.aiplatform.v1.SessionB\003\340A\002\0224\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"O\n" + + "\024DeleteSessionRequest\0227\n" + + "\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!aiplatform.googleapis.com/Session\"\253\001\n" + + "\021ListEventsRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002\372A#\n" + + "!aiplatform.googleapis.com/Session\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\004 \001(\tB\003\340A\001\022\025\n" + + "\010order_by\030\005 \001(\tB\003\340A\001\"o\n" + + "\022ListEventsResponse\022@\n" + + "\016session_events\030\001" + + " \003(\0132(.google.cloud.aiplatform.v1.SessionEvent\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\213\001\n" + + "\022AppendEventRequest\0227\n" + + "\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!aiplatform.googleapis.com/Session\022<\n" + + "\005event\030\002" + + " \001(\0132(.google.cloud.aiplatform.v1.SessionEventB\003\340A\002\"\025\n" + + "\023AppendEventResponse2\256\014\n" + + "\016SessionService\022\360\001\n\r" + + "CreateSession\0220.google.cloud.aiplatform.v1.CreateSessio" + + "nRequest\032\035.google.longrunning.Operation\"\215\001\312A)\n" + + "\007Session\022\036CreateSessionOperationMe" + + "tadata\332A\016parent,session\202\323\344\223\002J\"?/v1/{pare" + + "nt=projects/*/locations/*/reasoningEngines/*}/sessions:\007session\022\260\001\n\n" + + "GetSession\022-.google.cloud.aiplatform.v1.GetSessionRe" + + "quest\032#.google.cloud.aiplatform.v1.Sessi" + + "on\"N\332A\004name\202\323\344\223\002A\022?/v1/{name=projects/*/" + + "locations/*/reasoningEngines/*/sessions/*}\022\303\001\n" + + "\014ListSessions\022/.google.cloud.aiplatform.v1.ListSessionsRequest\0320.google.cl" + + "oud.aiplatform.v1.ListSessionsResponse\"P" + + "\332A\006parent\202\323\344\223\002A\022?/v1/{parent=projects/*/" + + "locations/*/reasoningEngines/*}/sessions\022\326\001\n\r" + + "UpdateSession\0220.google.cloud.aiplatform.v1.UpdateSessionRequest\032#.google.cl" + + "oud.aiplatform.v1.Session\"n\332A\023session,up" + + "date_mask\202\323\344\223\002R2G/v1/{session.name=proje" + + "cts/*/locations/*/reasoningEngines/*/sessions/*}:\007session\022\344\001\n\r" + + "DeleteSession\0220.google.cloud.aiplatform.v1.DeleteSessionRe" + + "quest\032\035.google.longrunning.Operation\"\201\001\312A0\n" + + "\025google.protobuf.Empty\022\027DeleteOperati" + + "onMetadata\332A\004name\202\323\344\223\002A*?/v1/{name=proje" + + "cts/*/locations/*/reasoningEngines/*/sessions/*}\022\306\001\n\n" + + "ListEvents\022-.google.cloud.aiplatform.v1.ListEventsRequest\032..google." + + "cloud.aiplatform.v1.ListEventsResponse\"Y" + + "\332A\006parent\202\323\344\223\002J\022H/v1/{parent=projects/*/" + + "locations/*/reasoningEngines/*/sessions/*}/events\022\327\001\n" + + "\013AppendEvent\022..google.cloud.aiplatform.v1.AppendEventRequest\032/.goog" + + "le.cloud.aiplatform.v1.AppendEventResponse\"g\332A\n" + + "name,event\202\323\344\223\002T\"K/v1/{name=proje" + + "cts/*/locations/*/reasoningEngines/*/ses" + + "sions/*}:appendEvent:\005event\032M\312A\031aiplatfo" + + "rm.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platformB\321\001\n" + + "\036com.google.cloud.aiplatform.v1B\023SessionServicePro" + + "toP\001Z>cloud.google.com/go/aiplatform/api" + + "v1/aiplatformpb;aiplatformpb\252\002\032Google.Cl" + + "oud.AIPlatform.V1\312\002\032Google\\Cloud\\AIPlatf" + + "orm\\V1\352\002\035Google::Cloud::AIPlatform::V1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.aiplatform.v1.OperationProto.getDescriptor(), + com.google.cloud.aiplatform.v1.SessionProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_descriptor = + getDescriptor().getMessageType(0); + internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_CreateSessionRequest_descriptor, + new java.lang.String[] { + "Parent", "Session", + }); + internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_descriptor = + getDescriptor().getMessageType(1); + internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_CreateSessionOperationMetadata_descriptor, + new java.lang.String[] { + "GenericMetadata", + }); + internal_static_google_cloud_aiplatform_v1_GetSessionRequest_descriptor = + getDescriptor().getMessageType(2); + internal_static_google_cloud_aiplatform_v1_GetSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_GetSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_descriptor = + getDescriptor().getMessageType(3); + internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ListSessionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ListSessionsResponse_descriptor, + new java.lang.String[] { + "Sessions", "NextPageToken", + }); + internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_descriptor = + getDescriptor().getMessageType(5); + internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_descriptor, + new java.lang.String[] { + "Session", "UpdateMask", + }); + internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_descriptor = + getDescriptor().getMessageType(6); + internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_DeleteSessionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_aiplatform_v1_ListEventsRequest_descriptor = + getDescriptor().getMessageType(7); + internal_static_google_cloud_aiplatform_v1_ListEventsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ListEventsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_aiplatform_v1_ListEventsResponse_descriptor = + getDescriptor().getMessageType(8); + internal_static_google_cloud_aiplatform_v1_ListEventsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_ListEventsResponse_descriptor, + new java.lang.String[] { + "SessionEvents", "NextPageToken", + }); + internal_static_google_cloud_aiplatform_v1_AppendEventRequest_descriptor = + getDescriptor().getMessageType(9); + internal_static_google_cloud_aiplatform_v1_AppendEventRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_AppendEventRequest_descriptor, + new java.lang.String[] { + "Name", "Event", + }); + internal_static_google_cloud_aiplatform_v1_AppendEventResponse_descriptor = + getDescriptor().getMessageType(10); + internal_static_google_cloud_aiplatform_v1_AppendEventResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1_AppendEventResponse_descriptor, + new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.aiplatform.v1.OperationProto.getDescriptor(); + com.google.cloud.aiplatform.v1.SessionProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Transcription.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Transcription.java new file mode 100644 index 000000000000..9b92c76d60a5 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/Transcription.java @@ -0,0 +1,692 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Audio transcription in Server Content.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Transcription} + */ +@com.google.protobuf.Generated +public final class Transcription extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.Transcription) + TranscriptionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Transcription"); + } + + // Use Transcription.newBuilder() to construct. + private Transcription(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Transcription() { + text_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Transcription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Transcription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Transcription.class, + com.google.cloud.aiplatform.v1.Transcription.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINISHED_FIELD_NUMBER = 2; + private boolean finished_ = false; + + /** + * + * + *
+   * Optional. The bool indicates the end of the transcription.
+   * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finished. + */ + @java.lang.Override + public boolean getFinished() { + return finished_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, text_); + } + if (finished_ != false) { + output.writeBool(2, finished_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, text_); + } + if (finished_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, finished_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.Transcription)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.Transcription other = + (com.google.cloud.aiplatform.v1.Transcription) obj; + + if (!getText().equals(other.getText())) return false; + if (getFinished() != other.getFinished()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + FINISHED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFinished()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.Transcription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.Transcription prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Audio transcription in Server Content.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.Transcription} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.Transcription) + com.google.cloud.aiplatform.v1.TranscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Transcription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Transcription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.Transcription.class, + com.google.cloud.aiplatform.v1.Transcription.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.Transcription.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = ""; + finished_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionProto + .internal_static_google_cloud_aiplatform_v1_Transcription_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Transcription getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Transcription build() { + com.google.cloud.aiplatform.v1.Transcription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Transcription buildPartial() { + com.google.cloud.aiplatform.v1.Transcription result = + new com.google.cloud.aiplatform.v1.Transcription(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.Transcription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = text_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.finished_ = finished_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.Transcription) { + return mergeFrom((com.google.cloud.aiplatform.v1.Transcription) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.Transcription other) { + if (other == com.google.cloud.aiplatform.v1.Transcription.getDefaultInstance()) return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFinished() != false) { + setFinished(other.getFinished()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + text_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + finished_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object text_ = ""; + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean finished_; + + /** + * + * + *
+     * Optional. The bool indicates the end of the transcription.
+     * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finished. + */ + @java.lang.Override + public boolean getFinished() { + return finished_; + } + + /** + * + * + *
+     * Optional. The bool indicates the end of the transcription.
+     * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The finished to set. + * @return This builder for chaining. + */ + public Builder setFinished(boolean value) { + + finished_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The bool indicates the end of the transcription.
+     * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFinished() { + bitField0_ = (bitField0_ & ~0x00000002); + finished_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.Transcription) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.Transcription) + private static final com.google.cloud.aiplatform.v1.Transcription DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.Transcription(); + } + + public static com.google.cloud.aiplatform.v1.Transcription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Transcription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.Transcription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/TranscriptionOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/TranscriptionOrBuilder.java new file mode 100644 index 000000000000..1f254be200ef --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/TranscriptionOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface TranscriptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.Transcription) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + java.lang.String getText(); + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * Optional. The bool indicates the end of the transcription.
+   * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finished. + */ + boolean getFinished(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UpdateSessionRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UpdateSessionRequest.java new file mode 100644 index 000000000000..03910d99ff08 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UpdateSessionRequest.java @@ -0,0 +1,1048 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +/** + * + * + *
+ * Request message for
+ * [SessionService.UpdateSession][google.cloud.aiplatform.v1.SessionService.UpdateSession].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.UpdateSessionRequest} + */ +@com.google.protobuf.Generated +public final class UpdateSessionRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1.UpdateSessionRequest) + UpdateSessionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateSessionRequest"); + } + + // Use UpdateSessionRequest.newBuilder() to construct. + private UpdateSessionRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private UpdateSessionRequest() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.UpdateSessionRequest.class, + com.google.cloud.aiplatform.v1.UpdateSessionRequest.Builder.class); + } + + private int bitField0_; + public static final int SESSION_FIELD_NUMBER = 1; + private com.google.cloud.aiplatform.v1.Session session_; + + /** + * + * + *
+   * Required. The session to update.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the session field is set. + */ + @java.lang.Override + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The session to update.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The session. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.Session getSession() { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } + + /** + * + * + *
+   * Required. The session to update.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionOrBuilder() { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. Field mask is used to control which fields get updated. If the
+   * mask is not present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Field mask is used to control which fields get updated. If the
+   * mask is not present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. Field mask is used to control which fields get updated. If the
+   * mask is not present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getSession()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSession()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1.UpdateSessionRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1.UpdateSessionRequest other = + (com.google.cloud.aiplatform.v1.UpdateSessionRequest) obj; + + if (hasSession() != other.hasSession()) return false; + if (hasSession()) { + if (!getSession().equals(other.getSession())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSession()) { + hash = (37 * hash) + SESSION_FIELD_NUMBER; + hash = (53 * hash) + getSession().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1.UpdateSessionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Request message for
+   * [SessionService.UpdateSession][google.cloud.aiplatform.v1.SessionService.UpdateSession].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1.UpdateSessionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1.UpdateSessionRequest) + com.google.cloud.aiplatform.v1.UpdateSessionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1.UpdateSessionRequest.class, + com.google.cloud.aiplatform.v1.UpdateSessionRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1.UpdateSessionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetSessionFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1.SessionServiceProto + .internal_static_google_cloud_aiplatform_v1_UpdateSessionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.UpdateSessionRequest getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1.UpdateSessionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.UpdateSessionRequest build() { + com.google.cloud.aiplatform.v1.UpdateSessionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.UpdateSessionRequest buildPartial() { + com.google.cloud.aiplatform.v1.UpdateSessionRequest result = + new com.google.cloud.aiplatform.v1.UpdateSessionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1.UpdateSessionRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.session_ = sessionBuilder_ == null ? session_ : sessionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1.UpdateSessionRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1.UpdateSessionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1.UpdateSessionRequest other) { + if (other == com.google.cloud.aiplatform.v1.UpdateSessionRequest.getDefaultInstance()) + return this; + if (other.hasSession()) { + mergeSession(other.getSession()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(internalGetSessionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + internalGetUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.aiplatform.v1.Session session_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder> + sessionBuilder_; + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the session field is set. + */ + public boolean hasSession() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The session. + */ + public com.google.cloud.aiplatform.v1.Session getSession() { + if (sessionBuilder_ == null) { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } else { + return sessionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSession(com.google.cloud.aiplatform.v1.Session value) { + if (sessionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + session_ = value; + } else { + sessionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSession(com.google.cloud.aiplatform.v1.Session.Builder builderForValue) { + if (sessionBuilder_ == null) { + session_ = builderForValue.build(); + } else { + sessionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSession(com.google.cloud.aiplatform.v1.Session value) { + if (sessionBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && session_ != null + && session_ != com.google.cloud.aiplatform.v1.Session.getDefaultInstance()) { + getSessionBuilder().mergeFrom(value); + } else { + session_ = value; + } + } else { + sessionBuilder_.mergeFrom(value); + } + if (session_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSession() { + bitField0_ = (bitField0_ & ~0x00000001); + session_ = null; + if (sessionBuilder_ != null) { + sessionBuilder_.dispose(); + sessionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.Session.Builder getSessionBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetSessionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionOrBuilder() { + if (sessionBuilder_ != null) { + return sessionBuilder_.getMessageOrBuilder(); + } else { + return session_ == null + ? com.google.cloud.aiplatform.v1.Session.getDefaultInstance() + : session_; + } + } + + /** + * + * + *
+     * Required. The session to update.
+     * Format:
+     * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+     * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder> + internalGetSessionFieldBuilder() { + if (sessionBuilder_ == null) { + sessionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1.Session, + com.google.cloud.aiplatform.v1.Session.Builder, + com.google.cloud.aiplatform.v1.SessionOrBuilder>( + getSession(), getParentForChildren(), isClean()); + session_ = null; + } + return sessionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. Field mask is used to control which fields get updated. If the
+     * mask is not present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + internalGetUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1.UpdateSessionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1.UpdateSessionRequest) + private static final com.google.cloud.aiplatform.v1.UpdateSessionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1.UpdateSessionRequest(); + } + + public static com.google.cloud.aiplatform.v1.UpdateSessionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSessionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1.UpdateSessionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UpdateSessionRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UpdateSessionRequestOrBuilder.java new file mode 100644 index 000000000000..133acb1e5f99 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UpdateSessionRequestOrBuilder.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1/session_service.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1; + +@com.google.protobuf.Generated +public interface UpdateSessionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.UpdateSessionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The session to update.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the session field is set. + */ + boolean hasSession(); + + /** + * + * + *
+   * Required. The session to update.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The session. + */ + com.google.cloud.aiplatform.v1.Session getSession(); + + /** + * + * + *
+   * Required. The session to update.
+   * Format:
+   * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}`
+   * 
+ * + * + * .google.cloud.aiplatform.v1.Session session = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1.SessionOrBuilder getSessionOrBuilder(); + + /** + * + * + *
+   * Optional. Field mask is used to control which fields get updated. If the
+   * mask is not present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask is used to control which fields get updated. If the
+   * mask is not present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask is used to control which fields get updated. If the
+   * mask is not present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/reasoning_engine.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/reasoning_engine.proto index 440d1e19484d..20fbf27d8ab7 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/reasoning_engine.proto +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/reasoning_engine.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -116,6 +116,15 @@ message ReasoningEngineSpec { ]; } + // The image spec for building an image (within a single build step), based + // on the config file (i.e. Dockerfile) in the source directory. + message ImageSpec { + // Optional. Build arguments to be used. They will be passed through + // --build-arg flags. + map build_args = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + // Specifies the configuration for fetching source code from a Git // repository that is managed by Developer Connect. This includes the // repository, revision, and directory to use. @@ -187,6 +196,9 @@ message ReasoningEngineSpec { oneof language_spec { // Configuration for a Python application. PythonSpec python_spec = 2; + + // Optional. Configuration for building an image with custom config file. + ImageSpec image_spec = 5 [(google.api.field_behavior) = OPTIONAL]; } } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/session.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/session.proto new file mode 100644 index 000000000000..e60918e6283c --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/session.proto @@ -0,0 +1,216 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/content.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A session contains a set of actions between users and Vertex agents. +message Session { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}" + plural: "sessions" + singular: "session" + }; + + // The expiration of the session. + oneof expiration { + // Optional. Timestamp of when this session is considered expired. + // This is *always* provided on output, regardless of what was sent + // on input. + // The minimum value is 24 hours from the time of creation. + google.protobuf.Timestamp expire_time = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. The TTL for this session. + // The minimum value is 24 hours. + google.protobuf.Duration ttl = 14 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = INPUT_ONLY + ]; + } + + // Identifier. The resource name of the session. + // Format: + // 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}'. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Timestamp when the session was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when the session was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The display name of the session. + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // The labels with user-defined metadata to organize your Sessions. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 8; + + // Optional. Session specific memory which stores key conversation points. + google.protobuf.Struct session_state = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. String id provided by the user + string user_id = 12 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; +} + +// An event represents a message from either the user or agent. +message SessionEvent { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/SessionEvent" + pattern: "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}" + plural: "sessionEvents" + singular: "sessionEvent" + }; + + // Identifier. The resource name of the event. + // Format:`projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The name of the agent that sent the event, or user. + string author = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Content of the event provided by the author. + Content content = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The invocation id of the event, multiple events can have the same + // invocation id. + string invocation_id = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Actions executed by the agent. + EventActions actions = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Timestamp when the event was created on client side. + google.protobuf.Timestamp timestamp = 8 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Error code if the response is an error. Code varies by model. + string error_code = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Error message if the response is an error. + string error_message = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata relating to this event. + EventMetadata event_metadata = 11 [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata relating to a LLM response event. +message EventMetadata { + // Optional. Metadata returned to client when grounding is enabled. + GroundingMetadata grounding_metadata = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the text content is part of a unfinished text + // stream. Only used for streaming mode and when the content is plain text. + bool partial = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether the response from the model is complete. + // Only used for streaming mode. + bool turn_complete = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flag indicating that LLM was interrupted when generating the + // content. Usually it's due to user interruption during a bidi streaming. + bool interrupted = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set of ids of the long running function calls. + // Agent client will know from this field about which function call is long + // running. Only valid for function call event. + repeated string long_running_tool_ids = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The branch of the event. + // The format is like agent_1.agent_2.agent_3, where agent_1 is the parent of + // agent_2, and agent_2 is the parent of agent_3. + // Branch is used when multiple child agents shouldn't see their siblings' + // conversation history. + string branch = 6 [(google.api.field_behavior) = OPTIONAL]; + + // The custom metadata of the LlmResponse. + google.protobuf.Struct custom_metadata = 7; + + // Optional. Audio transcription of user input. + Transcription input_transcription = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio transcription of model output. + Transcription output_transcription = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Actions are parts of events that are executed by the agent. +message EventActions { + // Optional. If true, it won't call model to summarize function response. + // Only used for function_response event. + bool skip_summarization = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that the event is updating the state with the given + // delta. + google.protobuf.Struct state_delta = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that the event is updating an artifact. key is the + // filename, value is the version. + map artifact_delta = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The agent is escalating to a higher level agent. + bool escalate = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Will only be set by a tool response indicating tool request euc. + // Struct key is the function call id since one function call response (from + // model) could correspond to multiple function calls. Struct value is the + // required auth config, which can be another struct. + google.protobuf.Struct requested_auth_configs = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the event transfers to the specified agent. + string transfer_agent = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Audio transcription in Server Content. +message Transcription { + // Optional. Transcription text. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bool indicates the end of the transcription. + bool finished = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/session_service.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/session_service.proto new file mode 100644 index 000000000000..d3dbd56a4645 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/proto/google/cloud/aiplatform/v1/session_service.proto @@ -0,0 +1,312 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/cloud/aiplatform/v1/session.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// The service that manages Vertex Session related resources. +service SessionService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new [Session][google.cloud.aiplatform.v1.Session]. + rpc CreateSession(CreateSessionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/reasoningEngines/*}/sessions" + body: "session" + }; + option (google.api.method_signature) = "parent,session"; + option (google.longrunning.operation_info) = { + response_type: "Session" + metadata_type: "CreateSessionOperationMetadata" + }; + } + + // Gets details of the specific [Session][google.cloud.aiplatform.v1.Session]. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists [Sessions][google.cloud.aiplatform.v1.Session] in a given reasoning + // engine. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/reasoningEngines/*}/sessions" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the specific [Session][google.cloud.aiplatform.v1.Session]. + rpc UpdateSession(UpdateSessionRequest) returns (Session) { + option (google.api.http) = { + patch: "/v1/{session.name=projects/*/locations/*/reasoningEngines/*/sessions/*}" + body: "session" + }; + option (google.api.method_signature) = "session,update_mask"; + } + + // Deletes details of the specific + // [Session][google.cloud.aiplatform.v1.Session]. + rpc DeleteSession(DeleteSessionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Lists [Events][google.cloud.aiplatform.v1.Event] in a given session. + rpc ListEvents(ListEventsRequest) returns (ListEventsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/reasoningEngines/*/sessions/*}/events" + }; + option (google.api.method_signature) = "parent"; + } + + // Appends an event to a given session. + rpc AppendEvent(AppendEventRequest) returns (AppendEventResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}:appendEvent" + body: "event" + }; + option (google.api.method_signature) = "name,event"; + } +} + +// Request message for +// [SessionService.CreateSession][google.cloud.aiplatform.v1.SessionService.CreateSession]. +message CreateSessionRequest { + // Required. The resource name of the location to create the session in. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; + + // Required. The session to create. + Session session = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata associated with the +// [SessionService.CreateSession][google.cloud.aiplatform.v1.SessionService.CreateSession] +// operation. +message CreateSessionOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [SessionService.GetSession][google.cloud.aiplatform.v1.SessionService.GetSession]. +message GetSessionRequest { + // Required. The resource name of the session. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Session" + } + ]; +} + +// Request message for +// [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]. +message ListSessionsRequest { + // Required. The resource name of the location to list sessions from. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; + + // Optional. The maximum number of sessions to return. The service may return + // fewer than this value. If unspecified, at most 100 sessions will be + // returned. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The + // [next_page_token][google.cloud.aiplatform.v1.ListSessionsResponse.next_page_token] + // value returned from a previous list + // [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list filter. + // Supported fields: + // * `display_name` + // * `user_id` + // * `labels` + // + // Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. Supported fields: + // * `create_time` + // * `update_time` + // + // Example: `create_time desc`. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [SessionService.ListSessions][google.cloud.aiplatform.v1.SessionService.ListSessions]. +message ListSessionsResponse { + // A list of sessions matching the request. + repeated Session sessions = 1; + + // A token, which can be sent as + // [ListSessionsRequest.page_token][google.cloud.aiplatform.v1.ListSessionsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [SessionService.UpdateSession][google.cloud.aiplatform.v1.SessionService.UpdateSession]. +message UpdateSessionRequest { + // Required. The session to update. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + Session session = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to control which fields get updated. If the + // mask is not present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [SessionService.DeleteSession][google.cloud.aiplatform.v1.SessionService.DeleteSession]. +message DeleteSessionRequest { + // Required. The resource name of the session. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Session" + } + ]; +} + +// Request message for +// [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]. +message ListEventsRequest { + // Required. The resource name of the session to list events from. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Session" + } + ]; + + // Optional. The maximum number of events to return. The service may return + // fewer than this value. If unspecified, at most 100 events will be returned. + // These events are ordered by timestamp in ascending order. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The + // [next_page_token][google.cloud.aiplatform.v1.ListEventsResponse.next_page_token] + // value returned from a previous list + // [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list filter. + // Supported fields: + // * `timestamp` range (i.e. `timestamp>="2025-01-31T11:30:00-04:00"` where + // the timestamp is in RFC 3339 format) + // + // More detail in [AIP-160](https://google.aip.dev/160). + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. Supported fields: + // * `timestamp` + // + // Example: `timestamp desc`. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [SessionService.ListEvents][google.cloud.aiplatform.v1.SessionService.ListEvents]. +message ListEventsResponse { + // A list of events matching the request. Ordered by timestamp in ascending + // order. + repeated SessionEvent session_events = 1; + + // A token, which can be sent as + // [ListEventsRequest.page_token][google.cloud.aiplatform.v1.ListEventsRequest.page_token] + // to retrieve the next page. Absence of this field indicates there are no + // subsequent pages. + string next_page_token = 2; +} + +// Request message for +// [SessionService.AppendEvent][google.cloud.aiplatform.v1.SessionService.AppendEvent]. +message AppendEventRequest { + // Required. The resource name of the session to append event to. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Session" + } + ]; + + // Required. The event to append to the session. + SessionEvent event = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [SessionService.AppendEvent][google.cloud.aiplatform.v1.SessionService.AppendEvent]. +message AppendEventResponse {} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadata.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadata.java index bdca1a65f28d..24b0a02a6bd8 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadata.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadata.java @@ -386,6 +386,126 @@ public com.google.protobuf.StructOrBuilder getCustomMetadataOrBuilder() { : customMetadata_; } + public static final int INPUT_TRANSCRIPTION_FIELD_NUMBER = 10; + private com.google.cloud.aiplatform.v1beta1.Transcription inputTranscription_; + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputTranscription field is set. + */ + @java.lang.Override + public boolean hasInputTranscription() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputTranscription. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Transcription getInputTranscription() { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : inputTranscription_; + } + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder + getInputTranscriptionOrBuilder() { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : inputTranscription_; + } + + public static final int OUTPUT_TRANSCRIPTION_FIELD_NUMBER = 11; + private com.google.cloud.aiplatform.v1beta1.Transcription outputTranscription_; + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the outputTranscription field is set. + */ + @java.lang.Override + public boolean hasOutputTranscription() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The outputTranscription. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Transcription getOutputTranscription() { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : outputTranscription_; + } + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder + getOutputTranscriptionOrBuilder() { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : outputTranscription_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -421,6 +541,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(7, getCustomMetadata()); } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getInputTranscription()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(11, getOutputTranscription()); + } getUnknownFields().writeTo(output); } @@ -456,6 +582,13 @@ public int getSerializedSize() { if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCustomMetadata()); } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getInputTranscription()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, getOutputTranscription()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -485,6 +618,14 @@ public boolean equals(final java.lang.Object obj) { if (hasCustomMetadata()) { if (!getCustomMetadata().equals(other.getCustomMetadata())) return false; } + if (hasInputTranscription() != other.hasInputTranscription()) return false; + if (hasInputTranscription()) { + if (!getInputTranscription().equals(other.getInputTranscription())) return false; + } + if (hasOutputTranscription() != other.hasOutputTranscription()) return false; + if (hasOutputTranscription()) { + if (!getOutputTranscription().equals(other.getOutputTranscription())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -516,6 +657,14 @@ public int hashCode() { hash = (37 * hash) + CUSTOM_METADATA_FIELD_NUMBER; hash = (53 * hash) + getCustomMetadata().hashCode(); } + if (hasInputTranscription()) { + hash = (37 * hash) + INPUT_TRANSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getInputTranscription().hashCode(); + } + if (hasOutputTranscription()) { + hash = (37 * hash) + OUTPUT_TRANSCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getOutputTranscription().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -659,6 +808,8 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { internalGetGroundingMetadataFieldBuilder(); internalGetCustomMetadataFieldBuilder(); + internalGetInputTranscriptionFieldBuilder(); + internalGetOutputTranscriptionFieldBuilder(); } } @@ -681,6 +832,16 @@ public Builder clear() { customMetadataBuilder_.dispose(); customMetadataBuilder_ = null; } + inputTranscription_ = null; + if (inputTranscriptionBuilder_ != null) { + inputTranscriptionBuilder_.dispose(); + inputTranscriptionBuilder_ = null; + } + outputTranscription_ = null; + if (outputTranscriptionBuilder_ != null) { + outputTranscriptionBuilder_.dispose(); + outputTranscriptionBuilder_ = null; + } return this; } @@ -746,6 +907,20 @@ private void buildPartial0(com.google.cloud.aiplatform.v1beta1.EventMetadata res customMetadataBuilder_ == null ? customMetadata_ : customMetadataBuilder_.build(); to_bitField0_ |= 0x00000002; } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.inputTranscription_ = + inputTranscriptionBuilder_ == null + ? inputTranscription_ + : inputTranscriptionBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.outputTranscription_ = + outputTranscriptionBuilder_ == null + ? outputTranscription_ + : outputTranscriptionBuilder_.build(); + to_bitField0_ |= 0x00000008; + } result.bitField0_ |= to_bitField0_; } @@ -792,6 +967,12 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.EventMetadata other if (other.hasCustomMetadata()) { mergeCustomMetadata(other.getCustomMetadata()); } + if (other.hasInputTranscription()) { + mergeInputTranscription(other.getInputTranscription()); + } + if (other.hasOutputTranscription()) { + mergeOutputTranscription(other.getOutputTranscription()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -863,6 +1044,20 @@ public Builder mergeFrom( bitField0_ |= 0x00000040; break; } // case 58 + case 82: + { + input.readMessage( + internalGetInputTranscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 82 + case 90: + { + input.readMessage( + internalGetOutputTranscriptionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 90 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1812,6 +2007,440 @@ public com.google.protobuf.StructOrBuilder getCustomMetadataOrBuilder() { return customMetadataBuilder_; } + private com.google.cloud.aiplatform.v1beta1.Transcription inputTranscription_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.Transcription, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder, + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder> + inputTranscriptionBuilder_; + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputTranscription field is set. + */ + public boolean hasInputTranscription() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputTranscription. + */ + public com.google.cloud.aiplatform.v1beta1.Transcription getInputTranscription() { + if (inputTranscriptionBuilder_ == null) { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : inputTranscription_; + } else { + return inputTranscriptionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInputTranscription(com.google.cloud.aiplatform.v1beta1.Transcription value) { + if (inputTranscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + inputTranscription_ = value; + } else { + inputTranscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setInputTranscription( + com.google.cloud.aiplatform.v1beta1.Transcription.Builder builderForValue) { + if (inputTranscriptionBuilder_ == null) { + inputTranscription_ = builderForValue.build(); + } else { + inputTranscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeInputTranscription( + com.google.cloud.aiplatform.v1beta1.Transcription value) { + if (inputTranscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && inputTranscription_ != null + && inputTranscription_ + != com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance()) { + getInputTranscriptionBuilder().mergeFrom(value); + } else { + inputTranscription_ = value; + } + } else { + inputTranscriptionBuilder_.mergeFrom(value); + } + if (inputTranscription_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearInputTranscription() { + bitField0_ = (bitField0_ & ~0x00000080); + inputTranscription_ = null; + if (inputTranscriptionBuilder_ != null) { + inputTranscriptionBuilder_.dispose(); + inputTranscriptionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1beta1.Transcription.Builder + getInputTranscriptionBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return internalGetInputTranscriptionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder + getInputTranscriptionOrBuilder() { + if (inputTranscriptionBuilder_ != null) { + return inputTranscriptionBuilder_.getMessageOrBuilder(); + } else { + return inputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : inputTranscription_; + } + } + + /** + * + * + *
+     * Optional. Audio transcription of user input.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.Transcription, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder, + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder> + internalGetInputTranscriptionFieldBuilder() { + if (inputTranscriptionBuilder_ == null) { + inputTranscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.Transcription, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder, + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder>( + getInputTranscription(), getParentForChildren(), isClean()); + inputTranscription_ = null; + } + return inputTranscriptionBuilder_; + } + + private com.google.cloud.aiplatform.v1beta1.Transcription outputTranscription_; + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.Transcription, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder, + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder> + outputTranscriptionBuilder_; + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the outputTranscription field is set. + */ + public boolean hasOutputTranscription() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The outputTranscription. + */ + public com.google.cloud.aiplatform.v1beta1.Transcription getOutputTranscription() { + if (outputTranscriptionBuilder_ == null) { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : outputTranscription_; + } else { + return outputTranscriptionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOutputTranscription(com.google.cloud.aiplatform.v1beta1.Transcription value) { + if (outputTranscriptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputTranscription_ = value; + } else { + outputTranscriptionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOutputTranscription( + com.google.cloud.aiplatform.v1beta1.Transcription.Builder builderForValue) { + if (outputTranscriptionBuilder_ == null) { + outputTranscription_ = builderForValue.build(); + } else { + outputTranscriptionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeOutputTranscription( + com.google.cloud.aiplatform.v1beta1.Transcription value) { + if (outputTranscriptionBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && outputTranscription_ != null + && outputTranscription_ + != com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance()) { + getOutputTranscriptionBuilder().mergeFrom(value); + } else { + outputTranscription_ = value; + } + } else { + outputTranscriptionBuilder_.mergeFrom(value); + } + if (outputTranscription_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearOutputTranscription() { + bitField0_ = (bitField0_ & ~0x00000100); + outputTranscription_ = null; + if (outputTranscriptionBuilder_ != null) { + outputTranscriptionBuilder_.dispose(); + outputTranscriptionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1beta1.Transcription.Builder + getOutputTranscriptionBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetOutputTranscriptionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder + getOutputTranscriptionOrBuilder() { + if (outputTranscriptionBuilder_ != null) { + return outputTranscriptionBuilder_.getMessageOrBuilder(); + } else { + return outputTranscription_ == null + ? com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance() + : outputTranscription_; + } + } + + /** + * + * + *
+     * Optional. Audio transcription of model output.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.Transcription, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder, + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder> + internalGetOutputTranscriptionFieldBuilder() { + if (outputTranscriptionBuilder_ == null) { + outputTranscriptionBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.Transcription, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder, + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder>( + getOutputTranscription(), getParentForChildren(), isClean()); + outputTranscription_ = null; + } + return outputTranscriptionBuilder_; + } + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.EventMetadata) } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadataOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadataOrBuilder.java index 1075ac798a22..6aa03e75ab1a 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadataOrBuilder.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/EventMetadataOrBuilder.java @@ -247,4 +247,90 @@ public interface EventMetadataOrBuilder * .google.protobuf.Struct custom_metadata = 7; */ com.google.protobuf.StructOrBuilder getCustomMetadataOrBuilder(); + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the inputTranscription field is set. + */ + boolean hasInputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The inputTranscription. + */ + com.google.cloud.aiplatform.v1beta1.Transcription getInputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of user input.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription input_transcription = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder getInputTranscriptionOrBuilder(); + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the outputTranscription field is set. + */ + boolean hasOutputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The outputTranscription. + */ + com.google.cloud.aiplatform.v1beta1.Transcription getOutputTranscription(); + + /** + * + * + *
+   * Optional. Audio transcription of model output.
+   * 
+ * + * + * .google.cloud.aiplatform.v1beta1.Transcription output_transcription = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder getOutputTranscriptionOrBuilder(); } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequest.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequest.java index 42578175bdb4..51a379c3b3cc 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequest.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequest.java @@ -230,8 +230,9 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -259,8 +260,9 @@ public java.lang.String getFilter() { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1083,8 +1085,9 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1111,8 +1114,9 @@ public java.lang.String getFilter() { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1139,8 +1143,9 @@ public com.google.protobuf.ByteString getFilterBytes() { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1166,8 +1171,9 @@ public Builder setFilter(java.lang.String value) { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -1189,8 +1195,9 @@ public Builder clearFilter() { * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequestOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequestOrBuilder.java index 2a27592949ac..a2c528e0b561 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequestOrBuilder.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ListSessionsRequestOrBuilder.java @@ -117,8 +117,9 @@ public interface ListSessionsRequestOrBuilder * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; @@ -135,8 +136,9 @@ public interface ListSessionsRequestOrBuilder * Supported fields: * * `display_name` * * `user_id` + * * `labels` * - * Example: `display_name="abc"`, `user_id="123"`. + * Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. * * * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineProto.java index cd47eaedbed8..1bf2be105f28 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineProto.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineProto.java @@ -64,6 +64,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_InlineSource_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_InlineSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -125,7 +133,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "v_var.proto\0328google/cloud/aiplatform/v1b" + "eta1/service_networking.proto\032\036google/pr" + "otobuf/duration.proto\032\034google/protobuf/s" - + "truct.proto\032\037google/protobuf/timestamp.proto\"\222\020\n" + + "truct.proto\032\037google/protobuf/timestamp.proto\"\263\022\n" + "\023ReasoningEngineSpec\022_\n" + "\020source_code_spec\030\013 \001(\0132C.google.cloud.aiplatform" + ".v1beta1.ReasoningEngineSpec.SourceCodeSpecH\000\022!\n" @@ -158,24 +166,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\005value\030\002 \001(\t:\0028\001B\020\n" + "\016_min_instancesB\020\n" + "\016_max_instancesB\030\n" - + "\026_container_concurrency\032\332\006\n" + + "\026_container_concurrency\032\373\010\n" + "\016SourceCodeSpec\022i\n\r" + "inline_source\030\001 \001(\0132P.google.cloud.aiplatform." + "v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSourceH\000\022~\n" + "\030developer_connect_source\030\003 \001(\0132Z.google.cloud.aiplatform.v1" + "beta1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectSourceH\000\022e\n" + "\013python_spec\030\002 \001(\0132N.google.cloud.aiplatform.v1beta1" - + ".ReasoningEngineSpec.SourceCodeSpec.PythonSpecH\001\032.\n" + + ".ReasoningEngineSpec.SourceCodeSpec.PythonSpecH\001\022h\n\n" + + "image_spec\030\005 \001(\0132M.google.cl" + + "oud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecB\003\340A\001H\001\032.\n" + "\014InlineSource\022\036\n" - + "\016source_archive\030\001 \001(\014B\006\340A\002\340A\004\032\231\001\n" + + "\016source_archive\030\001 \001(\014B\006\340A\002\340A\004\032\264\001\n" + + "\tImageSpec\022u\n\n" + + "build_args\030\001 \003(\0132\\.google.cloud.aiplatform.v1beta1.Reasoning" + + "EngineSpec.SourceCodeSpec.ImageSpec.BuildArgsEntryB\003\340A\001\0320\n" + + "\016BuildArgsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\032\231\001\n" + "\026DeveloperConnectConfig\022V\n" + "\023git_repository_link\030\001 \001(\tB9\340A\002\372A3\n" + "1developerconnect.googleapis.com/GitRepositoryLink\022\020\n" + "\003dir\030\002 \001(\tB\003\340A\002\022\025\n" + "\010revision\030\003 \001(\tB\003\340A\002\032\211\001\n" + "\026DeveloperConnectSource\022o\n" - + "\006config\030\001 \001(\0132Z.google.cloud.aiplatfor" - + "m.v1beta1.ReasoningEngineSpec.SourceCodeSpec.DeveloperConnectConfigB\003\340A\002\032\202\001\n\n" + + "\006config\030\001 \001(\0132Z.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.S" + + "ourceCodeSpec.DeveloperConnectConfigB\003\340A\002\032\202\001\n\n" + "PythonSpec\022\024\n" + "\007version\030\001 \001(\tB\003\340A\001\022\036\n" + "\021entrypoint_module\030\002 \001(\tB\003\340A\001\022\036\n" @@ -189,41 +205,41 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\004name\030\001 \001(\tB\003\340A\010\022\031\n" + "\014display_name\030\002 \001(\tB\003\340A\002\022\030\n" + "\013description\030\007 \001(\tB\003\340A\001\022G\n" - + "\004spec\030\003 \001(\01324.google.cloud.aipla" - + "tform.v1beta1.ReasoningEngineSpecB\003\340A\001\0224\n" + + "\004spec\030\003 \001(\01324.google.cl" + + "oud.aiplatform.v1beta1.ReasoningEngineSpecB\003\340A\001\0224\n" + "\013create_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + "\013update_time\030\005" + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\021\n" + "\004etag\030\006 \001(\tB\003\340A\001\022V\n" - + "\014context_spec\030\t \001(\0132;.google.clo" - + "ud.aiplatform.v1beta1.ReasoningEngineContextSpecB\003\340A\001\022H\n" - + "\017encryption_spec\030\013 \001(\0132/" - + ".google.cloud.aiplatform.v1beta1.EncryptionSpec\022L\n" - + "\006labels\030\021 \003(\0132<.google.cloud.a" - + "iplatform.v1beta1.ReasoningEngine.LabelsEntry\032-\n" + + "\014context_spec\030\t \001(\0132;.g" + + "oogle.cloud.aiplatform.v1beta1.ReasoningEngineContextSpecB\003\340A\001\022H\n" + + "\017encryption_spec\030\013" + + " \001(\0132/.google.cloud.aiplatform.v1beta1.EncryptionSpec\022L\n" + + "\006labels\030\021 \003(\0132<.googl" + + "e.cloud.aiplatform.v1beta1.ReasoningEngine.LabelsEntry\032-\n" + "\013LabelsEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" + "\005value\030\002 \001(\t:\0028\001:\237\001\352A\233\001\n" - + ")aiplatform.googleapis.com/ReasoningEngine\022Kprojects/{projec" - + "t}/locations/{location}/reasoningEngines" - + "/{reasoning_engine}*\020reasoningEngines2\017reasoningEngine\"\354\010\n" + + ")aiplatform.googleapis.com/ReasoningEngine\022Kproject" + + "s/{project}/locations/{location}/reasoni" + + "ngEngines/{reasoning_engine}*\020reasoningEngines2\017reasoningEngine\"\354\010\n" + "\032ReasoningEngineContextSpec\022m\n" - + "\022memory_bank_config\030\001 \001(\0132L.goog" - + "le.cloud.aiplatform.v1beta1.ReasoningEngineContextSpec.MemoryBankConfigB\003\340A\001\032\336\007\n" + + "\022memory_bank_config\030\001 \001(\0132L.google.cloud.aiplatform.v1beta1.Rea" + + "soningEngineContextSpec.MemoryBankConfigB\003\340A\001\032\336\007\n" + "\020MemoryBankConfig\022}\n" - + "\021generation_config\030\001 \001(\0132].google.cloud.aiplatform.v1beta1.R" - + "easoningEngineContextSpec.MemoryBankConfig.GenerationConfigB\003\340A\001\022\212\001\n" - + "\030similarity_search_config\030\002 \001(\0132c.google.cloud.aipla" - + "tform.v1beta1.ReasoningEngineContextSpec" - + ".MemoryBankConfig.SimilaritySearchConfigB\003\340A\001\022o\n\n" - + "ttl_config\030\005 \001(\0132V.google.cloud.aiplatform.v1beta1.ReasoningEngineConte" - + "xtSpec.MemoryBankConfig.TtlConfigB\003\340A\001\032\236\003\n" + + "\021generation_config\030\001 \001(\0132].google.cloud.aiplatform." + + "v1beta1.ReasoningEngineContextSpec.MemoryBankConfig.GenerationConfigB\003\340A\001\022\212\001\n" + + "\030similarity_search_config\030\002 \001(\0132c.google.cl" + + "oud.aiplatform.v1beta1.ReasoningEngineCo" + + "ntextSpec.MemoryBankConfig.SimilaritySearchConfigB\003\340A\001\022o\n\n" + + "ttl_config\030\005 \001(\0132V.google.cloud.aiplatform.v1beta1.ReasoningEn" + + "gineContextSpec.MemoryBankConfig.TtlConfigB\003\340A\001\032\236\003\n" + "\tTtlConfig\0225\n" + "\013default_ttl\030\001" + " \001(\0132\031.google.protobuf.DurationB\003\340A\001H\000\022\214\001\n" - + "\023granular_ttl_config\030\002 \001(\0132h.google.cloud.aiplatf" - + "orm.v1beta1.ReasoningEngineContextSpec.M" - + "emoryBankConfig.TtlConfig.GranularTtlConfigB\003\340A\001H\000\032\303\001\n" + + "\023granular_ttl_config\030\002 \001(\0132h.google.clou" + + "d.aiplatform.v1beta1.ReasoningEngineCont" + + "extSpec.MemoryBankConfig.TtlConfig.GranularTtlConfigB\003\340A\001H\000\032\303\001\n" + "\021GranularTtlConfig\0222\n\n" + "create_ttl\030\001 \001(\0132\031.google.protobuf.DurationB\003\340A\001\022<\n" + "\024generate_created_ttl\030\002" @@ -237,13 +253,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\026SimilaritySearchConfig\022C\n" + "\017embedding_model\030\001 \001(\tB*\340A\002\372A$\n" + "\"aiplatform.googleapis.com/EndpointB\215\003\n" - + "#com.google.cloud.aiplatform.v1beta1B\024Reasoning" - + "EngineProtoP\001ZCcloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatform" - + "pb\252\002\037Google.Cloud.AIPlatform.V1Beta1\312\002\037G" - + "oogle\\Cloud\\AIPlatform\\V1beta1\352\002\"Google::Cloud::AIPlatform::V1beta1\352A\236\001\n" - + "1developerconnect.googleapis.com/GitRepositoryLi" - + "nk\022iprojects/{project}/locations/{location}/connections/{connection}/gitReposito" - + "ryLinks/{git_repository_link}b\006proto3" + + "#com.google.cloud.aiplatform.v1beta1B\024ReasoningEngineProtoP\001ZCcloud.google.com" + + "/go/aiplatform/apiv1beta1/aiplatformpb;a" + + "iplatformpb\252\002\037Google.Cloud.AIPlatform.V1" + + "Beta1\312\002\037Google\\Cloud\\AIPlatform\\V1beta1\352" + + "\002\"Google::Cloud::AIPlatform::V1beta1\352A\236\001\n" + + "1developerconnect.googleapis.com/GitRepositoryLink\022iprojects/{project}/location" + + "s/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -312,7 +329,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_descriptor, new java.lang.String[] { - "InlineSource", "DeveloperConnectSource", "PythonSpec", "Source", "LanguageSpec", + "InlineSource", + "DeveloperConnectSource", + "PythonSpec", + "ImageSpec", + "Source", + "LanguageSpec", }); internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_InlineSource_descriptor = internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_descriptor @@ -323,9 +345,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "SourceArchive", }); - internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor = + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor = internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_descriptor .getNestedType(1); + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor, + new java.lang.String[] { + "BuildArgs", + }); + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor = + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor + .getNestedType(0); + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor = + internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_descriptor + .getNestedType(2); internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectConfig_descriptor, @@ -334,7 +374,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectSource_descriptor = internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_descriptor - .getNestedType(2); + .getNestedType(3); internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectSource_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_DeveloperConnectSource_descriptor, @@ -343,7 +383,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_PythonSpec_descriptor = internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_descriptor - .getNestedType(3); + .getNestedType(4); internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_PythonSpec_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_PythonSpec_descriptor, diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineSpec.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineSpec.java index 0c56ed9e7419..8315c9f12ded 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineSpec.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ReasoningEngineSpec.java @@ -4819,6 +4819,50 @@ public interface SourceCodeSpecOrBuilder com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.PythonSpecOrBuilder getPythonSpecOrBuilder(); + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the imageSpec field is set. + */ + boolean hasImageSpec(); + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The imageSpec. + */ + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec getImageSpec(); + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder + getImageSpecOrBuilder(); + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.SourceCase getSourceCase(); @@ -5399,30 +5443,914 @@ public Builder clearSourceArchive() { return this; } - // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + private static final com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .InlineSource + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .InlineSource(); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .InlineSource + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InlineSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSource + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ImageSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getBuildArgsCount(); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsBuildArgs(java.lang.String key); + + /** Use {@link #getBuildArgsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getBuildArgs(); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getBuildArgsMap(); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getBuildArgsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getBuildArgsOrThrow(java.lang.String key); + } + + /** + * + * + *
+     * The image spec for building an image (within a single build step), based
+     * on the config file (i.e. Dockerfile) in the source directory.
+     * 
+ * + * Protobuf type {@code + * google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec} + */ + public static final class ImageSpec extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + ImageSpecOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ImageSpec"); + } + + // Use ImageSpec.newBuilder() to construct. + private ImageSpec(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private ImageSpec() {} + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetBuildArgs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .class, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder.class); + } + + public static final int BUILD_ARGS_FIELD_NUMBER = 1; + + private static final class BuildArgsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_BuildArgsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField buildArgs_; + + private com.google.protobuf.MapField + internalGetBuildArgs() { + if (buildArgs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuildArgsDefaultEntryHolder.defaultEntry); + } + return buildArgs_; + } + + public int getBuildArgsCount() { + return internalGetBuildArgs().getMap().size(); + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsBuildArgs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetBuildArgs().getMap().containsKey(key); + } + + /** Use {@link #getBuildArgsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBuildArgs() { + return getBuildArgsMap(); + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getBuildArgsMap() { + return internalGetBuildArgs().getMap(); + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getBuildArgsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+       * Optional. Build arguments to be used. They will be passed through
+       * --build-arg flags.
+       * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getBuildArgsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetBuildArgs(), BuildArgsDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetBuildArgs().getMap().entrySet()) { + com.google.protobuf.MapEntry buildArgs__ = + BuildArgsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, buildArgs__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec other = + (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) obj; + + if (!internalGetBuildArgs().equals(other.internalGetBuildArgs())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetBuildArgs().getMap().isEmpty()) { + hash = (37 * hash) + BUILD_ARGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetBuildArgs().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+       * The image spec for building an image (within a single build step), based
+       * on the config file (i.e. Dockerfile) in the source directory.
+       * 
+ * + * Protobuf type {@code + * google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetBuildArgs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor + internalGetMutableMapFieldReflection(int number) { + switch (number) { + case 1: + return internalGetMutableBuildArgs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .class, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder.class); + } + + // Construct using + // com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableBuildArgs().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineProto + .internal_static_google_cloud_aiplatform_v1beta1_ReasoningEngineSpec_SourceCodeSpec_ImageSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + build() { + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + buildPartial() { + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec result = + new com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.buildArgs_ = internalGetBuildArgs(); + result.buildArgs_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) { + return mergeFrom( + (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + other) { + if (other + == com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance()) return this; + internalGetMutableBuildArgs().mergeFrom(other.internalGetBuildArgs()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry buildArgs__ = + input.readMessage( + BuildArgsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableBuildArgs() + .getMutableMap() + .put(buildArgs__.getKey(), buildArgs__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField buildArgs_; + + private com.google.protobuf.MapField + internalGetBuildArgs() { + if (buildArgs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuildArgsDefaultEntryHolder.defaultEntry); + } + return buildArgs_; + } + + private com.google.protobuf.MapField + internalGetMutableBuildArgs() { + if (buildArgs_ == null) { + buildArgs_ = + com.google.protobuf.MapField.newMapField(BuildArgsDefaultEntryHolder.defaultEntry); + } + if (!buildArgs_.isMutable()) { + buildArgs_ = buildArgs_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return buildArgs_; + } + + public int getBuildArgsCount() { + return internalGetBuildArgs().getMap().size(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsBuildArgs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetBuildArgs().getMap().containsKey(key); + } + + /** Use {@link #getBuildArgsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getBuildArgs() { + return getBuildArgsMap(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getBuildArgsMap() { + return internalGetBuildArgs().getMap(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getBuildArgsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getBuildArgsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetBuildArgs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearBuildArgs() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableBuildArgs().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeBuildArgs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableBuildArgs().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableBuildArgs() { + bitField0_ |= 0x00000001; + return internalGetMutableBuildArgs().getMutableMap(); + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putBuildArgs(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableBuildArgs().getMutableMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
+         * Optional. Build arguments to be used. They will be passed through
+         * --build-arg flags.
+         * 
+ * + * map<string, string> build_args = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllBuildArgs(java.util.Map values) { + internalGetMutableBuildArgs().getMutableMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) } - // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSource) + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) private static final com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec - .InlineSource + .ImageSpec DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = - new com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec - .InlineSource(); + new com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec(); } - public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec - .InlineSource + public static com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public InlineSource parsePartialFrom( + public ImageSpec parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -5442,17 +6370,17 @@ public InlineSource parsePartialFrom( } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.InlineSource + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -8970,6 +9898,7 @@ public enum LanguageSpecCase com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { PYTHON_SPEC(2), + IMAGE_SPEC(5), LANGUAGESPEC_NOT_SET(0); private final int value; @@ -8991,6 +9920,8 @@ public static LanguageSpecCase forNumber(int value) { switch (value) { case 2: return PYTHON_SPEC; + case 5: + return IMAGE_SPEC; case 0: return LANGUAGESPEC_NOT_SET; default: @@ -9211,6 +10142,72 @@ public boolean hasPythonSpec() { .getDefaultInstance(); } + public static final int IMAGE_SPEC_FIELD_NUMBER = 5; + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the imageSpec field is set. + */ + @java.lang.Override + public boolean hasImageSpec() { + return languageSpecCase_ == 5; + } + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The imageSpec. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + getImageSpec() { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + + /** + * + * + *
+     * Optional. Configuration for building an image with custom config file.
+     * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpecOrBuilder + getImageSpecOrBuilder() { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -9244,6 +10241,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .DeveloperConnectSource) source_); } + if (languageSpecCase_ == 5) { + output.writeMessage( + 5, + (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_); + } getUnknownFields().writeTo(output); } @@ -9276,6 +10279,13 @@ public int getSerializedSize() { .DeveloperConnectSource) source_); } + if (languageSpecCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, + (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -9309,6 +10319,9 @@ public boolean equals(final java.lang.Object obj) { case 2: if (!getPythonSpec().equals(other.getPythonSpec())) return false; break; + case 5: + if (!getImageSpec().equals(other.getImageSpec())) return false; + break; case 0: default: } @@ -9340,6 +10353,10 @@ public int hashCode() { hash = (37 * hash) + PYTHON_SPEC_FIELD_NUMBER; hash = (53 * hash) + getPythonSpec().hashCode(); break; + case 5: + hash = (37 * hash) + IMAGE_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getImageSpec().hashCode(); + break; case 0: default: } @@ -9496,6 +10513,9 @@ public Builder clear() { if (pythonSpecBuilder_ != null) { pythonSpecBuilder_.clear(); } + if (imageSpecBuilder_ != null) { + imageSpecBuilder_.clear(); + } sourceCase_ = 0; source_ = null; languageSpecCase_ = 0; @@ -9558,6 +10578,9 @@ private void buildPartialOneofs( if (languageSpecCase_ == 2 && pythonSpecBuilder_ != null) { result.languageSpec_ = pythonSpecBuilder_.build(); } + if (languageSpecCase_ == 5 && imageSpecBuilder_ != null) { + result.languageSpec_ = imageSpecBuilder_.build(); + } } @java.lang.Override @@ -9599,6 +10622,11 @@ public Builder mergeFrom( mergePythonSpec(other.getPythonSpec()); break; } + case IMAGE_SPEC: + { + mergeImageSpec(other.getImageSpec()); + break; + } case LANGUAGESPEC_NOT_SET: { break; @@ -9652,6 +10680,13 @@ public Builder mergeFrom( sourceCase_ = 3; break; } // case 26 + case 42: + { + input.readMessage( + internalGetImageSpecFieldBuilder().getBuilder(), extensionRegistry); + languageSpecCase_ = 5; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -10510,6 +11545,271 @@ public Builder clearPythonSpec() { return pythonSpecBuilder_; } + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpecOrBuilder> + imageSpecBuilder_; + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the imageSpec field is set. + */ + @java.lang.Override + public boolean hasImageSpec() { + return languageSpecCase_ == 5; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The imageSpec. + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + getImageSpec() { + if (imageSpecBuilder_ == null) { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } else { + if (languageSpecCase_ == 5) { + return imageSpecBuilder_.getMessage(); + } + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setImageSpec( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec value) { + if (imageSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + languageSpec_ = value; + onChanged(); + } else { + imageSpecBuilder_.setMessage(value); + } + languageSpecCase_ = 5; + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setImageSpec( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec.Builder + builderForValue) { + if (imageSpecBuilder_ == null) { + languageSpec_ = builderForValue.build(); + onChanged(); + } else { + imageSpecBuilder_.setMessage(builderForValue.build()); + } + languageSpecCase_ = 5; + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeImageSpec( + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec value) { + if (imageSpecBuilder_ == null) { + if (languageSpecCase_ == 5 + && languageSpec_ + != com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpec.getDefaultInstance()) { + languageSpec_ = + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .newBuilder( + (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpec) + languageSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + languageSpec_ = value; + } + onChanged(); + } else { + if (languageSpecCase_ == 5) { + imageSpecBuilder_.mergeFrom(value); + } else { + imageSpecBuilder_.setMessage(value); + } + } + languageSpecCase_ = 5; + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearImageSpec() { + if (imageSpecBuilder_ == null) { + if (languageSpecCase_ == 5) { + languageSpecCase_ = 0; + languageSpec_ = null; + onChanged(); + } + } else { + if (languageSpecCase_ == 5) { + languageSpecCase_ = 0; + languageSpec_ = null; + } + imageSpecBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder + getImageSpecBuilder() { + return internalGetImageSpecFieldBuilder().getBuilder(); + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpecOrBuilder + getImageSpecOrBuilder() { + if ((languageSpecCase_ == 5) && (imageSpecBuilder_ != null)) { + return imageSpecBuilder_.getMessageOrBuilder(); + } else { + if (languageSpecCase_ == 5) { + return (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpec) + languageSpec_; + } + return com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + } + + /** + * + * + *
+       * Optional. Configuration for building an image with custom config file.
+       * 
+ * + * + * .google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec image_spec = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpecOrBuilder> + internalGetImageSpecFieldBuilder() { + if (imageSpecBuilder_ == null) { + if (!(languageSpecCase_ == 5)) { + languageSpec_ = + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .getDefaultInstance(); + } + imageSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec + .Builder, + com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec + .ImageSpecOrBuilder>( + (com.google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec.ImageSpec) + languageSpec_, + getParentForChildren(), + isClean()); + languageSpec_ = null; + } + languageSpecCase_ = 5; + onChanged(); + return imageSpecBuilder_; + } + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.ReasoningEngineSpec.SourceCodeSpec) } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Session.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Session.java index 2ba257f5eaeb..cd07941704fe 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Session.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Session.java @@ -62,6 +62,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_aiplatform_v1beta1_Session_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { @@ -132,6 +144,7 @@ public ExpirationCase getExpirationCase() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -151,6 +164,7 @@ public boolean hasExpireTime() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -173,6 +187,7 @@ public com.google.protobuf.Timestamp getExpireTime() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -193,6 +208,7 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { * *
    * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
    * 
* * @@ -211,6 +227,7 @@ public boolean hasTtl() { * *
    * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
    * 
* * @@ -232,6 +249,7 @@ public com.google.protobuf.Duration getTtl() { * *
    * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
    * 
* * @@ -460,6 +478,137 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { } } + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.aiplatform.v1beta1.SessionProto + .internal_static_google_cloud_aiplatform_v1beta1_Session_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public static final int SESSION_STATE_FIELD_NUMBER = 10; private com.google.protobuf.Struct sessionState_; @@ -595,6 +744,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { com.google.protobuf.GeneratedMessage.writeString(output, 5, displayName_); } + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(10, getSessionState()); } @@ -628,6 +779,16 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessage.isStringEmpty(displayName_)) { size += com.google.protobuf.GeneratedMessage.computeStringSize(5, displayName_); } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getSessionState()); } @@ -670,6 +831,7 @@ public boolean equals(final java.lang.Object obj) { if (!getUpdateTime().equals(other.getUpdateTime())) return false; } if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (hasSessionState() != other.hasSessionState()) return false; if (hasSessionState()) { if (!getSessionState().equals(other.getSessionState())) return false; @@ -709,6 +871,10 @@ public int hashCode() { } hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } if (hasSessionState()) { hash = (37 * hash) + SESSION_STATE_FIELD_NUMBER; hash = (53 * hash) + getSessionState().hashCode(); @@ -846,6 +1012,28 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_aiplatform_v1beta1_Session_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { @@ -896,6 +1084,7 @@ public Builder clear() { updateTimeBuilder_ = null; } displayName_ = ""; + internalGetMutableLabels().clear(); sessionState_ = null; if (sessionStateBuilder_ != null) { sessionStateBuilder_.dispose(); @@ -957,11 +1146,15 @@ private void buildPartial0(com.google.cloud.aiplatform.v1beta1.Session result) { result.displayName_ = displayName_; } if (((from_bitField0_ & 0x00000040) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { result.sessionState_ = sessionStateBuilder_ == null ? sessionState_ : sessionStateBuilder_.build(); to_bitField0_ |= 0x00000004; } - if (((from_bitField0_ & 0x00000080) != 0)) { + if (((from_bitField0_ & 0x00000100) != 0)) { result.userId_ = userId_; } result.bitField0_ |= to_bitField0_; @@ -1006,12 +1199,14 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.Session other) { bitField0_ |= 0x00000020; onChanged(); } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000040; if (other.hasSessionState()) { mergeSessionState(other.getSessionState()); } if (!other.getUserId().isEmpty()) { userId_ = other.userId_; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); } switch (other.getExpirationCase()) { @@ -1082,17 +1277,29 @@ public Builder mergeFrom( bitField0_ |= 0x00000020; break; } // case 42 + case 66: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000040; + break; + } // case 66 case 82: { input.readMessage( internalGetSessionStateFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 82 case 98: { userId_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; break; } // case 98 case 106: @@ -1154,6 +1361,7 @@ public Builder clearExpiration() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1173,6 +1381,7 @@ public boolean hasExpireTime() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1202,6 +1411,7 @@ public com.google.protobuf.Timestamp getExpireTime() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1228,6 +1438,7 @@ public Builder setExpireTime(com.google.protobuf.Timestamp value) { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1251,6 +1462,7 @@ public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForVal * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1286,6 +1498,7 @@ public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1315,6 +1528,7 @@ public Builder clearExpireTime() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1331,6 +1545,7 @@ public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1355,6 +1570,7 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -1393,6 +1609,7 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1411,6 +1628,7 @@ public boolean hasTtl() { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1439,6 +1657,7 @@ public com.google.protobuf.Duration getTtl() { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1464,6 +1683,7 @@ public Builder setTtl(com.google.protobuf.Duration value) { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1486,6 +1706,7 @@ public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1520,6 +1741,7 @@ public Builder mergeTtl(com.google.protobuf.Duration value) { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1548,6 +1770,7 @@ public Builder clearTtl() { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1563,6 +1786,7 @@ public com.google.protobuf.Duration.Builder getTtlBuilder() { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -1586,6 +1810,7 @@ public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { * *
      * Optional. Input only. The TTL for this session.
+     * The minimum value is 24 hours.
      * 
* * @@ -2270,6 +2495,220 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000040; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000040); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000040; + return internalGetMutableLabels().getMutableMap(); + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000040; + return this; + } + + /** + * + * + *
+     * The labels with user-defined metadata to organize your Sessions.
+     *
+     * Label keys and values can be no longer than 64 characters
+     * (Unicode codepoints), can only contain lowercase letters, numeric
+     * characters, underscores and dashes. International characters are allowed.
+     *
+     * See https://goo.gl/xmQnxf for more information and examples of labels.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000040; + return this; + } + private com.google.protobuf.Struct sessionState_; private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Struct, @@ -2290,7 +2729,7 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * @return Whether the sessionState field is set. */ public boolean hasSessionState() { - return ((bitField0_ & 0x00000040) != 0); + return ((bitField0_ & 0x00000080) != 0); } /** @@ -2334,7 +2773,7 @@ public Builder setSessionState(com.google.protobuf.Struct value) { } else { sessionStateBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2355,7 +2794,7 @@ public Builder setSessionState(com.google.protobuf.Struct.Builder builderForValu } else { sessionStateBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2372,7 +2811,7 @@ public Builder setSessionState(com.google.protobuf.Struct.Builder builderForValu */ public Builder mergeSessionState(com.google.protobuf.Struct value) { if (sessionStateBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) + if (((bitField0_ & 0x00000080) != 0) && sessionState_ != null && sessionState_ != com.google.protobuf.Struct.getDefaultInstance()) { getSessionStateBuilder().mergeFrom(value); @@ -2383,7 +2822,7 @@ public Builder mergeSessionState(com.google.protobuf.Struct value) { sessionStateBuilder_.mergeFrom(value); } if (sessionState_ != null) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } return this; @@ -2400,7 +2839,7 @@ public Builder mergeSessionState(com.google.protobuf.Struct value) { *
*/ public Builder clearSessionState() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); sessionState_ = null; if (sessionStateBuilder_ != null) { sessionStateBuilder_.dispose(); @@ -2421,7 +2860,7 @@ public Builder clearSessionState() { *
*/ public com.google.protobuf.Struct.Builder getSessionStateBuilder() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return internalGetSessionStateFieldBuilder().getBuilder(); } @@ -2544,7 +2983,7 @@ public Builder setUserId(java.lang.String value) { throw new NullPointerException(); } userId_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } @@ -2564,7 +3003,7 @@ public Builder setUserId(java.lang.String value) { */ public Builder clearUserId() { userId_ = getDefaultInstance().getUserId(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000100); onChanged(); return this; } @@ -2589,7 +3028,7 @@ public Builder setUserIdBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); userId_ = value; - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000100; onChanged(); return this; } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionOrBuilder.java index f9287389676c..943d1b9b68d4 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionOrBuilder.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionOrBuilder.java @@ -33,6 +33,7 @@ public interface SessionOrBuilder * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -49,6 +50,7 @@ public interface SessionOrBuilder * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -65,6 +67,7 @@ public interface SessionOrBuilder * Optional. Timestamp of when this session is considered expired. * This is *always* provided on output, regardless of what was sent * on input. + * The minimum value is 24 hours from the time of creation. * * * .google.protobuf.Timestamp expire_time = 13 [(.google.api.field_behavior) = OPTIONAL]; @@ -77,6 +80,7 @@ public interface SessionOrBuilder * *
    * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
    * 
* * @@ -92,6 +96,7 @@ public interface SessionOrBuilder * *
    * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
    * 
* * @@ -107,6 +112,7 @@ public interface SessionOrBuilder * *
    * Optional. Input only. The TTL for this session.
+   * The minimum value is 24 hours.
    * 
* * @@ -251,6 +257,99 @@ public interface SessionOrBuilder */ com.google.protobuf.ByteString getDisplayNameBytes(); + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * The labels with user-defined metadata to organize your Sessions.
+   *
+   * Label keys and values can be no longer than 64 characters
+   * (Unicode codepoints), can only contain lowercase letters, numeric
+   * characters, underscores and dashes. International characters are allowed.
+   *
+   * See https://goo.gl/xmQnxf for more information and examples of labels.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + /** * * diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionProto.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionProto.java index 8a5b4785e10b..fc5842b68fe8 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionProto.java +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/SessionProto.java @@ -44,6 +44,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_aiplatform_v1beta1_Session_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_aiplatform_v1beta1_Session_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_Session_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_Session_LabelsEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1beta1_SessionEvent_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -60,6 +64,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_aiplatform_v1beta1_EventActions_ArtifactDeltaEntry_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_cloud_aiplatform_v1beta1_EventActions_ArtifactDeltaEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_Transcription_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_Transcription_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -75,7 +83,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e/api/resource.proto\032-google/cloud/aipla" + "tform/v1beta1/content.proto\032\036google/prot" + "obuf/duration.proto\032\034google/protobuf/str" - + "uct.proto\032\037google/protobuf/timestamp.proto\"\206\004\n" + + "uct.proto\032\037google/protobuf/timestamp.proto\"\373\004\n" + "\007Session\0226\n" + "\013expire_time\030\r" + " \001(\0132\032.google.protobuf.TimestampB\003\340A\001H\000\0220\n" @@ -85,18 +93,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\013create_time\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + "\013update_time\030\004" + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\031\n" - + "\014display_name\030\005 \001(\tB\003\340A\001\0223\n\r" + + "\014display_name\030\005 \001(\tB\003\340A\001\022D\n" + + "\006labels\030\010" + + " \003(\01324.google.cloud.aiplatform.v1beta1.Session.LabelsEntry\0223\n\r" + "session_state\030\n" + " \001(\0132\027.google.protobuf.StructB\003\340A\001\022\027\n" - + "\007user_id\030\014 \001(\tB\006\340A\005\340A\002:\232\001\352A\226\001\n" - + "!aiplatform.googleapis.com/Session\022^projects/{project}/locations/{location}/reas" - + "oningEngines/{reasoning_engine}/sessions/{session}*\010sessions2\007sessionB\014\n\n" + + "\007user_id\030\014 \001(\tB\006\340A\005\340A\002\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001:\232\001\352A\226\001\n" + + "!aiplatform.googleapis.com/Session\022^projects/{project}/locations/{location}/reasoni" + + "ngEngines/{reasoning_engine}/sessions/{session}*\010sessions2\007sessionB\014\n\n" + "expiration\"\310\004\n" + "\014SessionEvent\022\021\n" + "\004name\030\001 \001(\tB\003\340A\010\022\023\n" + "\006author\030\003 \001(\tB\003\340A\002\022>\n" - + "\007content\030\004 \001(\0132(." - + "google.cloud.aiplatform.v1beta1.ContentB\003\340A\001\022\032\n\r" + + "\007content\030\004 \001(\0132(.goo" + + "gle.cloud.aiplatform.v1beta1.ContentB\003\340A\001\022\032\n\r" + "invocation_id\030\005 \001(\tB\003\340A\002\022C\n" + "\007actions\030\006" + " \001(\0132-.google.cloud.aiplatform.v1beta1.EventActionsB\003\340A\001\0222\n" @@ -104,37 +117,44 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "error_code\030\t \001(\tB\003\340A\001\022\032\n\r" + "error_message\030\n" + " \001(\tB\003\340A\001\022K\n" - + "\016event_metadata\030\013 \001(\0132..google." - + "cloud.aiplatform.v1beta1.EventMetadataB\003\340A\001:\270\001\352A\264\001\n" - + "&aiplatform.googleapis.com/SessionEvent\022mprojects/{project}/locations" - + "/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}*\r" - + "sessionEvents2\014sessionEvent\"\233\002\n\r" + + "\016event_metadata\030\013 \001(\0132..google.clo" + + "ud.aiplatform.v1beta1.EventMetadataB\003\340A\001:\270\001\352A\264\001\n" + + "&aiplatform.googleapis.com/SessionEvent\022mprojects/{project}/locations/{l" + + "ocation}/reasoningEngines/{reasoning_engine}/sessions/{session}/events/{event}*\r" + + "sessionEvents2\014sessionEvent\"\300\003\n\r" + "EventMetadata\022S\n" - + "\022grounding_metadata\030\001 \001(\01322.g" - + "oogle.cloud.aiplatform.v1beta1.GroundingMetadataB\003\340A\001\022\024\n" + + "\022grounding_metadata\030\001 \001(\01322.goog" + + "le.cloud.aiplatform.v1beta1.GroundingMetadataB\003\340A\001\022\024\n" + "\007partial\030\002 \001(\010B\003\340A\001\022\032\n\r" + "turn_complete\030\003 \001(\010B\003\340A\001\022\030\n" + "\013interrupted\030\004 \001(\010B\003\340A\001\022\"\n" + "\025long_running_tool_ids\030\005 \003(\tB\003\340A\001\022\023\n" + "\006branch\030\006 \001(\tB\003\340A\001\0220\n" - + "\017custom_metadata\030\007 \001(\0132\027.google.protobuf.Struct\"\351\002\n" + + "\017custom_metadata\030\007 \001(\0132\027.google.protobuf.Struct\022P\n" + + "\023input_transcription\030\n" + + " \001(\0132..google.cloud.aiplatform.v1beta1.TranscriptionB\003\340A\001\022Q\n" + + "\024output_transcription\030\013 \001(\0132..google.cloud" + + ".aiplatform.v1beta1.TranscriptionB\003\340A\001\"\351\002\n" + "\014EventActions\022\037\n" + "\022skip_summarization\030\001 \001(\010B\003\340A\001\0221\n" + "\013state_delta\030\002 \001(\0132\027.google.protobuf.StructB\003\340A\001\022]\n" - + "\016artifact_delta\030\003 \003(" - + "\0132@.google.cloud.aiplatform.v1beta1.EventActions.ArtifactDeltaEntryB\003\340A\001\022\025\n" + + "\016artifact_delta\030\003 " + + "\003(\0132@.google.cloud.aiplatform.v1beta1.EventActions.ArtifactDeltaEntryB\003\340A\001\022\025\n" + "\010escalate\030\006 \001(\010B\003\340A\001\022<\n" + "\026requested_auth_configs\030\007" + " \001(\0132\027.google.protobuf.StructB\003\340A\001\022\033\n" + "\016transfer_agent\030\010 \001(\tB\003\340A\001\0324\n" + "\022ArtifactDeltaEntry\022\013\n" + "\003key\030\001 \001(\t\022\r\n" - + "\005value\030\002 \001(\005:\0028\001B\343\001\n" - + "#com.google.cloud.aiplatform.v1beta1B\014SessionProtoP\001ZCcloud.google.com/go/ai" - + "platform/apiv1beta1/aiplatformpb;aiplatf" - + "ormpb\252\002\037Google.Cloud.AIPlatform.V1Beta1\312" - + "\002\037Google\\Cloud\\AIPlatform\\V1beta1\352\002\"Goog" - + "le::Cloud::AIPlatform::V1beta1b\006proto3" + + "\005value\030\002 \001(\005:\0028\001\"9\n\r" + + "Transcription\022\021\n" + + "\004text\030\001 \001(\tB\003\340A\001\022\025\n" + + "\010finished\030\002 \001(\010B\003\340A\001B\343\001\n" + + "#com.google.cloud.aiplatform.v1beta1B\014SessionProtoP\001ZCc" + + "loud.google.com/go/aiplatform/apiv1beta1" + + "/aiplatformpb;aiplatformpb\252\002\037Google.Clou" + + "d.AIPlatform.V1Beta1\312\002\037Google\\Cloud\\AIPl" + + "atform\\V1beta1\352\002\"Google::Cloud::AIPlatform::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -159,10 +179,19 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CreateTime", "UpdateTime", "DisplayName", + "Labels", "SessionState", "UserId", "Expiration", }); + internal_static_google_cloud_aiplatform_v1beta1_Session_LabelsEntry_descriptor = + internal_static_google_cloud_aiplatform_v1beta1_Session_descriptor.getNestedType(0); + internal_static_google_cloud_aiplatform_v1beta1_Session_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_Session_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); internal_static_google_cloud_aiplatform_v1beta1_SessionEvent_descriptor = getDescriptor().getMessageType(1); internal_static_google_cloud_aiplatform_v1beta1_SessionEvent_fieldAccessorTable = @@ -192,6 +221,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "LongRunningToolIds", "Branch", "CustomMetadata", + "InputTranscription", + "OutputTranscription", }); internal_static_google_cloud_aiplatform_v1beta1_EventActions_descriptor = getDescriptor().getMessageType(3); @@ -214,6 +245,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_aiplatform_v1beta1_Transcription_descriptor = + getDescriptor().getMessageType(4); + internal_static_google_cloud_aiplatform_v1beta1_Transcription_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_Transcription_descriptor, + new java.lang.String[] { + "Text", "Finished", + }); descriptor.resolveAllFeaturesImmutable(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Transcription.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Transcription.java new file mode 100644 index 000000000000..4b7768464aac --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/Transcription.java @@ -0,0 +1,693 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1beta1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1beta1; + +/** + * + * + *
+ * Audio transcription in Server Content.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.Transcription} + */ +@com.google.protobuf.Generated +public final class Transcription extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.Transcription) + TranscriptionOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Transcription"); + } + + // Use Transcription.newBuilder() to construct. + private Transcription(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private Transcription() { + text_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.SessionProto + .internal_static_google_cloud_aiplatform_v1beta1_Transcription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.SessionProto + .internal_static_google_cloud_aiplatform_v1beta1_Transcription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.Transcription.class, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder.class); + } + + public static final int TEXT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object text_ = ""; + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + @java.lang.Override + public java.lang.String getText() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINISHED_FIELD_NUMBER = 2; + private boolean finished_ = false; + + /** + * + * + *
+   * Optional. The bool indicates the end of the transcription.
+   * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finished. + */ + @java.lang.Override + public boolean getFinished() { + return finished_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, text_); + } + if (finished_ != false) { + output.writeBool(2, finished_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(text_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, text_); + } + if (finished_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, finished_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1beta1.Transcription)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1beta1.Transcription other = + (com.google.cloud.aiplatform.v1beta1.Transcription) obj; + + if (!getText().equals(other.getText())) return false; + if (getFinished() != other.getFinished()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + FINISHED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFinished()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.aiplatform.v1beta1.Transcription prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Audio transcription in Server Content.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.Transcription} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.Transcription) + com.google.cloud.aiplatform.v1beta1.TranscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.SessionProto + .internal_static_google_cloud_aiplatform_v1beta1_Transcription_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.SessionProto + .internal_static_google_cloud_aiplatform_v1beta1_Transcription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.Transcription.class, + com.google.cloud.aiplatform.v1beta1.Transcription.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1beta1.Transcription.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + text_ = ""; + finished_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1beta1.SessionProto + .internal_static_google_cloud_aiplatform_v1beta1_Transcription_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Transcription getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Transcription build() { + com.google.cloud.aiplatform.v1beta1.Transcription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Transcription buildPartial() { + com.google.cloud.aiplatform.v1beta1.Transcription result = + new com.google.cloud.aiplatform.v1beta1.Transcription(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.aiplatform.v1beta1.Transcription result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.text_ = text_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.finished_ = finished_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1beta1.Transcription) { + return mergeFrom((com.google.cloud.aiplatform.v1beta1.Transcription) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.Transcription other) { + if (other == com.google.cloud.aiplatform.v1beta1.Transcription.getDefaultInstance()) + return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getFinished() != false) { + setFinished(other.getFinished()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + text_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + finished_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object text_ = ""; + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + public com.google.protobuf.ByteString getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The text to set. + * @return This builder for chaining. + */ + public Builder setText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearText() { + text_ = getDefaultInstance().getText(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Transcription text.
+     * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for text to set. + * @return This builder for chaining. + */ + public Builder setTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + text_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private boolean finished_; + + /** + * + * + *
+     * Optional. The bool indicates the end of the transcription.
+     * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finished. + */ + @java.lang.Override + public boolean getFinished() { + return finished_; + } + + /** + * + * + *
+     * Optional. The bool indicates the end of the transcription.
+     * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The finished to set. + * @return This builder for chaining. + */ + public Builder setFinished(boolean value) { + + finished_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The bool indicates the end of the transcription.
+     * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFinished() { + bitField0_ = (bitField0_ & ~0x00000002); + finished_ = false; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.Transcription) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.Transcription) + private static final com.google.cloud.aiplatform.v1beta1.Transcription DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.Transcription(); + } + + public static com.google.cloud.aiplatform.v1beta1.Transcription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Transcription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.Transcription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/TranscriptionOrBuilder.java b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/TranscriptionOrBuilder.java new file mode 100644 index 000000000000..756a77629246 --- /dev/null +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/TranscriptionOrBuilder.java @@ -0,0 +1,67 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: google/cloud/aiplatform/v1beta1/session.proto +// Protobuf Java Version: 4.33.2 + +package com.google.cloud.aiplatform.v1beta1; + +@com.google.protobuf.Generated +public interface TranscriptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.Transcription) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The text. + */ + java.lang.String getText(); + + /** + * + * + *
+   * Optional. Transcription text.
+   * 
+ * + * string text = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for text. + */ + com.google.protobuf.ByteString getTextBytes(); + + /** + * + * + *
+   * Optional. The bool indicates the end of the transcription.
+   * 
+ * + * bool finished = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The finished. + */ + boolean getFinished(); +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/reasoning_engine.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/reasoning_engine.proto index 85b43672ca7c..2edf93b6fd70 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/reasoning_engine.proto +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/reasoning_engine.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -118,6 +118,15 @@ message ReasoningEngineSpec { ]; } + // The image spec for building an image (within a single build step), based + // on the config file (i.e. Dockerfile) in the source directory. + message ImageSpec { + // Optional. Build arguments to be used. They will be passed through + // --build-arg flags. + map build_args = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + // Specifies the configuration for fetching source code from a Git // repository that is managed by Developer Connect. This includes the // repository, revision, and directory to use. @@ -189,6 +198,9 @@ message ReasoningEngineSpec { oneof language_spec { // Configuration for a Python application. PythonSpec python_spec = 2; + + // Optional. Configuration for building an image with custom config file. + ImageSpec image_spec = 5 [(google.api.field_behavior) = OPTIONAL]; } } diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session.proto index 8e3a7f7049e1..f973d5a54335 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session.proto +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -45,10 +45,12 @@ message Session { // Optional. Timestamp of when this session is considered expired. // This is *always* provided on output, regardless of what was sent // on input. + // The minimum value is 24 hours from the time of creation. google.protobuf.Timestamp expire_time = 13 [(google.api.field_behavior) = OPTIONAL]; // Optional. Input only. The TTL for this session. + // The minimum value is 24 hours. google.protobuf.Duration ttl = 14 [ (google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = INPUT_ONLY @@ -71,6 +73,15 @@ message Session { // Optional. The display name of the session. string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + // The labels with user-defined metadata to organize your Sessions. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + map labels = 8; + // Optional. Session specific memory which stores key conversation points. google.protobuf.Struct session_state = 10 [(google.api.field_behavior) = OPTIONAL]; @@ -155,6 +166,14 @@ message EventMetadata { // The custom metadata of the LlmResponse. google.protobuf.Struct custom_metadata = 7; + + // Optional. Audio transcription of user input. + Transcription input_transcription = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Audio transcription of model output. + Transcription output_transcription = 11 + [(google.api.field_behavior) = OPTIONAL]; } // Actions are parts of events that are executed by the agent. @@ -186,3 +205,12 @@ message EventActions { // Optional. If set, the event transfers to the specified agent. string transfer_agent = 8 [(google.api.field_behavior) = OPTIONAL]; } + +// Audio transcription in Server Content. +message Transcription { + // Optional. Transcription text. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The bool indicates the end of the transcription. + bool finished = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session_service.proto b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session_service.proto index bc29ed611af9..2f9384ec37ec 100644 --- a/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session_service.proto +++ b/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/session_service.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -205,8 +205,9 @@ message ListSessionsRequest { // Supported fields: // * `display_name` // * `user_id` + // * `labels` // - // Example: `display_name="abc"`, `user_id="123"`. + // Example: `display_name="abc"`, `user_id="123"`, `labels.key="value"`. string filter = 4 [(google.api.field_behavior) = OPTIONAL]; // Optional. A comma-separated list of fields to order by, sorted in ascending diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/AsyncAppendEvent.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/AsyncAppendEvent.java new file mode 100644 index 000000000000..1b0b4bb24cff --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/AsyncAppendEvent.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_AppendEvent_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.AppendEventRequest; +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class AsyncAppendEvent { + + public static void main(String[] args) throws Exception { + asyncAppendEvent(); + } + + public static void asyncAppendEvent() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + AppendEventRequest request = + AppendEventRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setEvent(SessionEvent.newBuilder().build()) + .build(); + ApiFuture future = + sessionServiceClient.appendEventCallable().futureCall(request); + // Do something. + AppendEventResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_AppendEvent_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEvent.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEvent.java new file mode 100644 index 000000000000..195a66e678fb --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEvent.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_AppendEvent_sync] +import com.google.cloud.aiplatform.v1.AppendEventRequest; +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncAppendEvent { + + public static void main(String[] args) throws Exception { + syncAppendEvent(); + } + + public static void syncAppendEvent() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + AppendEventRequest request = + AppendEventRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setEvent(SessionEvent.newBuilder().build()) + .build(); + AppendEventResponse response = sessionServiceClient.appendEvent(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_AppendEvent_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEventSessionnameSessionevent.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEventSessionnameSessionevent.java new file mode 100644 index 000000000000..7f7dfb466c97 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEventSessionnameSessionevent.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_AppendEvent_SessionnameSessionevent_sync] +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncAppendEventSessionnameSessionevent { + + public static void main(String[] args) throws Exception { + syncAppendEventSessionnameSessionevent(); + } + + public static void syncAppendEventSessionnameSessionevent() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + SessionName name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + SessionEvent event = SessionEvent.newBuilder().build(); + AppendEventResponse response = sessionServiceClient.appendEvent(name, event); + } + } +} +// [END aiplatform_v1_generated_SessionService_AppendEvent_SessionnameSessionevent_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEventStringSessionevent.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEventStringSessionevent.java new file mode 100644 index 000000000000..1892f4317274 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/appendevent/SyncAppendEventStringSessionevent.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_AppendEvent_StringSessionevent_sync] +import com.google.cloud.aiplatform.v1.AppendEventResponse; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncAppendEventStringSessionevent { + + public static void main(String[] args) throws Exception { + syncAppendEventStringSessionevent(); + } + + public static void syncAppendEventStringSessionevent() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + String name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString(); + SessionEvent event = SessionEvent.newBuilder().build(); + AppendEventResponse response = sessionServiceClient.appendEvent(name, event); + } + } +} +// [END aiplatform_v1_generated_SessionService_AppendEvent_StringSessionevent_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/create/SyncCreateSetCredentialsProvider.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..1c79eb7b8eb1 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.aiplatform.v1.SessionServiceSettings; +import com.google.cloud.aiplatform.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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 + SessionServiceSettings sessionServiceSettings = + SessionServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SessionServiceClient sessionServiceClient = SessionServiceClient.create(sessionServiceSettings); + } +} +// [END aiplatform_v1_generated_SessionService_Create_SetCredentialsProvider_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/create/SyncCreateSetEndpoint.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a6a4aa5aaa29 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_Create_SetEndpoint_sync] +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.aiplatform.v1.SessionServiceSettings; +import com.google.cloud.aiplatform.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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 + SessionServiceSettings sessionServiceSettings = + SessionServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SessionServiceClient sessionServiceClient = SessionServiceClient.create(sessionServiceSettings); + } +} +// [END aiplatform_v1_generated_SessionService_Create_SetEndpoint_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/AsyncCreateSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/AsyncCreateSession.java new file mode 100644 index 000000000000..42227b3ada97 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/AsyncCreateSession.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_CreateSession_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.CreateSessionRequest; +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.longrunning.Operation; + +public class AsyncCreateSession { + + public static void main(String[] args) throws Exception { + asyncCreateSession(); + } + + public static void asyncCreateSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder() + .setParent( + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]") + .toString()) + .setSession(Session.newBuilder().build()) + .build(); + ApiFuture future = + sessionServiceClient.createSessionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_CreateSession_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/AsyncCreateSessionLRO.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/AsyncCreateSessionLRO.java new file mode 100644 index 000000000000..8b765c2a5aac --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/AsyncCreateSessionLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_CreateSession_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.aiplatform.v1.CreateSessionOperationMetadata; +import com.google.cloud.aiplatform.v1.CreateSessionRequest; +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class AsyncCreateSessionLRO { + + public static void main(String[] args) throws Exception { + asyncCreateSessionLRO(); + } + + public static void asyncCreateSessionLRO() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder() + .setParent( + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]") + .toString()) + .setSession(Session.newBuilder().build()) + .build(); + OperationFuture future = + sessionServiceClient.createSessionOperationCallable().futureCall(request); + // Do something. + Session response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_CreateSession_LRO_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSession.java new file mode 100644 index 000000000000..6bdc34502754 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSession.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_CreateSession_sync] +import com.google.cloud.aiplatform.v1.CreateSessionRequest; +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + CreateSessionRequest request = + CreateSessionRequest.newBuilder() + .setParent( + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]") + .toString()) + .setSession(Session.newBuilder().build()) + .build(); + Session response = sessionServiceClient.createSessionAsync(request).get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_CreateSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSessionReasoningenginenameSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSessionReasoningenginenameSession.java new file mode 100644 index 000000000000..4a23859b9d03 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSessionReasoningenginenameSession.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_CreateSession_ReasoningenginenameSession_sync] +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncCreateSessionReasoningenginenameSession { + + public static void main(String[] args) throws Exception { + syncCreateSessionReasoningenginenameSession(); + } + + public static void syncCreateSessionReasoningenginenameSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ReasoningEngineName parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]"); + Session session = Session.newBuilder().build(); + Session response = sessionServiceClient.createSessionAsync(parent, session).get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_CreateSession_ReasoningenginenameSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSessionStringSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSessionStringSession.java new file mode 100644 index 000000000000..7108aaeab4bc --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/createsession/SyncCreateSessionStringSession.java @@ -0,0 +1,44 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_CreateSession_StringSession_sync] +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncCreateSessionStringSession { + + public static void main(String[] args) throws Exception { + syncCreateSessionStringSession(); + } + + public static void syncCreateSessionStringSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + String parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString(); + Session session = Session.newBuilder().build(); + Session response = sessionServiceClient.createSessionAsync(parent, session).get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_CreateSession_StringSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/AsyncDeleteSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/AsyncDeleteSession.java new file mode 100644 index 000000000000..ccd8db5bb285 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/AsyncDeleteSession.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_DeleteSession_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.DeleteSessionRequest; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteSession { + + public static void main(String[] args) throws Exception { + asyncDeleteSession(); + } + + public static void asyncDeleteSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .build(); + ApiFuture future = + sessionServiceClient.deleteSessionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_DeleteSession_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/AsyncDeleteSessionLRO.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/AsyncDeleteSessionLRO.java new file mode 100644 index 000000000000..805e6a71800e --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/AsyncDeleteSessionLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_DeleteSession_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.aiplatform.v1.DeleteOperationMetadata; +import com.google.cloud.aiplatform.v1.DeleteSessionRequest; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.protobuf.Empty; + +public class AsyncDeleteSessionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteSessionLRO(); + } + + public static void asyncDeleteSessionLRO() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .build(); + OperationFuture future = + sessionServiceClient.deleteSessionOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_DeleteSession_LRO_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSession.java new file mode 100644 index 000000000000..56c945b1ea51 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSession.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_DeleteSession_sync] +import com.google.cloud.aiplatform.v1.DeleteSessionRequest; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSession { + + public static void main(String[] args) throws Exception { + syncDeleteSession(); + } + + public static void syncDeleteSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + DeleteSessionRequest request = + DeleteSessionRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .build(); + sessionServiceClient.deleteSessionAsync(request).get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_DeleteSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSessionSessionname.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSessionSessionname.java new file mode 100644 index 000000000000..bb3925853b94 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSessionSessionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_DeleteSession_Sessionname_sync] +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSessionSessionname { + + public static void main(String[] args) throws Exception { + syncDeleteSessionSessionname(); + } + + public static void syncDeleteSessionSessionname() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + SessionName name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + sessionServiceClient.deleteSessionAsync(name).get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_DeleteSession_Sessionname_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSessionString.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSessionString.java new file mode 100644 index 000000000000..c6aec1e5de77 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/deletesession/SyncDeleteSessionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_DeleteSession_String_sync] +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.protobuf.Empty; + +public class SyncDeleteSessionString { + + public static void main(String[] args) throws Exception { + syncDeleteSessionString(); + } + + public static void syncDeleteSessionString() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + String name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString(); + sessionServiceClient.deleteSessionAsync(name).get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_DeleteSession_String_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getiampolicy/AsyncGetIamPolicy.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 000000000000..ab993b1f1910 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.EndpointName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = sessionServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetIamPolicy_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getiampolicy/SyncGetIamPolicy.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 000000000000..36432773a952 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetIamPolicy_sync] +import com.google.cloud.aiplatform.v1.EndpointName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = sessionServiceClient.getIamPolicy(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetIamPolicy_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getlocation/AsyncGetLocation.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..2444c63869e6 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = sessionServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetLocation_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getlocation/SyncGetLocation.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..11216db4dff1 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetLocation_sync] +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = sessionServiceClient.getLocation(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetLocation_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/AsyncGetSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/AsyncGetSession.java new file mode 100644 index 000000000000..094ec9212da8 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/AsyncGetSession.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetSession_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.GetSessionRequest; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class AsyncGetSession { + + public static void main(String[] args) throws Exception { + asyncGetSession(); + } + + public static void asyncGetSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + GetSessionRequest request = + GetSessionRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .build(); + ApiFuture future = sessionServiceClient.getSessionCallable().futureCall(request); + // Do something. + Session response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetSession_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSession.java new file mode 100644 index 000000000000..460876112c52 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSession.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetSession_sync] +import com.google.cloud.aiplatform.v1.GetSessionRequest; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncGetSession { + + public static void main(String[] args) throws Exception { + syncGetSession(); + } + + public static void syncGetSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + GetSessionRequest request = + GetSessionRequest.newBuilder() + .setName( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .build(); + Session response = sessionServiceClient.getSession(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSessionSessionname.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSessionSessionname.java new file mode 100644 index 000000000000..1d94860d4b8a --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSessionSessionname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetSession_Sessionname_sync] +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncGetSessionSessionname { + + public static void main(String[] args) throws Exception { + syncGetSessionSessionname(); + } + + public static void syncGetSessionSessionname() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + SessionName name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + Session response = sessionServiceClient.getSession(name); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetSession_Sessionname_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSessionString.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSessionString.java new file mode 100644 index 000000000000..4e2fa8847dbf --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/getsession/SyncGetSessionString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_GetSession_String_sync] +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncGetSessionString { + + public static void main(String[] args) throws Exception { + syncGetSessionString(); + } + + public static void syncGetSessionString() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + String name = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString(); + Session response = sessionServiceClient.getSession(name); + } + } +} +// [END aiplatform_v1_generated_SessionService_GetSession_String_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/AsyncListEvents.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/AsyncListEvents.java new file mode 100644 index 000000000000..66659e62b063 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/AsyncListEvents.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListEvents_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.ListEventsRequest; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class AsyncListEvents { + + public static void main(String[] args) throws Exception { + asyncListEvents(); + } + + public static void asyncListEvents() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListEventsRequest request = + ListEventsRequest.newBuilder() + .setParent( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + sessionServiceClient.listEventsPagedCallable().futureCall(request); + // Do something. + for (SessionEvent element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListEvents_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/AsyncListEventsPaged.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/AsyncListEventsPaged.java new file mode 100644 index 000000000000..73119563dce9 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/AsyncListEventsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListEvents_Paged_async] +import com.google.cloud.aiplatform.v1.ListEventsRequest; +import com.google.cloud.aiplatform.v1.ListEventsResponse; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.common.base.Strings; + +public class AsyncListEventsPaged { + + public static void main(String[] args) throws Exception { + asyncListEventsPaged(); + } + + public static void asyncListEventsPaged() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListEventsRequest request = + ListEventsRequest.newBuilder() + .setParent( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListEventsResponse response = sessionServiceClient.listEventsCallable().call(request); + for (SessionEvent element : response.getSessionEventsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListEvents_Paged_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEvents.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEvents.java new file mode 100644 index 000000000000..67d801047a19 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEvents.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListEvents_sync] +import com.google.cloud.aiplatform.v1.ListEventsRequest; +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncListEvents { + + public static void main(String[] args) throws Exception { + syncListEvents(); + } + + public static void syncListEvents() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListEventsRequest request = + ListEventsRequest.newBuilder() + .setParent( + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (SessionEvent element : sessionServiceClient.listEvents(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListEvents_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEventsSessionname.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEventsSessionname.java new file mode 100644 index 000000000000..caa905461504 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEventsSessionname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListEvents_Sessionname_sync] +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncListEventsSessionname { + + public static void main(String[] args) throws Exception { + syncListEventsSessionname(); + } + + public static void syncListEventsSessionname() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + SessionName parent = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]"); + for (SessionEvent element : sessionServiceClient.listEvents(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListEvents_Sessionname_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEventsString.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEventsString.java new file mode 100644 index 000000000000..fe1040583ddd --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listevents/SyncListEventsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListEvents_String_sync] +import com.google.cloud.aiplatform.v1.SessionEvent; +import com.google.cloud.aiplatform.v1.SessionName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncListEventsString { + + public static void main(String[] args) throws Exception { + syncListEventsString(); + } + + public static void syncListEventsString() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + String parent = + SessionName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[SESSION]").toString(); + for (SessionEvent element : sessionServiceClient.listEvents(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListEvents_String_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/AsyncListLocations.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..6f9716f9effa --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + sessionServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListLocations_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/AsyncListLocationsPaged.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..1f0a658d2bc4 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListLocations_Paged_async] +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = sessionServiceClient.listLocationsCallable().call(request); + for (Location element : response.getLocationsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListLocations_Paged_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/SyncListLocations.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..b839fbc4ef5d --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListLocations_sync] +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : sessionServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListLocations_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/AsyncListSessions.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/AsyncListSessions.java new file mode 100644 index 000000000000..e48b6de58632 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/AsyncListSessions.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListSessions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.ListSessionsRequest; +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class AsyncListSessions { + + public static void main(String[] args) throws Exception { + asyncListSessions(); + } + + public static void asyncListSessions() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent( + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + sessionServiceClient.listSessionsPagedCallable().futureCall(request); + // Do something. + for (Session element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListSessions_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/AsyncListSessionsPaged.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/AsyncListSessionsPaged.java new file mode 100644 index 000000000000..ffe05f288bce --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/AsyncListSessionsPaged.java @@ -0,0 +1,65 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListSessions_Paged_async] +import com.google.cloud.aiplatform.v1.ListSessionsRequest; +import com.google.cloud.aiplatform.v1.ListSessionsResponse; +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.common.base.Strings; + +public class AsyncListSessionsPaged { + + public static void main(String[] args) throws Exception { + asyncListSessionsPaged(); + } + + public static void asyncListSessionsPaged() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent( + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListSessionsResponse response = sessionServiceClient.listSessionsCallable().call(request); + for (Session element : response.getSessionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListSessions_Paged_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessions.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessions.java new file mode 100644 index 000000000000..bb53a77c1c5b --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListSessions_sync] +import com.google.cloud.aiplatform.v1.ListSessionsRequest; +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncListSessions { + + public static void main(String[] args) throws Exception { + syncListSessions(); + } + + public static void syncListSessions() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ListSessionsRequest request = + ListSessionsRequest.newBuilder() + .setParent( + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Session element : sessionServiceClient.listSessions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListSessions_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessionsReasoningenginename.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessionsReasoningenginename.java new file mode 100644 index 000000000000..bdab33855415 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessionsReasoningenginename.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListSessions_Reasoningenginename_sync] +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncListSessionsReasoningenginename { + + public static void main(String[] args) throws Exception { + syncListSessionsReasoningenginename(); + } + + public static void syncListSessionsReasoningenginename() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + ReasoningEngineName parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]"); + for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListSessions_Reasoningenginename_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessionsString.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessionsString.java new file mode 100644 index 000000000000..8a5c8bb29dbd --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/listsessions/SyncListSessionsString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_ListSessions_String_sync] +import com.google.cloud.aiplatform.v1.ReasoningEngineName; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; + +public class SyncListSessionsString { + + public static void main(String[] args) throws Exception { + syncListSessionsString(); + } + + public static void syncListSessionsString() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + String parent = + ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString(); + for (Session element : sessionServiceClient.listSessions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END aiplatform_v1_generated_SessionService_ListSessions_String_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/setiampolicy/AsyncSetIamPolicy.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 000000000000..1edaa3e920d4 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_SetIamPolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.EndpointName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = sessionServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_SetIamPolicy_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/setiampolicy/SyncSetIamPolicy.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 000000000000..cc8a319d56cf --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_SetIamPolicy_sync] +import com.google.cloud.aiplatform.v1.EndpointName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = sessionServiceClient.setIamPolicy(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_SetIamPolicy_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/testiampermissions/AsyncTestIamPermissions.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 000000000000..e7eb98078b61 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,55 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_TestIamPermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.EndpointName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + sessionServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_TestIamPermissions_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/testiampermissions/SyncTestIamPermissions.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 000000000000..88632cbedf82 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_TestIamPermissions_sync] +import com.google.cloud.aiplatform.v1.EndpointName; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + EndpointName.ofProjectLocationEndpointName( + "[PROJECT]", "[LOCATION]", "[ENDPOINT]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = sessionServiceClient.testIamPermissions(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_TestIamPermissions_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/AsyncUpdateSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/AsyncUpdateSession.java new file mode 100644 index 000000000000..0eafdb0d39b5 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/AsyncUpdateSession.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_UpdateSession_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.aiplatform.v1.UpdateSessionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSession { + + public static void main(String[] args) throws Exception { + asyncUpdateSession(); + } + + public static void asyncUpdateSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + UpdateSessionRequest request = + UpdateSessionRequest.newBuilder() + .setSession(Session.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = sessionServiceClient.updateSessionCallable().futureCall(request); + // Do something. + Session response = future.get(); + } + } +} +// [END aiplatform_v1_generated_SessionService_UpdateSession_async] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/SyncUpdateSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/SyncUpdateSession.java new file mode 100644 index 000000000000..6ccb1d4049a0 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/SyncUpdateSession.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_UpdateSession_sync] +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.cloud.aiplatform.v1.UpdateSessionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSession { + + public static void main(String[] args) throws Exception { + syncUpdateSession(); + } + + public static void syncUpdateSession() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + UpdateSessionRequest request = + UpdateSessionRequest.newBuilder() + .setSession(Session.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Session response = sessionServiceClient.updateSession(request); + } + } +} +// [END aiplatform_v1_generated_SessionService_UpdateSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/SyncUpdateSessionSessionFieldmask.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/SyncUpdateSessionSessionFieldmask.java new file mode 100644 index 000000000000..55fdee0dffed --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservice/updatesession/SyncUpdateSessionSessionFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionService_UpdateSession_SessionFieldmask_sync] +import com.google.cloud.aiplatform.v1.Session; +import com.google.cloud.aiplatform.v1.SessionServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSessionSessionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSessionSessionFieldmask(); + } + + public static void syncUpdateSessionSessionFieldmask() throws Exception { + // 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 (SessionServiceClient sessionServiceClient = SessionServiceClient.create()) { + Session session = Session.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Session response = sessionServiceClient.updateSession(session, updateMask); + } + } +} +// [END aiplatform_v1_generated_SessionService_UpdateSession_SessionFieldmask_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservicesettings/createsession/SyncCreateSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservicesettings/createsession/SyncCreateSession.java new file mode 100644 index 000000000000..51422cefe36c --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservicesettings/createsession/SyncCreateSession.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionServiceSettings_CreateSession_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.aiplatform.v1.SessionServiceSettings; +import java.time.Duration; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() throws Exception { + // 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 + SessionServiceSettings.Builder sessionServiceSettingsBuilder = + SessionServiceSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + sessionServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END aiplatform_v1_generated_SessionServiceSettings_CreateSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservicesettings/getsession/SyncGetSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservicesettings/getsession/SyncGetSession.java new file mode 100644 index 000000000000..16c2a444e6c8 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/sessionservicesettings/getsession/SyncGetSession.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.samples; + +// [START aiplatform_v1_generated_SessionServiceSettings_GetSession_sync] +import com.google.cloud.aiplatform.v1.SessionServiceSettings; +import java.time.Duration; + +public class SyncGetSession { + + public static void main(String[] args) throws Exception { + syncGetSession(); + } + + public static void syncGetSession() throws Exception { + // 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 + SessionServiceSettings.Builder sessionServiceSettingsBuilder = + SessionServiceSettings.newBuilder(); + sessionServiceSettingsBuilder + .getSessionSettings() + .setRetrySettings( + sessionServiceSettingsBuilder + .getSessionSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + SessionServiceSettings sessionServiceSettings = sessionServiceSettingsBuilder.build(); + } +} +// [END aiplatform_v1_generated_SessionServiceSettings_GetSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/stub/sessionservicestubsettings/createsession/SyncCreateSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/stub/sessionservicestubsettings/createsession/SyncCreateSession.java new file mode 100644 index 000000000000..caf1aae8e208 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/stub/sessionservicestubsettings/createsession/SyncCreateSession.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub.samples; + +// [START aiplatform_v1_generated_SessionServiceStubSettings_CreateSession_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.aiplatform.v1.stub.SessionServiceStubSettings; +import java.time.Duration; + +public class SyncCreateSession { + + public static void main(String[] args) throws Exception { + syncCreateSession(); + } + + public static void syncCreateSession() throws Exception { + // 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 + SessionServiceStubSettings.Builder sessionServiceSettingsBuilder = + SessionServiceStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + sessionServiceSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END aiplatform_v1_generated_SessionServiceStubSettings_CreateSession_sync] diff --git a/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/stub/sessionservicestubsettings/getsession/SyncGetSession.java b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/stub/sessionservicestubsettings/getsession/SyncGetSession.java new file mode 100644 index 000000000000..b1ff95d1dfe9 --- /dev/null +++ b/java-aiplatform/samples/snippets/generated/com/google/cloud/aiplatform/v1/stub/sessionservicestubsettings/getsession/SyncGetSession.java @@ -0,0 +1,56 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.aiplatform.v1.stub.samples; + +// [START aiplatform_v1_generated_SessionServiceStubSettings_GetSession_sync] +import com.google.cloud.aiplatform.v1.stub.SessionServiceStubSettings; +import java.time.Duration; + +public class SyncGetSession { + + public static void main(String[] args) throws Exception { + syncGetSession(); + } + + public static void syncGetSession() throws Exception { + // 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 + SessionServiceStubSettings.Builder sessionServiceSettingsBuilder = + SessionServiceStubSettings.newBuilder(); + sessionServiceSettingsBuilder + .getSessionSettings() + .setRetrySettings( + sessionServiceSettingsBuilder + .getSessionSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + SessionServiceStubSettings sessionServiceSettings = sessionServiceSettingsBuilder.build(); + } +} +// [END aiplatform_v1_generated_SessionServiceStubSettings_GetSession_sync]