Skip to content

Commit

Permalink
feat: [aiplatform] add service_account to batch_prediction_job in aip…
Browse files Browse the repository at this point in the history
…latform v1 batch_prediction_job.proto (#8780)

* feat: add service_account to batch_prediction_job in aiplatform v1 batch_prediction_job.proto

PiperOrigin-RevId: 488416174

Source-Link: googleapis/googleapis@b4dea4a

Source-Link: googleapis/googleapis-gen@6a98691
Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiI2YTk4NjkxMDg1MzU5NTZmNGMxNjY2NzUwNTMyY2M1NzhkMzg0NGRiIn0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Nov 17, 2022
1 parent 85717c2 commit 7304a6b
Show file tree
Hide file tree
Showing 6 changed files with 329 additions and 66 deletions.
32 changes: 16 additions & 16 deletions java-aiplatform/README.md
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-aiplatform</artifactId>
<version>3.6.0</version>
<version>3.7.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-aiplatform:3.6.0'
implementation 'com.google.cloud:google-cloud-aiplatform:3.7.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.6.0"
libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.7.0"
```

## Authentication
Expand Down Expand Up @@ -159,16 +159,16 @@ Java is a registered trademark of Oracle and/or its affiliates.

[product-docs]: https://cloud.google.com/vertex-ai/docs
[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-aiplatform/latest/overview
[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java7.svg
[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java7.html
[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java8.svg
[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java8.html
[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java8-osx.svg
[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java8-osx.html
[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java8-win.svg
[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java8-win.html
[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java11.svg
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-aiplatform/java11.html
[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg
[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html
[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg
[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html
[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg
[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html
[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg
[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html
[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-aiplatform.svg
[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-aiplatform&core=gav
Expand All @@ -180,9 +180,9 @@ Java is a registered trademark of Oracle and/or its affiliates.
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
[cloud-sdk]: https://cloud.google.com/sdk/
[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting
[contributing]: https://github.com/googleapis/java-aiplatform/blob/main/CONTRIBUTING.md
[code-of-conduct]: https://github.com/googleapis/java-aiplatform/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
[license]: https://github.com/googleapis/java-aiplatform/blob/main/LICENSE
[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md
[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE
[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing
[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=aiplatform.googleapis.com
[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
Expand Down
Expand Up @@ -1550,6 +1550,7 @@ public void createBatchPredictionJobTest() throws Exception {
.setModelParameters(Value.newBuilder().setBoolValue(true).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 @@ -1617,6 +1618,7 @@ public void createBatchPredictionJobTest2() throws Exception {
.setModelParameters(Value.newBuilder().setBoolValue(true).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 @@ -1684,6 +1686,7 @@ public void getBatchPredictionJobTest() throws Exception {
.setModelParameters(Value.newBuilder().setBoolValue(true).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 @@ -1750,6 +1753,7 @@ public void getBatchPredictionJobTest2() throws Exception {
.setModelParameters(Value.newBuilder().setBoolValue(true).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 @@ -45,6 +45,7 @@ private BatchPredictionJob() {
displayName_ = "";
model_ = "";
modelVersionId_ = "";
serviceAccount_ = "";
state_ = 0;
partialFailures_ = java.util.Collections.emptyList();
}
Expand Down Expand Up @@ -5369,6 +5370,65 @@ public com.google.cloud.aiplatform.v1.BatchDedicatedResources getDedicatedResour
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.v1.ManualBatchTuningParameters manualBatchTuningParameters_;
/**
Expand Down Expand Up @@ -6333,6 +6393,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_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 30, modelVersionId_);
}
Expand Down Expand Up @@ -6425,6 +6488,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_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelVersionId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(30, modelVersionId_);
}
Expand Down Expand Up @@ -6468,6 +6534,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 @@ -6556,6 +6623,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 @@ -6811,6 +6880,8 @@ public Builder clear() {
dedicatedResources_ = null;
dedicatedResourcesBuilder_ = null;
}
serviceAccount_ = "";

if (manualBatchTuningParametersBuilder_ == null) {
manualBatchTuningParameters_ = null;
} else {
Expand Down Expand Up @@ -6946,6 +7017,7 @@ public com.google.cloud.aiplatform.v1.BatchPredictionJob buildPartial() {
} else {
result.dedicatedResources_ = dedicatedResourcesBuilder_.build();
}
result.serviceAccount_ = serviceAccount_;
if (manualBatchTuningParametersBuilder_ == null) {
result.manualBatchTuningParameters_ = manualBatchTuningParameters_;
} else {
Expand Down Expand Up @@ -7095,6 +7167,10 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1.BatchPredictionJob other
if (other.hasDedicatedResources()) {
mergeDedicatedResources(other.getDedicatedResources());
}
if (!other.getServiceAccount().isEmpty()) {
serviceAccount_ = other.serviceAccount_;
onChanged();
}
if (other.hasManualBatchTuningParameters()) {
mergeManualBatchTuningParameters(other.getManualBatchTuningParameters());
}
Expand Down Expand Up @@ -7341,6 +7417,12 @@ public Builder mergeFrom(

break;
} // case 226
case 234:
{
serviceAccount_ = input.readStringRequireUtf8();

break;
} // case 234
case 242:
{
modelVersionId_ = input.readStringRequireUtf8();
Expand Down Expand Up @@ -8992,6 +9074,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.v1.ManualBatchTuningParameters manualBatchTuningParameters_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.aiplatform.v1.ManualBatchTuningParameters,
Expand Down

0 comments on commit 7304a6b

Please sign in to comment.