Skip to content

Commit

Permalink
feat: [aiplatform] add service_account to UploadModelRequest in aipla…
Browse files Browse the repository at this point in the history
…tform v1beta1 model_service.proto (#8895)

* feat: add service_account to UploadModelRequest in aiplatform v1 model_service.proto

PiperOrigin-RevId: 493943349

Source-Link: googleapis/googleapis@9df3838

Source-Link: https://github.com/googleapis/googleapis-gen/commit/7345a78ad33b449f45d7d676ff0af93411ceae94
Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiI3MzQ1YTc4YWQzM2I0NDlmNDVkN2Q2NzZmZjBhZjkzNDExY2VhZTk0In0=

* 🦉 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

* feat: add service_account to UploadModelRequest in aiplatform v1beta1 model_service.proto

PiperOrigin-RevId: 493951002

Source-Link: googleapis/googleapis@aee01fa

Source-Link: https://github.com/googleapis/googleapis-gen/commit/d731f743409ba21261442224eec817b22c0ec922
Copy-Tag: eyJwIjoiamF2YS1haXBsYXRmb3JtLy5Pd2xCb3QueWFtbCIsImgiOiJkNzMxZjc0MzQwOWJhMjEyNjE0NDIyMjRlZWM4MTdiMjJjMGVjOTIyIn0=

* 🦉 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] authored Dec 9, 2022
1 parent 933f260 commit d7d94be
Show file tree
Hide file tree
Showing 10 changed files with 908 additions and 368 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
* .setParentModel("parentModel998431903")
* .setModelId("modelId1226956324")
* .setModel(Model.newBuilder().build())
* .setServiceAccount("serviceAccount1079137720")
* .build();
* UploadModelResponse response = modelServiceClient.uploadModelAsync(request).get();
* }
Expand Down Expand Up @@ -298,6 +299,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
* .setParentModel("parentModel998431903")
* .setModelId("modelId1226956324")
* .setModel(Model.newBuilder().build())
* .setServiceAccount("serviceAccount1079137720")
* .build();
* OperationFuture<UploadModelResponse, UploadModelOperationMetadata> future =
* modelServiceClient.uploadModelOperationCallable().futureCall(request);
Expand Down Expand Up @@ -331,6 +333,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
* .setParentModel("parentModel998431903")
* .setModelId("modelId1226956324")
* .setModel(Model.newBuilder().build())
* .setServiceAccount("serviceAccount1079137720")
* .build();
* ApiFuture<Operation> future = modelServiceClient.uploadModelCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
* .setParentModel("parentModel998431903")
* .setModelId("modelId1226956324")
* .setModel(Model.newBuilder().build())
* .setServiceAccount("serviceAccount1079137720")
* .build();
* UploadModelResponse response = modelServiceClient.uploadModelAsync(request).get();
* }
Expand Down Expand Up @@ -300,6 +301,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
* .setParentModel("parentModel998431903")
* .setModelId("modelId1226956324")
* .setModel(Model.newBuilder().build())
* .setServiceAccount("serviceAccount1079137720")
* .build();
* OperationFuture<UploadModelResponse, UploadModelOperationMetadata> future =
* modelServiceClient.uploadModelOperationCallable().futureCall(request);
Expand Down Expand Up @@ -333,6 +335,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
* .setParentModel("parentModel998431903")
* .setModelId("modelId1226956324")
* .setModel(Model.newBuilder().build())
* .setServiceAccount("serviceAccount1079137720")
* .build();
* ApiFuture<Operation> future = modelServiceClient.uploadModelCallable().futureCall(request);
* // Do something.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private UploadModelRequest() {
parent_ = "";
parentModel_ = "";
modelId_ = "";
serviceAccount_ = "";
}

@java.lang.Override
Expand Down Expand Up @@ -279,6 +280,67 @@ public com.google.cloud.aiplatform.v1.ModelOrBuilder getModelOrBuilder() {
return getModel();
}

public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 6;
private volatile java.lang.Object serviceAccount_;
/**
*
*
* <pre>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</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>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</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;
}
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -305,6 +367,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, modelId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAccount_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -326,6 +391,9 @@ public int getSerializedSize() {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, modelId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAccount_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -349,6 +417,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasModel()) {
if (!getModel().equals(other.getModel())) return false;
}
if (!getServiceAccount().equals(other.getServiceAccount())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -370,6 +439,8 @@ public int hashCode() {
hash = (37 * hash) + MODEL_FIELD_NUMBER;
hash = (53 * hash) + getModel().hashCode();
}
hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER;
hash = (53 * hash) + getServiceAccount().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -520,6 +591,8 @@ public Builder clear() {
model_ = null;
modelBuilder_ = null;
}
serviceAccount_ = "";

return this;
}

Expand Down Expand Up @@ -555,6 +628,7 @@ public com.google.cloud.aiplatform.v1.UploadModelRequest buildPartial() {
} else {
result.model_ = modelBuilder_.build();
}
result.serviceAccount_ = serviceAccount_;
onBuilt();
return result;
}
Expand Down Expand Up @@ -620,6 +694,10 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1.UploadModelRequest other
if (other.hasModel()) {
mergeModel(other.getModel());
}
if (!other.getServiceAccount().isEmpty()) {
serviceAccount_ = other.serviceAccount_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -670,6 +748,12 @@ public Builder mergeFrom(

break;
} // case 42
case 50:
{
serviceAccount_ = input.readStringRequireUtf8();

break;
} // case 50
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -1230,6 +1314,142 @@ public com.google.cloud.aiplatform.v1.ModelOrBuilder getModelOrBuilder() {
return modelBuilder_;
}

private java.lang.Object serviceAccount_ = "";
/**
*
*
* <pre>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</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>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</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>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</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>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearServiceAccount() {

serviceAccount_ = getDefaultInstance().getServiceAccount();
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</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;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,41 @@ public interface UploadModelRequestOrBuilder
* </code>
*/
com.google.cloud.aiplatform.v1.ModelOrBuilder getModelOrBuilder();

/**
*
*
* <pre>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The serviceAccount.
*/
java.lang.String getServiceAccount();
/**
*
*
* <pre>
* Optional. The user-provided custom service account to use to do the model
* upload. If empty, [Vertex AI Service
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
* will be used. Users uploading the Model must have the
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
* account must belong to the project specified in the `parent` field and have
* all necessary read permissions.
* </pre>
*
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The bytes for serviceAccount.
*/
com.google.protobuf.ByteString getServiceAccountBytes();
}
Loading

0 comments on commit d7d94be

Please sign in to comment.