All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.vertexai.api.DeployModelRequest Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
/*
 * Copyright 2024 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!
// source: google/cloud/vertexai/v1/endpoint_service.proto

// Protobuf Java Version: 3.25.3
package com.google.cloud.vertexai.api;

/**
 *
 *
 * 
 * Request message for
 * [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel].
 * 
* * Protobuf type {@code google.cloud.vertexai.v1.DeployModelRequest} */ public final class DeployModelRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.vertexai.v1.DeployModelRequest) DeployModelRequestOrBuilder { private static final long serialVersionUID = 0L; // Use DeployModelRequest.newBuilder() to construct. private DeployModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private DeployModelRequest() { endpoint_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new DeployModelRequest(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vertexai.api.EndpointServiceProto .internal_static_google_cloud_vertexai_v1_DeployModelRequest_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 3: return internalGetTrafficSplit(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.vertexai.api.EndpointServiceProto .internal_static_google_cloud_vertexai_v1_DeployModelRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.vertexai.api.DeployModelRequest.class, com.google.cloud.vertexai.api.DeployModelRequest.Builder.class); } private int bitField0_; public static final int ENDPOINT_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object endpoint_ = ""; /** * * *
   * Required. The name of the Endpoint resource into which to deploy a Model.
   * Format:
   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
   * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @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; } } /** * * *
   * Required. The name of the Endpoint resource into which to deploy a Model.
   * Format:
   * `projects/{project}/locations/{location}/endpoints/{endpoint}`
   * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @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 DEPLOYED_MODEL_FIELD_NUMBER = 2; private com.google.cloud.vertexai.api.DeployedModel deployedModel_; /** * * *
   * Required. The DeployedModel to be created within the Endpoint. Note that
   * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
   * must be updated for the DeployedModel to start receiving traffic, either as
   * part of this call, or via
   * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
   * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * * * @return Whether the deployedModel field is set. */ @java.lang.Override public boolean hasDeployedModel() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * Required. The DeployedModel to be created within the Endpoint. Note that
   * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
   * must be updated for the DeployedModel to start receiving traffic, either as
   * part of this call, or via
   * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
   * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * * * @return The deployedModel. */ @java.lang.Override public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { return deployedModel_ == null ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() : deployedModel_; } /** * * *
   * Required. The DeployedModel to be created within the Endpoint. Note that
   * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
   * must be updated for the DeployedModel to start receiving traffic, either as
   * part of this call, or via
   * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
   * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ @java.lang.Override public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { return deployedModel_ == null ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() : deployedModel_; } public static final int TRAFFIC_SPLIT_FIELD_NUMBER = 3; private static final class TrafficSplitDefaultEntryHolder { static final com.google.protobuf.MapEntry defaultEntry = com.google.protobuf.MapEntry.newDefaultInstance( com.google.cloud.vertexai.api.EndpointServiceProto .internal_static_google_cloud_vertexai_v1_DeployModelRequest_TrafficSplitEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.INT32, 0); } @SuppressWarnings("serial") private com.google.protobuf.MapField trafficSplit_; private com.google.protobuf.MapField internalGetTrafficSplit() { if (trafficSplit_ == null) { return com.google.protobuf.MapField.emptyMapField( TrafficSplitDefaultEntryHolder.defaultEntry); } return trafficSplit_; } public int getTrafficSplitCount() { return internalGetTrafficSplit().getMap().size(); } /** * * *
   * A map from a DeployedModel's ID to the percentage of this Endpoint's
   * traffic that should be forwarded to that DeployedModel.
   *
   * If this field is non-empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
   * overwritten with it. To refer to the ID of the just being deployed Model, a
   * "0" should be used, and the actual ID of the new DeployedModel will be
   * filled in its place by this method. The traffic percentage values must add
   * up to 100.
   *
   * If this field is empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
   * updated.
   * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public boolean containsTrafficSplit(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetTrafficSplit().getMap().containsKey(key); } /** Use {@link #getTrafficSplitMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getTrafficSplit() { return getTrafficSplitMap(); } /** * * *
   * A map from a DeployedModel's ID to the percentage of this Endpoint's
   * traffic that should be forwarded to that DeployedModel.
   *
   * If this field is non-empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
   * overwritten with it. To refer to the ID of the just being deployed Model, a
   * "0" should be used, and the actual ID of the new DeployedModel will be
   * filled in its place by this method. The traffic percentage values must add
   * up to 100.
   *
   * If this field is empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
   * updated.
   * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public java.util.Map getTrafficSplitMap() { return internalGetTrafficSplit().getMap(); } /** * * *
   * A map from a DeployedModel's ID to the percentage of this Endpoint's
   * traffic that should be forwarded to that DeployedModel.
   *
   * If this field is non-empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
   * overwritten with it. To refer to the ID of the just being deployed Model, a
   * "0" should be used, and the actual ID of the new DeployedModel will be
   * filled in its place by this method. The traffic percentage values must add
   * up to 100.
   *
   * If this field is empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
   * updated.
   * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetTrafficSplit().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
   * A map from a DeployedModel's ID to the percentage of this Endpoint's
   * traffic that should be forwarded to that DeployedModel.
   *
   * If this field is non-empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
   * overwritten with it. To refer to the ID of the just being deployed Model, a
   * "0" should be used, and the actual ID of the new DeployedModel will be
   * filled in its place by this method. The traffic percentage values must add
   * up to 100.
   *
   * If this field is empty, then the Endpoint's
   * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
   * updated.
   * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public int getTrafficSplitOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetTrafficSplit().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 { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, endpoint_); } if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getDeployedModel()); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetTrafficSplit(), TrafficSplitDefaultEntryHolder.defaultEntry, 3); getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endpoint_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, endpoint_); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDeployedModel()); } for (java.util.Map.Entry entry : internalGetTrafficSplit().getMap().entrySet()) { com.google.protobuf.MapEntry trafficSplit__ = TrafficSplitDefaultEntryHolder.defaultEntry .newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, trafficSplit__); } 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.vertexai.api.DeployModelRequest)) { return super.equals(obj); } com.google.cloud.vertexai.api.DeployModelRequest other = (com.google.cloud.vertexai.api.DeployModelRequest) obj; if (!getEndpoint().equals(other.getEndpoint())) return false; if (hasDeployedModel() != other.hasDeployedModel()) return false; if (hasDeployedModel()) { if (!getDeployedModel().equals(other.getDeployedModel())) return false; } if (!internalGetTrafficSplit().equals(other.internalGetTrafficSplit())) 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) + ENDPOINT_FIELD_NUMBER; hash = (53 * hash) + getEndpoint().hashCode(); if (hasDeployedModel()) { hash = (37 * hash) + DEPLOYED_MODEL_FIELD_NUMBER; hash = (53 * hash) + getDeployedModel().hashCode(); } if (!internalGetTrafficSplit().getMap().isEmpty()) { hash = (37 * hash) + TRAFFIC_SPLIT_FIELD_NUMBER; hash = (53 * hash) + internalGetTrafficSplit().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vertexai.api.DeployModelRequest 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.vertexai.api.DeployModelRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vertexai.api.DeployModelRequest 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.vertexai.api.DeployModelRequest parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.vertexai.api.DeployModelRequest parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.vertexai.api.DeployModelRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.vertexai.api.DeployModelRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.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.vertexai.api.DeployModelRequest 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.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * *
   * Request message for
   * [EndpointService.DeployModel][google.cloud.aiplatform.v1.EndpointService.DeployModel].
   * 
* * Protobuf type {@code google.cloud.vertexai.v1.DeployModelRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.vertexai.v1.DeployModelRequest) com.google.cloud.vertexai.api.DeployModelRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vertexai.api.EndpointServiceProto .internal_static_google_cloud_vertexai_v1_DeployModelRequest_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 3: return internalGetTrafficSplit(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( int number) { switch (number) { case 3: return internalGetMutableTrafficSplit(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.vertexai.api.EndpointServiceProto .internal_static_google_cloud_vertexai_v1_DeployModelRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.vertexai.api.DeployModelRequest.class, com.google.cloud.vertexai.api.DeployModelRequest.Builder.class); } // Construct using com.google.cloud.vertexai.api.DeployModelRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getDeployedModelFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; endpoint_ = ""; deployedModel_ = null; if (deployedModelBuilder_ != null) { deployedModelBuilder_.dispose(); deployedModelBuilder_ = null; } internalGetMutableTrafficSplit().clear(); return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.vertexai.api.EndpointServiceProto .internal_static_google_cloud_vertexai_v1_DeployModelRequest_descriptor; } @java.lang.Override public com.google.cloud.vertexai.api.DeployModelRequest getDefaultInstanceForType() { return com.google.cloud.vertexai.api.DeployModelRequest.getDefaultInstance(); } @java.lang.Override public com.google.cloud.vertexai.api.DeployModelRequest build() { com.google.cloud.vertexai.api.DeployModelRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.vertexai.api.DeployModelRequest buildPartial() { com.google.cloud.vertexai.api.DeployModelRequest result = new com.google.cloud.vertexai.api.DeployModelRequest(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(com.google.cloud.vertexai.api.DeployModelRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.endpoint_ = endpoint_; } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000002) != 0)) { result.deployedModel_ = deployedModelBuilder_ == null ? deployedModel_ : deployedModelBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000004) != 0)) { result.trafficSplit_ = internalGetTrafficSplit(); result.trafficSplit_.makeImmutable(); } result.bitField0_ |= to_bitField0_; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.vertexai.api.DeployModelRequest) { return mergeFrom((com.google.cloud.vertexai.api.DeployModelRequest) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.vertexai.api.DeployModelRequest other) { if (other == com.google.cloud.vertexai.api.DeployModelRequest.getDefaultInstance()) return this; if (!other.getEndpoint().isEmpty()) { endpoint_ = other.endpoint_; bitField0_ |= 0x00000001; onChanged(); } if (other.hasDeployedModel()) { mergeDeployedModel(other.getDeployedModel()); } internalGetMutableTrafficSplit().mergeFrom(other.internalGetTrafficSplit()); bitField0_ |= 0x00000004; 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(getDeployedModelFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000002; break; } // case 18 case 26: { com.google.protobuf.MapEntry trafficSplit__ = input.readMessage( TrafficSplitDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableTrafficSplit() .getMutableMap() .put(trafficSplit__.getKey(), trafficSplit__.getValue()); 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 bitField0_; private java.lang.Object endpoint_ = ""; /** * * *
     * Required. The name of the Endpoint resource into which to deploy a Model.
     * Format:
     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
     * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @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; } } /** * * *
     * Required. The name of the Endpoint resource into which to deploy a Model.
     * Format:
     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
     * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @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; } } /** * * *
     * Required. The name of the Endpoint resource into which to deploy a Model.
     * Format:
     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
     * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @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; } /** * * *
     * Required. The name of the Endpoint resource into which to deploy a Model.
     * Format:
     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
     * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @return This builder for chaining. */ public Builder clearEndpoint() { endpoint_ = getDefaultInstance().getEndpoint(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * Required. The name of the Endpoint resource into which to deploy a Model.
     * Format:
     * `projects/{project}/locations/{location}/endpoints/{endpoint}`
     * 
* * * string endpoint = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @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.cloud.vertexai.api.DeployedModel deployedModel_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vertexai.api.DeployedModel, com.google.cloud.vertexai.api.DeployedModel.Builder, com.google.cloud.vertexai.api.DeployedModelOrBuilder> deployedModelBuilder_; /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * * * @return Whether the deployedModel field is set. */ public boolean hasDeployedModel() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * * * @return The deployedModel. */ public com.google.cloud.vertexai.api.DeployedModel getDeployedModel() { if (deployedModelBuilder_ == null) { return deployedModel_ == null ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() : deployedModel_; } else { return deployedModelBuilder_.getMessage(); } } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder setDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { if (deployedModelBuilder_ == null) { if (value == null) { throw new NullPointerException(); } deployedModel_ = value; } else { deployedModelBuilder_.setMessage(value); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder setDeployedModel( com.google.cloud.vertexai.api.DeployedModel.Builder builderForValue) { if (deployedModelBuilder_ == null) { deployedModel_ = builderForValue.build(); } else { deployedModelBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder mergeDeployedModel(com.google.cloud.vertexai.api.DeployedModel value) { if (deployedModelBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && deployedModel_ != null && deployedModel_ != com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance()) { getDeployedModelBuilder().mergeFrom(value); } else { deployedModel_ = value; } } else { deployedModelBuilder_.mergeFrom(value); } if (deployedModel_ != null) { bitField0_ |= 0x00000002; onChanged(); } return this; } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder clearDeployedModel() { bitField0_ = (bitField0_ & ~0x00000002); deployedModel_ = null; if (deployedModelBuilder_ != null) { deployedModelBuilder_.dispose(); deployedModelBuilder_ = null; } onChanged(); return this; } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ public com.google.cloud.vertexai.api.DeployedModel.Builder getDeployedModelBuilder() { bitField0_ |= 0x00000002; onChanged(); return getDeployedModelFieldBuilder().getBuilder(); } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ public com.google.cloud.vertexai.api.DeployedModelOrBuilder getDeployedModelOrBuilder() { if (deployedModelBuilder_ != null) { return deployedModelBuilder_.getMessageOrBuilder(); } else { return deployedModel_ == null ? com.google.cloud.vertexai.api.DeployedModel.getDefaultInstance() : deployedModel_; } } /** * * *
     * Required. The DeployedModel to be created within the Endpoint. Note that
     * [Endpoint.traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
     * must be updated for the DeployedModel to start receiving traffic, either as
     * part of this call, or via
     * [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1.EndpointService.UpdateEndpoint].
     * 
* * * .google.cloud.vertexai.v1.DeployedModel deployed_model = 2 [(.google.api.field_behavior) = REQUIRED]; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vertexai.api.DeployedModel, com.google.cloud.vertexai.api.DeployedModel.Builder, com.google.cloud.vertexai.api.DeployedModelOrBuilder> getDeployedModelFieldBuilder() { if (deployedModelBuilder_ == null) { deployedModelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vertexai.api.DeployedModel, com.google.cloud.vertexai.api.DeployedModel.Builder, com.google.cloud.vertexai.api.DeployedModelOrBuilder>( getDeployedModel(), getParentForChildren(), isClean()); deployedModel_ = null; } return deployedModelBuilder_; } private com.google.protobuf.MapField trafficSplit_; private com.google.protobuf.MapField internalGetTrafficSplit() { if (trafficSplit_ == null) { return com.google.protobuf.MapField.emptyMapField( TrafficSplitDefaultEntryHolder.defaultEntry); } return trafficSplit_; } private com.google.protobuf.MapField internalGetMutableTrafficSplit() { if (trafficSplit_ == null) { trafficSplit_ = com.google.protobuf.MapField.newMapField(TrafficSplitDefaultEntryHolder.defaultEntry); } if (!trafficSplit_.isMutable()) { trafficSplit_ = trafficSplit_.copy(); } bitField0_ |= 0x00000004; onChanged(); return trafficSplit_; } public int getTrafficSplitCount() { return internalGetTrafficSplit().getMap().size(); } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public boolean containsTrafficSplit(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } return internalGetTrafficSplit().getMap().containsKey(key); } /** Use {@link #getTrafficSplitMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getTrafficSplit() { return getTrafficSplitMap(); } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public java.util.Map getTrafficSplitMap() { return internalGetTrafficSplit().getMap(); } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public int getTrafficSplitOrDefault(java.lang.String key, int defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetTrafficSplit().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ @java.lang.Override public int getTrafficSplitOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetTrafficSplit().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearTrafficSplit() { bitField0_ = (bitField0_ & ~0x00000004); internalGetMutableTrafficSplit().getMutableMap().clear(); return this; } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ public Builder removeTrafficSplit(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableTrafficSplit().getMutableMap().remove(key); return this; } /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableTrafficSplit() { bitField0_ |= 0x00000004; return internalGetMutableTrafficSplit().getMutableMap(); } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ public Builder putTrafficSplit(java.lang.String key, int value) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableTrafficSplit().getMutableMap().put(key, value); bitField0_ |= 0x00000004; return this; } /** * * *
     * A map from a DeployedModel's ID to the percentage of this Endpoint's
     * traffic that should be forwarded to that DeployedModel.
     *
     * If this field is non-empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] will be
     * overwritten with it. To refer to the ID of the just being deployed Model, a
     * "0" should be used, and the actual ID of the new DeployedModel will be
     * filled in its place by this method. The traffic percentage values must add
     * up to 100.
     *
     * If this field is empty, then the Endpoint's
     * [traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split] is not
     * updated.
     * 
* * map<string, int32> traffic_split = 3; */ public Builder putAllTrafficSplit(java.util.Map values) { internalGetMutableTrafficSplit().getMutableMap().putAll(values); bitField0_ |= 0x00000004; return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.vertexai.v1.DeployModelRequest) } // @@protoc_insertion_point(class_scope:google.cloud.vertexai.v1.DeployModelRequest) private static final com.google.cloud.vertexai.api.DeployModelRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.vertexai.api.DeployModelRequest(); } public static com.google.cloud.vertexai.api.DeployModelRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public DeployModelRequest 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.vertexai.api.DeployModelRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy