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

feat: add service_account to BatchPredictionJob in aiplatform v1beta1 batch_prediction_job.proto #831

Merged
merged 4 commits into from
Mar 18, 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 @@ -1530,6 +1530,7 @@ public void createBatchPredictionJobTest() throws Exception {
.setModelParameters(Value.newBuilder().build())
.setOutputConfig(BatchPredictionJob.OutputConfig.newBuilder().build())
.setDedicatedResources(BatchDedicatedResources.newBuilder().build())
.setServiceAccount("serviceAccount1079137720")
.setManualBatchTuningParameters(ManualBatchTuningParameters.newBuilder().build())
.setGenerateExplanation(true)
.setExplanationSpec(ExplanationSpec.newBuilder().build())
Expand Down Expand Up @@ -1596,6 +1597,7 @@ public void createBatchPredictionJobTest2() throws Exception {
.setModelParameters(Value.newBuilder().build())
.setOutputConfig(BatchPredictionJob.OutputConfig.newBuilder().build())
.setDedicatedResources(BatchDedicatedResources.newBuilder().build())
.setServiceAccount("serviceAccount1079137720")
.setManualBatchTuningParameters(ManualBatchTuningParameters.newBuilder().build())
.setGenerateExplanation(true)
.setExplanationSpec(ExplanationSpec.newBuilder().build())
Expand Down Expand Up @@ -1662,6 +1664,7 @@ public void getBatchPredictionJobTest() throws Exception {
.setModelParameters(Value.newBuilder().build())
.setOutputConfig(BatchPredictionJob.OutputConfig.newBuilder().build())
.setDedicatedResources(BatchDedicatedResources.newBuilder().build())
.setServiceAccount("serviceAccount1079137720")
.setManualBatchTuningParameters(ManualBatchTuningParameters.newBuilder().build())
.setGenerateExplanation(true)
.setExplanationSpec(ExplanationSpec.newBuilder().build())
Expand Down Expand Up @@ -1727,6 +1730,7 @@ public void getBatchPredictionJobTest2() throws Exception {
.setModelParameters(Value.newBuilder().build())
.setOutputConfig(BatchPredictionJob.OutputConfig.newBuilder().build())
.setDedicatedResources(BatchDedicatedResources.newBuilder().build())
.setServiceAccount("serviceAccount1079137720")
.setManualBatchTuningParameters(ManualBatchTuningParameters.newBuilder().build())
.setGenerateExplanation(true)
.setExplanationSpec(ExplanationSpec.newBuilder().build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private BatchPredictionJob() {
name_ = "";
displayName_ = "";
model_ = "";
serviceAccount_ = "";
state_ = 0;
partialFailures_ = java.util.Collections.emptyList();
}
Expand Down Expand Up @@ -395,6 +396,13 @@ private BatchPredictionJob(
unmanagedContainerModel_ = subBuilder.buildPartial();
}

break;
}
case 234:
{
java.lang.String s = input.readStringRequireUtf8();

serviceAccount_ = s;
break;
}
default:
Expand Down Expand Up @@ -5793,6 +5801,65 @@ public com.google.cloud.aiplatform.v1beta1.BatchDedicatedResources getDedicatedR
return getDedicatedResources();
}

public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 29;
private volatile java.lang.Object serviceAccount_;
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return The serviceAccount.
*/
@java.lang.Override
public java.lang.String getServiceAccount() {
java.lang.Object ref = serviceAccount_;
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();
serviceAccount_ = s;
return s;
}
}
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return The bytes for serviceAccount.
*/
@java.lang.Override
public com.google.protobuf.ByteString getServiceAccountBytes() {
java.lang.Object ref = serviceAccount_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
serviceAccount_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

public static final int MANUAL_BATCH_TUNING_PARAMETERS_FIELD_NUMBER = 8;
private com.google.cloud.aiplatform.v1beta1.ManualBatchTuningParameters
manualBatchTuningParameters_;
Expand Down Expand Up @@ -6761,6 +6828,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (unmanagedContainerModel_ != null) {
output.writeMessage(28, getUnmanagedContainerModel());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 29, serviceAccount_);
}
unknownFields.writeTo(output);
}

Expand Down Expand Up @@ -6850,6 +6920,9 @@ public int getSerializedSize() {
com.google.protobuf.CodedOutputStream.computeMessageSize(
28, getUnmanagedContainerModel());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(29, serviceAccount_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
Expand Down Expand Up @@ -6889,6 +6962,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasDedicatedResources()) {
if (!getDedicatedResources().equals(other.getDedicatedResources())) return false;
}
if (!getServiceAccount().equals(other.getServiceAccount())) return false;
if (hasManualBatchTuningParameters() != other.hasManualBatchTuningParameters()) return false;
if (hasManualBatchTuningParameters()) {
if (!getManualBatchTuningParameters().equals(other.getManualBatchTuningParameters()))
Expand Down Expand Up @@ -6975,6 +7049,8 @@ public int hashCode() {
hash = (37 * hash) + DEDICATED_RESOURCES_FIELD_NUMBER;
hash = (53 * hash) + getDedicatedResources().hashCode();
}
hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER;
hash = (53 * hash) + getServiceAccount().hashCode();
if (hasManualBatchTuningParameters()) {
hash = (37 * hash) + MANUAL_BATCH_TUNING_PARAMETERS_FIELD_NUMBER;
hash = (53 * hash) + getManualBatchTuningParameters().hashCode();
Expand Down Expand Up @@ -7238,6 +7314,8 @@ public Builder clear() {
dedicatedResources_ = null;
dedicatedResourcesBuilder_ = null;
}
serviceAccount_ = "";

if (manualBatchTuningParametersBuilder_ == null) {
manualBatchTuningParameters_ = null;
} else {
Expand Down Expand Up @@ -7371,6 +7449,7 @@ public com.google.cloud.aiplatform.v1beta1.BatchPredictionJob buildPartial() {
} else {
result.dedicatedResources_ = dedicatedResourcesBuilder_.build();
}
result.serviceAccount_ = serviceAccount_;
if (manualBatchTuningParametersBuilder_ == null) {
result.manualBatchTuningParameters_ = manualBatchTuningParameters_;
} else {
Expand Down Expand Up @@ -7516,6 +7595,10 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.BatchPredictionJob
if (other.hasDedicatedResources()) {
mergeDedicatedResources(other.getDedicatedResources());
}
if (!other.getServiceAccount().isEmpty()) {
serviceAccount_ = other.serviceAccount_;
onChanged();
}
if (other.hasManualBatchTuningParameters()) {
mergeManualBatchTuningParameters(other.getManualBatchTuningParameters());
}
Expand Down Expand Up @@ -9152,6 +9235,137 @@ public Builder clearDedicatedResources() {
return dedicatedResourcesBuilder_;
}

private java.lang.Object serviceAccount_ = "";
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return The serviceAccount.
*/
public java.lang.String getServiceAccount() {
java.lang.Object ref = serviceAccount_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceAccount_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return The bytes for serviceAccount.
*/
public com.google.protobuf.ByteString getServiceAccountBytes() {
java.lang.Object ref = serviceAccount_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
serviceAccount_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @param value The serviceAccount to set.
* @return This builder for chaining.
*/
public Builder setServiceAccount(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

serviceAccount_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return This builder for chaining.
*/
public Builder clearServiceAccount() {

serviceAccount_ = getDefaultInstance().getServiceAccount();
onChanged();
return this;
}
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @param value The bytes for serviceAccount to set.
* @return This builder for chaining.
*/
public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

serviceAccount_ = value;
onChanged();
return this;
}

private com.google.cloud.aiplatform.v1beta1.ManualBatchTuningParameters
manualBatchTuningParameters_;
private com.google.protobuf.SingleFieldBuilderV3<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,41 @@ public interface BatchPredictionJobOrBuilder
com.google.cloud.aiplatform.v1beta1.BatchDedicatedResourcesOrBuilder
getDedicatedResourcesOrBuilder();

/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return The serviceAccount.
*/
java.lang.String getServiceAccount();
/**
*
*
* <pre>
* The service account that the DeployedModel's container runs as. If not
* specified, a system generated one will be used, which
* has minimal permissions and the custom container, if used, may not have
* enough permission to access other GCP resources.
* Users deploying the Model must have the `iam.serviceAccounts.actAs`
* permission on this service account.
* </pre>
*
* <code>string service_account = 29;</code>
*
* @return The bytes for serviceAccount.
*/
com.google.protobuf.ByteString getServiceAccountBytes();

/**
*
*
Expand Down
Loading