/*
 * 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/pubsub/v1/pubsub.proto
// Protobuf Java Version: 4.33.2

package com.google.pubsub.v1;

/**
 *
 *
 * <pre>
 * Configuration for making inference requests against Vertex AI models.
 * </pre>
 *
 * Protobuf type {@code google.pubsub.v1.AIInference}
 */
@com.google.protobuf.Generated
public final class AIInference extends com.google.protobuf.GeneratedMessage
    implements
    // @@protoc_insertion_point(message_implements:google.pubsub.v1.AIInference)
    AIInferenceOrBuilder {
  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= */ "",
        "AIInference");
  }

  // Use AIInference.newBuilder() to construct.
  private AIInference(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }

  private AIInference() {
    endpoint_ = "";
    serviceAccountEmail_ = "";
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_AIInference_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.pubsub.v1.PubsubProto
        .internal_static_google_pubsub_v1_AIInference_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.pubsub.v1.AIInference.class, com.google.pubsub.v1.AIInference.Builder.class);
  }

  public interface UnstructuredInferenceOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.AIInference.UnstructuredInference)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. A parameters object to be included in each inference request.
     * The parameters object is combined with the data field of the Pub/Sub
     * message to form the inference request.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the parameters field is set.
     */
    boolean hasParameters();

    /**
     *
     *
     * <pre>
     * Optional. A parameters object to be included in each inference request.
     * The parameters object is combined with the data field of the Pub/Sub
     * message to form the inference request.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The parameters.
     */
    com.google.protobuf.Struct getParameters();

    /**
     *
     *
     * <pre>
     * Optional. A parameters object to be included in each inference request.
     * The parameters object is combined with the data field of the Pub/Sub
     * message to form the inference request.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.protobuf.StructOrBuilder getParametersOrBuilder();
  }

  /**
   *
   *
   * <pre>
   * Configuration for making inferences using arbitrary JSON payloads.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.AIInference.UnstructuredInference}
   */
  public static final class UnstructuredInference extends com.google.protobuf.GeneratedMessage
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.AIInference.UnstructuredInference)
      UnstructuredInferenceOrBuilder {
    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= */ "",
          "UnstructuredInference");
    }

    // Use UnstructuredInference.newBuilder() to construct.
    private UnstructuredInference(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
    }

    private UnstructuredInference() {}

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_AIInference_UnstructuredInference_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_AIInference_UnstructuredInference_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.AIInference.UnstructuredInference.class,
              com.google.pubsub.v1.AIInference.UnstructuredInference.Builder.class);
    }

    private int bitField0_;
    public static final int PARAMETERS_FIELD_NUMBER = 1;
    private com.google.protobuf.Struct parameters_;

    /**
     *
     *
     * <pre>
     * Optional. A parameters object to be included in each inference request.
     * The parameters object is combined with the data field of the Pub/Sub
     * message to form the inference request.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the parameters field is set.
     */
    @java.lang.Override
    public boolean hasParameters() {
      return ((bitField0_ & 0x00000001) != 0);
    }

    /**
     *
     *
     * <pre>
     * Optional. A parameters object to be included in each inference request.
     * The parameters object is combined with the data field of the Pub/Sub
     * message to form the inference request.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The parameters.
     */
    @java.lang.Override
    public com.google.protobuf.Struct getParameters() {
      return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_;
    }

    /**
     *
     *
     * <pre>
     * Optional. A parameters object to be included in each inference request.
     * The parameters object is combined with the data field of the Pub/Sub
     * message to form the inference request.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.protobuf.StructOrBuilder getParametersOrBuilder() {
      return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_;
    }

    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, getParameters());
      }
      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, getParameters());
      }
      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.pubsub.v1.AIInference.UnstructuredInference)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.AIInference.UnstructuredInference other =
          (com.google.pubsub.v1.AIInference.UnstructuredInference) obj;

      if (hasParameters() != other.hasParameters()) return false;
      if (hasParameters()) {
        if (!getParameters().equals(other.getParameters())) 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 (hasParameters()) {
        hash = (37 * hash) + PARAMETERS_FIELD_NUMBER;
        hash = (53 * hash) + getParameters().hashCode();
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference 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.pubsub.v1.AIInference.UnstructuredInference parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference 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.pubsub.v1.AIInference.UnstructuredInference parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference 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.pubsub.v1.AIInference.UnstructuredInference parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference 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.pubsub.v1.AIInference.UnstructuredInference 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;
    }

    /**
     *
     *
     * <pre>
     * Configuration for making inferences using arbitrary JSON payloads.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.AIInference.UnstructuredInference}
     */
    public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.AIInference.UnstructuredInference)
        com.google.pubsub.v1.AIInference.UnstructuredInferenceOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_AIInference_UnstructuredInference_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_AIInference_UnstructuredInference_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.AIInference.UnstructuredInference.class,
                com.google.pubsub.v1.AIInference.UnstructuredInference.Builder.class);
      }

      // Construct using com.google.pubsub.v1.AIInference.UnstructuredInference.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          internalGetParametersFieldBuilder();
        }
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        parameters_ = null;
        if (parametersBuilder_ != null) {
          parametersBuilder_.dispose();
          parametersBuilder_ = null;
        }
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_AIInference_UnstructuredInference_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.AIInference.UnstructuredInference getDefaultInstanceForType() {
        return com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.AIInference.UnstructuredInference build() {
        com.google.pubsub.v1.AIInference.UnstructuredInference result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.AIInference.UnstructuredInference buildPartial() {
        com.google.pubsub.v1.AIInference.UnstructuredInference result =
            new com.google.pubsub.v1.AIInference.UnstructuredInference(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.google.pubsub.v1.AIInference.UnstructuredInference result) {
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.parameters_ =
              parametersBuilder_ == null ? parameters_ : parametersBuilder_.build();
          to_bitField0_ |= 0x00000001;
        }
        result.bitField0_ |= to_bitField0_;
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.google.pubsub.v1.AIInference.UnstructuredInference) {
          return mergeFrom((com.google.pubsub.v1.AIInference.UnstructuredInference) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.pubsub.v1.AIInference.UnstructuredInference other) {
        if (other == com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance())
          return this;
        if (other.hasParameters()) {
          mergeParameters(other.getParameters());
        }
        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(
                      internalGetParametersFieldBuilder().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.protobuf.Struct parameters_;
      private com.google.protobuf.SingleFieldBuilder<
              com.google.protobuf.Struct,
              com.google.protobuf.Struct.Builder,
              com.google.protobuf.StructOrBuilder>
          parametersBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the parameters field is set.
       */
      public boolean hasParameters() {
        return ((bitField0_ & 0x00000001) != 0);
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The parameters.
       */
      public com.google.protobuf.Struct getParameters() {
        if (parametersBuilder_ == null) {
          return parameters_ == null
              ? com.google.protobuf.Struct.getDefaultInstance()
              : parameters_;
        } else {
          return parametersBuilder_.getMessage();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setParameters(com.google.protobuf.Struct value) {
        if (parametersBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          parameters_ = value;
        } else {
          parametersBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setParameters(com.google.protobuf.Struct.Builder builderForValue) {
        if (parametersBuilder_ == null) {
          parameters_ = builderForValue.build();
        } else {
          parametersBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeParameters(com.google.protobuf.Struct value) {
        if (parametersBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)
              && parameters_ != null
              && parameters_ != com.google.protobuf.Struct.getDefaultInstance()) {
            getParametersBuilder().mergeFrom(value);
          } else {
            parameters_ = value;
          }
        } else {
          parametersBuilder_.mergeFrom(value);
        }
        if (parameters_ != null) {
          bitField0_ |= 0x00000001;
          onChanged();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearParameters() {
        bitField0_ = (bitField0_ & ~0x00000001);
        parameters_ = null;
        if (parametersBuilder_ != null) {
          parametersBuilder_.dispose();
          parametersBuilder_ = null;
        }
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.protobuf.Struct.Builder getParametersBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return internalGetParametersFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.protobuf.StructOrBuilder getParametersOrBuilder() {
        if (parametersBuilder_ != null) {
          return parametersBuilder_.getMessageOrBuilder();
        } else {
          return parameters_ == null
              ? com.google.protobuf.Struct.getDefaultInstance()
              : parameters_;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. A parameters object to be included in each inference request.
       * The parameters object is combined with the data field of the Pub/Sub
       * message to form the inference request.
       * </pre>
       *
       * <code>.google.protobuf.Struct parameters = 1 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilder<
              com.google.protobuf.Struct,
              com.google.protobuf.Struct.Builder,
              com.google.protobuf.StructOrBuilder>
          internalGetParametersFieldBuilder() {
        if (parametersBuilder_ == null) {
          parametersBuilder_ =
              new com.google.protobuf.SingleFieldBuilder<
                  com.google.protobuf.Struct,
                  com.google.protobuf.Struct.Builder,
                  com.google.protobuf.StructOrBuilder>(
                  getParameters(), getParentForChildren(), isClean());
          parameters_ = null;
        }
        return parametersBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:google.pubsub.v1.AIInference.UnstructuredInference)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.AIInference.UnstructuredInference)
    private static final com.google.pubsub.v1.AIInference.UnstructuredInference DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.AIInference.UnstructuredInference();
    }

    public static com.google.pubsub.v1.AIInference.UnstructuredInference getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<UnstructuredInference> PARSER =
        new com.google.protobuf.AbstractParser<UnstructuredInference>() {
          @java.lang.Override
          public UnstructuredInference 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<UnstructuredInference> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<UnstructuredInference> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.pubsub.v1.AIInference.UnstructuredInference getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int inferenceModeCase_ = 0;

  @SuppressWarnings("serial")
  private java.lang.Object inferenceMode_;

  public enum InferenceModeCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    UNSTRUCTURED_INFERENCE(2),
    INFERENCEMODE_NOT_SET(0);
    private final int value;

    private InferenceModeCase(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 InferenceModeCase valueOf(int value) {
      return forNumber(value);
    }

    public static InferenceModeCase forNumber(int value) {
      switch (value) {
        case 2:
          return UNSTRUCTURED_INFERENCE;
        case 0:
          return INFERENCEMODE_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public InferenceModeCase getInferenceModeCase() {
    return InferenceModeCase.forNumber(inferenceModeCase_);
  }

  public static final int ENDPOINT_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object endpoint_ = "";

  /**
   *
   *
   * <pre>
   * Required. An endpoint to a Vertex AI model of the form
   * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
   * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
   * Vertex AI API requests will be sent to this endpoint.
   * </pre>
   *
   * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The endpoint.
   */
  @java.lang.Override
  public java.lang.String getEndpoint() {
    java.lang.Object ref = endpoint_;
    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();
      endpoint_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Required. An endpoint to a Vertex AI model of the form
   * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
   * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
   * Vertex AI API requests will be sent to this endpoint.
   * </pre>
   *
   * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for endpoint.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getEndpointBytes() {
    java.lang.Object ref = endpoint_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      endpoint_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int UNSTRUCTURED_INFERENCE_FIELD_NUMBER = 2;

  /**
   *
   *
   * <pre>
   * Optional. Requests and responses can be any arbitrary JSON object.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the unstructuredInference field is set.
   */
  @java.lang.Override
  public boolean hasUnstructuredInference() {
    return inferenceModeCase_ == 2;
  }

  /**
   *
   *
   * <pre>
   * Optional. Requests and responses can be any arbitrary JSON object.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The unstructuredInference.
   */
  @java.lang.Override
  public com.google.pubsub.v1.AIInference.UnstructuredInference getUnstructuredInference() {
    if (inferenceModeCase_ == 2) {
      return (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_;
    }
    return com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
  }

  /**
   *
   *
   * <pre>
   * Optional. Requests and responses can be any arbitrary JSON object.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.pubsub.v1.AIInference.UnstructuredInferenceOrBuilder
      getUnstructuredInferenceOrBuilder() {
    if (inferenceModeCase_ == 2) {
      return (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_;
    }
    return com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
  }

  public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object serviceAccountEmail_ = "";

  /**
   *
   *
   * <pre>
   * Optional. The service account to use to make prediction requests against
   * endpoints. The resource creator or updater that specifies this field must
   * have `iam.serviceAccounts.actAs` permission on the service account. If not
   * specified, the Pub/Sub [service
   * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
   * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
   * </pre>
   *
   * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The serviceAccountEmail.
   */
  @java.lang.Override
  public java.lang.String getServiceAccountEmail() {
    java.lang.Object ref = serviceAccountEmail_;
    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();
      serviceAccountEmail_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Optional. The service account to use to make prediction requests against
   * endpoints. The resource creator or updater that specifies this field must
   * have `iam.serviceAccounts.actAs` permission on the service account. If not
   * specified, the Pub/Sub [service
   * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
   * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
   * </pre>
   *
   * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for serviceAccountEmail.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
    java.lang.Object ref = serviceAccountEmail_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      serviceAccountEmail_ = 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(endpoint_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 1, endpoint_);
    }
    if (inferenceModeCase_ == 2) {
      output.writeMessage(
          2, (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountEmail_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 3, serviceAccountEmail_);
    }
    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(endpoint_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, endpoint_);
    }
    if (inferenceModeCase_ == 2) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              2, (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_);
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(serviceAccountEmail_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, serviceAccountEmail_);
    }
    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.pubsub.v1.AIInference)) {
      return super.equals(obj);
    }
    com.google.pubsub.v1.AIInference other = (com.google.pubsub.v1.AIInference) obj;

    if (!getEndpoint().equals(other.getEndpoint())) return false;
    if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false;
    if (!getInferenceModeCase().equals(other.getInferenceModeCase())) return false;
    switch (inferenceModeCase_) {
      case 2:
        if (!getUnstructuredInference().equals(other.getUnstructuredInference())) 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) + ENDPOINT_FIELD_NUMBER;
    hash = (53 * hash) + getEndpoint().hashCode();
    hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER;
    hash = (53 * hash) + getServiceAccountEmail().hashCode();
    switch (inferenceModeCase_) {
      case 2:
        hash = (37 * hash) + UNSTRUCTURED_INFERENCE_FIELD_NUMBER;
        hash = (53 * hash) + getUnstructuredInference().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.pubsub.v1.AIInference parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.pubsub.v1.AIInference parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.pubsub.v1.AIInference parseFrom(com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.pubsub.v1.AIInference 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.pubsub.v1.AIInference parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.pubsub.v1.AIInference parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.pubsub.v1.AIInference parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
  }

  public static com.google.pubsub.v1.AIInference 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.pubsub.v1.AIInference parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.pubsub.v1.AIInference 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.pubsub.v1.AIInference parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input);
  }

  public static com.google.pubsub.v1.AIInference 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.pubsub.v1.AIInference 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;
  }

  /**
   *
   *
   * <pre>
   * Configuration for making inference requests against Vertex AI models.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.AIInference}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.pubsub.v1.AIInference)
      com.google.pubsub.v1.AIInferenceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_AIInference_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_AIInference_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.AIInference.class,
              com.google.pubsub.v1.AIInference.Builder.class);
    }

    // Construct using com.google.pubsub.v1.AIInference.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      endpoint_ = "";
      if (unstructuredInferenceBuilder_ != null) {
        unstructuredInferenceBuilder_.clear();
      }
      serviceAccountEmail_ = "";
      inferenceModeCase_ = 0;
      inferenceMode_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_AIInference_descriptor;
    }

    @java.lang.Override
    public com.google.pubsub.v1.AIInference getDefaultInstanceForType() {
      return com.google.pubsub.v1.AIInference.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.pubsub.v1.AIInference build() {
      com.google.pubsub.v1.AIInference result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.pubsub.v1.AIInference buildPartial() {
      com.google.pubsub.v1.AIInference result = new com.google.pubsub.v1.AIInference(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      buildPartialOneofs(result);
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.pubsub.v1.AIInference result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.endpoint_ = endpoint_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.serviceAccountEmail_ = serviceAccountEmail_;
      }
    }

    private void buildPartialOneofs(com.google.pubsub.v1.AIInference result) {
      result.inferenceModeCase_ = inferenceModeCase_;
      result.inferenceMode_ = this.inferenceMode_;
      if (inferenceModeCase_ == 2 && unstructuredInferenceBuilder_ != null) {
        result.inferenceMode_ = unstructuredInferenceBuilder_.build();
      }
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.pubsub.v1.AIInference) {
        return mergeFrom((com.google.pubsub.v1.AIInference) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.pubsub.v1.AIInference other) {
      if (other == com.google.pubsub.v1.AIInference.getDefaultInstance()) return this;
      if (!other.getEndpoint().isEmpty()) {
        endpoint_ = other.endpoint_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getServiceAccountEmail().isEmpty()) {
        serviceAccountEmail_ = other.serviceAccountEmail_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      switch (other.getInferenceModeCase()) {
        case UNSTRUCTURED_INFERENCE:
          {
            mergeUnstructuredInference(other.getUnstructuredInference());
            break;
          }
        case INFERENCEMODE_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:
              {
                endpoint_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(
                    internalGetUnstructuredInferenceFieldBuilder().getBuilder(), extensionRegistry);
                inferenceModeCase_ = 2;
                break;
              } // case 18
            case 26:
              {
                serviceAccountEmail_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            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 inferenceModeCase_ = 0;
    private java.lang.Object inferenceMode_;

    public InferenceModeCase getInferenceModeCase() {
      return InferenceModeCase.forNumber(inferenceModeCase_);
    }

    public Builder clearInferenceMode() {
      inferenceModeCase_ = 0;
      inferenceMode_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object endpoint_ = "";

    /**
     *
     *
     * <pre>
     * Required. An endpoint to a Vertex AI model of the form
     * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
     * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
     * Vertex AI API requests will be sent to this endpoint.
     * </pre>
     *
     * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The endpoint.
     */
    public java.lang.String getEndpoint() {
      java.lang.Object ref = endpoint_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        endpoint_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. An endpoint to a Vertex AI model of the form
     * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
     * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
     * Vertex AI API requests will be sent to this endpoint.
     * </pre>
     *
     * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for endpoint.
     */
    public com.google.protobuf.ByteString getEndpointBytes() {
      java.lang.Object ref = endpoint_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        endpoint_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. An endpoint to a Vertex AI model of the form
     * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
     * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
     * Vertex AI API requests will be sent to this endpoint.
     * </pre>
     *
     * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The endpoint to set.
     * @return This builder for chaining.
     */
    public Builder setEndpoint(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      endpoint_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. An endpoint to a Vertex AI model of the form
     * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
     * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
     * Vertex AI API requests will be sent to this endpoint.
     * </pre>
     *
     * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEndpoint() {
      endpoint_ = getDefaultInstance().getEndpoint();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. An endpoint to a Vertex AI model of the form
     * `projects/{project}/locations/{location}/endpoints/{endpoint}` or
     * `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}`.
     * Vertex AI API requests will be sent to this endpoint.
     * </pre>
     *
     * <code>string endpoint = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for endpoint to set.
     * @return This builder for chaining.
     */
    public Builder setEndpointBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      endpoint_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilder<
            com.google.pubsub.v1.AIInference.UnstructuredInference,
            com.google.pubsub.v1.AIInference.UnstructuredInference.Builder,
            com.google.pubsub.v1.AIInference.UnstructuredInferenceOrBuilder>
        unstructuredInferenceBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the unstructuredInference field is set.
     */
    @java.lang.Override
    public boolean hasUnstructuredInference() {
      return inferenceModeCase_ == 2;
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The unstructuredInference.
     */
    @java.lang.Override
    public com.google.pubsub.v1.AIInference.UnstructuredInference getUnstructuredInference() {
      if (unstructuredInferenceBuilder_ == null) {
        if (inferenceModeCase_ == 2) {
          return (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_;
        }
        return com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
      } else {
        if (inferenceModeCase_ == 2) {
          return unstructuredInferenceBuilder_.getMessage();
        }
        return com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setUnstructuredInference(
        com.google.pubsub.v1.AIInference.UnstructuredInference value) {
      if (unstructuredInferenceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        inferenceMode_ = value;
        onChanged();
      } else {
        unstructuredInferenceBuilder_.setMessage(value);
      }
      inferenceModeCase_ = 2;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setUnstructuredInference(
        com.google.pubsub.v1.AIInference.UnstructuredInference.Builder builderForValue) {
      if (unstructuredInferenceBuilder_ == null) {
        inferenceMode_ = builderForValue.build();
        onChanged();
      } else {
        unstructuredInferenceBuilder_.setMessage(builderForValue.build());
      }
      inferenceModeCase_ = 2;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeUnstructuredInference(
        com.google.pubsub.v1.AIInference.UnstructuredInference value) {
      if (unstructuredInferenceBuilder_ == null) {
        if (inferenceModeCase_ == 2
            && inferenceMode_
                != com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance()) {
          inferenceMode_ =
              com.google.pubsub.v1.AIInference.UnstructuredInference.newBuilder(
                      (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          inferenceMode_ = value;
        }
        onChanged();
      } else {
        if (inferenceModeCase_ == 2) {
          unstructuredInferenceBuilder_.mergeFrom(value);
        } else {
          unstructuredInferenceBuilder_.setMessage(value);
        }
      }
      inferenceModeCase_ = 2;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearUnstructuredInference() {
      if (unstructuredInferenceBuilder_ == null) {
        if (inferenceModeCase_ == 2) {
          inferenceModeCase_ = 0;
          inferenceMode_ = null;
          onChanged();
        }
      } else {
        if (inferenceModeCase_ == 2) {
          inferenceModeCase_ = 0;
          inferenceMode_ = null;
        }
        unstructuredInferenceBuilder_.clear();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.pubsub.v1.AIInference.UnstructuredInference.Builder
        getUnstructuredInferenceBuilder() {
      return internalGetUnstructuredInferenceFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.AIInference.UnstructuredInferenceOrBuilder
        getUnstructuredInferenceOrBuilder() {
      if ((inferenceModeCase_ == 2) && (unstructuredInferenceBuilder_ != null)) {
        return unstructuredInferenceBuilder_.getMessageOrBuilder();
      } else {
        if (inferenceModeCase_ == 2) {
          return (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_;
        }
        return com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Requests and responses can be any arbitrary JSON object.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.AIInference.UnstructuredInference unstructured_inference = 2 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.google.pubsub.v1.AIInference.UnstructuredInference,
            com.google.pubsub.v1.AIInference.UnstructuredInference.Builder,
            com.google.pubsub.v1.AIInference.UnstructuredInferenceOrBuilder>
        internalGetUnstructuredInferenceFieldBuilder() {
      if (unstructuredInferenceBuilder_ == null) {
        if (!(inferenceModeCase_ == 2)) {
          inferenceMode_ =
              com.google.pubsub.v1.AIInference.UnstructuredInference.getDefaultInstance();
        }
        unstructuredInferenceBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.google.pubsub.v1.AIInference.UnstructuredInference,
                com.google.pubsub.v1.AIInference.UnstructuredInference.Builder,
                com.google.pubsub.v1.AIInference.UnstructuredInferenceOrBuilder>(
                (com.google.pubsub.v1.AIInference.UnstructuredInference) inferenceMode_,
                getParentForChildren(),
                isClean());
        inferenceMode_ = null;
      }
      inferenceModeCase_ = 2;
      onChanged();
      return unstructuredInferenceBuilder_;
    }

    private java.lang.Object serviceAccountEmail_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The service account to use to make prediction requests against
     * endpoints. The resource creator or updater that specifies this field must
     * have `iam.serviceAccounts.actAs` permission on the service account. If not
     * specified, the Pub/Sub [service
     * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
     * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
     * </pre>
     *
     * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The serviceAccountEmail.
     */
    public java.lang.String getServiceAccountEmail() {
      java.lang.Object ref = serviceAccountEmail_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        serviceAccountEmail_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The service account to use to make prediction requests against
     * endpoints. The resource creator or updater that specifies this field must
     * have `iam.serviceAccounts.actAs` permission on the service account. If not
     * specified, the Pub/Sub [service
     * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
     * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
     * </pre>
     *
     * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for serviceAccountEmail.
     */
    public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
      java.lang.Object ref = serviceAccountEmail_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        serviceAccountEmail_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The service account to use to make prediction requests against
     * endpoints. The resource creator or updater that specifies this field must
     * have `iam.serviceAccounts.actAs` permission on the service account. If not
     * specified, the Pub/Sub [service
     * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
     * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
     * </pre>
     *
     * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The serviceAccountEmail to set.
     * @return This builder for chaining.
     */
    public Builder setServiceAccountEmail(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      serviceAccountEmail_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. The service account to use to make prediction requests against
     * endpoints. The resource creator or updater that specifies this field must
     * have `iam.serviceAccounts.actAs` permission on the service account. If not
     * specified, the Pub/Sub [service
     * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
     * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
     * </pre>
     *
     * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearServiceAccountEmail() {
      serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. The service account to use to make prediction requests against
     * endpoints. The resource creator or updater that specifies this field must
     * have `iam.serviceAccounts.actAs` permission on the service account. If not
     * specified, the Pub/Sub [service
     * agent]({$universe.dns_names.final_documentation_domain}/iam/docs/service-agents),
     * service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
     * </pre>
     *
     * <code>string service_account_email = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for serviceAccountEmail to set.
     * @return This builder for chaining.
     */
    public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      serviceAccountEmail_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.pubsub.v1.AIInference)
  }

  // @@protoc_insertion_point(class_scope:google.pubsub.v1.AIInference)
  private static final com.google.pubsub.v1.AIInference DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.pubsub.v1.AIInference();
  }

  public static com.google.pubsub.v1.AIInference getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<AIInference> PARSER =
      new com.google.protobuf.AbstractParser<AIInference>() {
        @java.lang.Override
        public AIInference 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<AIInference> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<AIInference> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.pubsub.v1.AIInference getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
