Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

feat: add a DeploymentResourcePool API resource_definition #997

Merged
merged 4 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,13 @@ private DeployedModel(
privateEndpoints_ = subBuilder.buildPartial();
}

break;
}
case 138:
{
java.lang.String s = input.readStringRequireUtf8();
predictionResourcesCase_ = 17;
predictionResources_ = s;
break;
}
case 146:
Expand Down Expand Up @@ -253,6 +260,7 @@ public enum PredictionResourcesCase
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
DEDICATED_RESOURCES(7),
AUTOMATIC_RESOURCES(8),
SHARED_RESOURCES(17),
PREDICTIONRESOURCES_NOT_SET(0);
private final int value;

Expand All @@ -275,6 +283,8 @@ public static PredictionResourcesCase forNumber(int value) {
return DEDICATED_RESOURCES;
case 8:
return AUTOMATIC_RESOURCES;
case 17:
return SHARED_RESOURCES;
case 0:
return PREDICTIONRESOURCES_NOT_SET;
default:
Expand Down Expand Up @@ -401,6 +411,82 @@ public com.google.cloud.aiplatform.v1beta1.AutomaticResources getAutomaticResour
return com.google.cloud.aiplatform.v1beta1.AutomaticResources.getDefaultInstance();
}

public static final int SHARED_RESOURCES_FIELD_NUMBER = 17;
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return Whether the sharedResources field is set.
*/
public boolean hasSharedResources() {
return predictionResourcesCase_ == 17;
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return The sharedResources.
*/
public java.lang.String getSharedResources() {
java.lang.Object ref = "";
if (predictionResourcesCase_ == 17) {
ref = predictionResources_;
}
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();
if (predictionResourcesCase_ == 17) {
predictionResources_ = s;
}
return s;
}
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return The bytes for sharedResources.
*/
public com.google.protobuf.ByteString getSharedResourcesBytes() {
java.lang.Object ref = "";
if (predictionResourcesCase_ == 17) {
ref = predictionResources_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (predictionResourcesCase_ == 17) {
predictionResources_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

public static final int ID_FIELD_NUMBER = 1;
private volatile java.lang.Object id_;
/**
Expand Down Expand Up @@ -943,6 +1029,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (privateEndpoints_ != null) {
output.writeMessage(14, getPrivateEndpoints());
}
if (predictionResourcesCase_ == 17) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 17, predictionResources_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 18, modelVersionId_);
}
Expand Down Expand Up @@ -992,6 +1081,9 @@ public int getSerializedSize() {
if (privateEndpoints_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPrivateEndpoints());
}
if (predictionResourcesCase_ == 17) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, predictionResources_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, modelVersionId_);
}
Expand Down Expand Up @@ -1038,6 +1130,9 @@ public boolean equals(final java.lang.Object obj) {
case 8:
if (!getAutomaticResources().equals(other.getAutomaticResources())) return false;
break;
case 17:
if (!getSharedResources().equals(other.getSharedResources())) return false;
break;
case 0:
default:
}
Expand Down Expand Up @@ -1087,6 +1182,10 @@ public int hashCode() {
hash = (37 * hash) + AUTOMATIC_RESOURCES_FIELD_NUMBER;
hash = (53 * hash) + getAutomaticResources().hashCode();
break;
case 17:
hash = (37 * hash) + SHARED_RESOURCES_FIELD_NUMBER;
hash = (53 * hash) + getSharedResources().hashCode();
break;
case 0:
default:
}
Expand Down Expand Up @@ -1310,6 +1409,9 @@ public com.google.cloud.aiplatform.v1beta1.DeployedModel buildPartial() {
result.predictionResources_ = automaticResourcesBuilder_.build();
}
}
if (predictionResourcesCase_ == 17) {
result.predictionResources_ = predictionResources_;
}
result.id_ = id_;
result.model_ = model_;
result.modelVersionId_ = modelVersionId_;
Expand Down Expand Up @@ -1429,6 +1531,13 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.DeployedModel other
mergeAutomaticResources(other.getAutomaticResources());
break;
}
case SHARED_RESOURCES:
{
predictionResourcesCase_ = 17;
predictionResources_ = other.predictionResources_;
onChanged();
break;
}
case PREDICTIONRESOURCES_NOT_SET:
{
break;
Expand Down Expand Up @@ -1928,6 +2037,152 @@ public Builder clearAutomaticResources() {
return automaticResourcesBuilder_;
}

/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return Whether the sharedResources field is set.
*/
@java.lang.Override
public boolean hasSharedResources() {
return predictionResourcesCase_ == 17;
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return The sharedResources.
*/
@java.lang.Override
public java.lang.String getSharedResources() {
java.lang.Object ref = "";
if (predictionResourcesCase_ == 17) {
ref = predictionResources_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (predictionResourcesCase_ == 17) {
predictionResources_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return The bytes for sharedResources.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSharedResourcesBytes() {
java.lang.Object ref = "";
if (predictionResourcesCase_ == 17) {
ref = predictionResources_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (predictionResourcesCase_ == 17) {
predictionResources_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @param value The sharedResources to set.
* @return This builder for chaining.
*/
public Builder setSharedResources(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
predictionResourcesCase_ = 17;
predictionResources_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return This builder for chaining.
*/
public Builder clearSharedResources() {
if (predictionResourcesCase_ == 17) {
predictionResourcesCase_ = 0;
predictionResources_ = null;
onChanged();
}
return this;
}
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @param value The bytes for sharedResources to set.
* @return This builder for chaining.
*/
public Builder setSharedResourcesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
predictionResourcesCase_ = 17;
predictionResources_ = value;
onChanged();
return this;
}

private java.lang.Object id_ = "";
/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,49 @@ public interface DeployedModelOrBuilder
*/
com.google.cloud.aiplatform.v1beta1.AutomaticResourcesOrBuilder getAutomaticResourcesOrBuilder();

/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return Whether the sharedResources field is set.
*/
boolean hasSharedResources();
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return The sharedResources.
*/
java.lang.String getSharedResources();
/**
*
*
* <pre>
* The resource name of the shared DeploymentResourcePool to deploy on.
* Format:
* projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}
* </pre>
*
* <code>string shared_resources = 17 [(.google.api.resource_reference) = { ... }</code>
*
* @return The bytes for sharedResources.
*/
com.google.protobuf.ByteString getSharedResourcesBytes();

/**
*
*
Expand Down
Loading