Skip to content

Commit d7d94be

Browse files
feat: [aiplatform] add service_account to UploadModelRequest in aiplatform 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>
1 parent 933f260 commit d7d94be

File tree

10 files changed

+908
-368
lines changed

10 files changed

+908
-368
lines changed

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1/ModelServiceClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
266266
* .setParentModel("parentModel998431903")
267267
* .setModelId("modelId1226956324")
268268
* .setModel(Model.newBuilder().build())
269+
* .setServiceAccount("serviceAccount1079137720")
269270
* .build();
270271
* UploadModelResponse response = modelServiceClient.uploadModelAsync(request).get();
271272
* }
@@ -298,6 +299,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
298299
* .setParentModel("parentModel998431903")
299300
* .setModelId("modelId1226956324")
300301
* .setModel(Model.newBuilder().build())
302+
* .setServiceAccount("serviceAccount1079137720")
301303
* .build();
302304
* OperationFuture<UploadModelResponse, UploadModelOperationMetadata> future =
303305
* modelServiceClient.uploadModelOperationCallable().futureCall(request);
@@ -331,6 +333,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
331333
* .setParentModel("parentModel998431903")
332334
* .setModelId("modelId1226956324")
333335
* .setModel(Model.newBuilder().build())
336+
* .setServiceAccount("serviceAccount1079137720")
334337
* .build();
335338
* ApiFuture<Operation> future = modelServiceClient.uploadModelCallable().futureCall(request);
336339
* // Do something.

java-aiplatform/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/ModelServiceClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
268268
* .setParentModel("parentModel998431903")
269269
* .setModelId("modelId1226956324")
270270
* .setModel(Model.newBuilder().build())
271+
* .setServiceAccount("serviceAccount1079137720")
271272
* .build();
272273
* UploadModelResponse response = modelServiceClient.uploadModelAsync(request).get();
273274
* }
@@ -300,6 +301,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
300301
* .setParentModel("parentModel998431903")
301302
* .setModelId("modelId1226956324")
302303
* .setModel(Model.newBuilder().build())
304+
* .setServiceAccount("serviceAccount1079137720")
303305
* .build();
304306
* OperationFuture<UploadModelResponse, UploadModelOperationMetadata> future =
305307
* modelServiceClient.uploadModelOperationCallable().futureCall(request);
@@ -333,6 +335,7 @@ public final OperationFuture<UploadModelResponse, UploadModelOperationMetadata>
333335
* .setParentModel("parentModel998431903")
334336
* .setModelId("modelId1226956324")
335337
* .setModel(Model.newBuilder().build())
338+
* .setServiceAccount("serviceAccount1079137720")
336339
* .build();
337340
* ApiFuture<Operation> future = modelServiceClient.uploadModelCallable().futureCall(request);
338341
* // Do something.

java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/ModelServiceProto.java

Lines changed: 174 additions & 173 deletions
Large diffs are not rendered by default.

java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UploadModelRequest.java

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ private UploadModelRequest() {
4141
parent_ = "";
4242
parentModel_ = "";
4343
modelId_ = "";
44+
serviceAccount_ = "";
4445
}
4546

4647
@java.lang.Override
@@ -279,6 +280,67 @@ public com.google.cloud.aiplatform.v1.ModelOrBuilder getModelOrBuilder() {
279280
return getModel();
280281
}
281282

283+
public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 6;
284+
private volatile java.lang.Object serviceAccount_;
285+
/**
286+
*
287+
*
288+
* <pre>
289+
* Optional. The user-provided custom service account to use to do the model
290+
* upload. If empty, [Vertex AI Service
291+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
292+
* will be used. Users uploading the Model must have the
293+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
294+
* account must belong to the project specified in the `parent` field and have
295+
* all necessary read permissions.
296+
* </pre>
297+
*
298+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
299+
*
300+
* @return The serviceAccount.
301+
*/
302+
@java.lang.Override
303+
public java.lang.String getServiceAccount() {
304+
java.lang.Object ref = serviceAccount_;
305+
if (ref instanceof java.lang.String) {
306+
return (java.lang.String) ref;
307+
} else {
308+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
309+
java.lang.String s = bs.toStringUtf8();
310+
serviceAccount_ = s;
311+
return s;
312+
}
313+
}
314+
/**
315+
*
316+
*
317+
* <pre>
318+
* Optional. The user-provided custom service account to use to do the model
319+
* upload. If empty, [Vertex AI Service
320+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
321+
* will be used. Users uploading the Model must have the
322+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
323+
* account must belong to the project specified in the `parent` field and have
324+
* all necessary read permissions.
325+
* </pre>
326+
*
327+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
328+
*
329+
* @return The bytes for serviceAccount.
330+
*/
331+
@java.lang.Override
332+
public com.google.protobuf.ByteString getServiceAccountBytes() {
333+
java.lang.Object ref = serviceAccount_;
334+
if (ref instanceof java.lang.String) {
335+
com.google.protobuf.ByteString b =
336+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
337+
serviceAccount_ = b;
338+
return b;
339+
} else {
340+
return (com.google.protobuf.ByteString) ref;
341+
}
342+
}
343+
282344
private byte memoizedIsInitialized = -1;
283345

284346
@java.lang.Override
@@ -305,6 +367,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
305367
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) {
306368
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, modelId_);
307369
}
370+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
371+
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAccount_);
372+
}
308373
getUnknownFields().writeTo(output);
309374
}
310375

@@ -326,6 +391,9 @@ public int getSerializedSize() {
326391
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(modelId_)) {
327392
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, modelId_);
328393
}
394+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccount_)) {
395+
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAccount_);
396+
}
329397
size += getUnknownFields().getSerializedSize();
330398
memoizedSize = size;
331399
return size;
@@ -349,6 +417,7 @@ public boolean equals(final java.lang.Object obj) {
349417
if (hasModel()) {
350418
if (!getModel().equals(other.getModel())) return false;
351419
}
420+
if (!getServiceAccount().equals(other.getServiceAccount())) return false;
352421
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
353422
return true;
354423
}
@@ -370,6 +439,8 @@ public int hashCode() {
370439
hash = (37 * hash) + MODEL_FIELD_NUMBER;
371440
hash = (53 * hash) + getModel().hashCode();
372441
}
442+
hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER;
443+
hash = (53 * hash) + getServiceAccount().hashCode();
373444
hash = (29 * hash) + getUnknownFields().hashCode();
374445
memoizedHashCode = hash;
375446
return hash;
@@ -520,6 +591,8 @@ public Builder clear() {
520591
model_ = null;
521592
modelBuilder_ = null;
522593
}
594+
serviceAccount_ = "";
595+
523596
return this;
524597
}
525598

@@ -555,6 +628,7 @@ public com.google.cloud.aiplatform.v1.UploadModelRequest buildPartial() {
555628
} else {
556629
result.model_ = modelBuilder_.build();
557630
}
631+
result.serviceAccount_ = serviceAccount_;
558632
onBuilt();
559633
return result;
560634
}
@@ -620,6 +694,10 @@ public Builder mergeFrom(com.google.cloud.aiplatform.v1.UploadModelRequest other
620694
if (other.hasModel()) {
621695
mergeModel(other.getModel());
622696
}
697+
if (!other.getServiceAccount().isEmpty()) {
698+
serviceAccount_ = other.serviceAccount_;
699+
onChanged();
700+
}
623701
this.mergeUnknownFields(other.getUnknownFields());
624702
onChanged();
625703
return this;
@@ -670,6 +748,12 @@ public Builder mergeFrom(
670748

671749
break;
672750
} // case 42
751+
case 50:
752+
{
753+
serviceAccount_ = input.readStringRequireUtf8();
754+
755+
break;
756+
} // case 50
673757
default:
674758
{
675759
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -1230,6 +1314,142 @@ public com.google.cloud.aiplatform.v1.ModelOrBuilder getModelOrBuilder() {
12301314
return modelBuilder_;
12311315
}
12321316

1317+
private java.lang.Object serviceAccount_ = "";
1318+
/**
1319+
*
1320+
*
1321+
* <pre>
1322+
* Optional. The user-provided custom service account to use to do the model
1323+
* upload. If empty, [Vertex AI Service
1324+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1325+
* will be used. Users uploading the Model must have the
1326+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
1327+
* account must belong to the project specified in the `parent` field and have
1328+
* all necessary read permissions.
1329+
* </pre>
1330+
*
1331+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1332+
*
1333+
* @return The serviceAccount.
1334+
*/
1335+
public java.lang.String getServiceAccount() {
1336+
java.lang.Object ref = serviceAccount_;
1337+
if (!(ref instanceof java.lang.String)) {
1338+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1339+
java.lang.String s = bs.toStringUtf8();
1340+
serviceAccount_ = s;
1341+
return s;
1342+
} else {
1343+
return (java.lang.String) ref;
1344+
}
1345+
}
1346+
/**
1347+
*
1348+
*
1349+
* <pre>
1350+
* Optional. The user-provided custom service account to use to do the model
1351+
* upload. If empty, [Vertex AI Service
1352+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1353+
* will be used. Users uploading the Model must have the
1354+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
1355+
* account must belong to the project specified in the `parent` field and have
1356+
* all necessary read permissions.
1357+
* </pre>
1358+
*
1359+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1360+
*
1361+
* @return The bytes for serviceAccount.
1362+
*/
1363+
public com.google.protobuf.ByteString getServiceAccountBytes() {
1364+
java.lang.Object ref = serviceAccount_;
1365+
if (ref instanceof String) {
1366+
com.google.protobuf.ByteString b =
1367+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1368+
serviceAccount_ = b;
1369+
return b;
1370+
} else {
1371+
return (com.google.protobuf.ByteString) ref;
1372+
}
1373+
}
1374+
/**
1375+
*
1376+
*
1377+
* <pre>
1378+
* Optional. The user-provided custom service account to use to do the model
1379+
* upload. If empty, [Vertex AI Service
1380+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1381+
* will be used. Users uploading the Model must have the
1382+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
1383+
* account must belong to the project specified in the `parent` field and have
1384+
* all necessary read permissions.
1385+
* </pre>
1386+
*
1387+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1388+
*
1389+
* @param value The serviceAccount to set.
1390+
* @return This builder for chaining.
1391+
*/
1392+
public Builder setServiceAccount(java.lang.String value) {
1393+
if (value == null) {
1394+
throw new NullPointerException();
1395+
}
1396+
1397+
serviceAccount_ = value;
1398+
onChanged();
1399+
return this;
1400+
}
1401+
/**
1402+
*
1403+
*
1404+
* <pre>
1405+
* Optional. The user-provided custom service account to use to do the model
1406+
* upload. If empty, [Vertex AI Service
1407+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1408+
* will be used. Users uploading the Model must have the
1409+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
1410+
* account must belong to the project specified in the `parent` field and have
1411+
* all necessary read permissions.
1412+
* </pre>
1413+
*
1414+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1415+
*
1416+
* @return This builder for chaining.
1417+
*/
1418+
public Builder clearServiceAccount() {
1419+
1420+
serviceAccount_ = getDefaultInstance().getServiceAccount();
1421+
onChanged();
1422+
return this;
1423+
}
1424+
/**
1425+
*
1426+
*
1427+
* <pre>
1428+
* Optional. The user-provided custom service account to use to do the model
1429+
* upload. If empty, [Vertex AI Service
1430+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1431+
* will be used. Users uploading the Model must have the
1432+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
1433+
* account must belong to the project specified in the `parent` field and have
1434+
* all necessary read permissions.
1435+
* </pre>
1436+
*
1437+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
1438+
*
1439+
* @param value The bytes for serviceAccount to set.
1440+
* @return This builder for chaining.
1441+
*/
1442+
public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) {
1443+
if (value == null) {
1444+
throw new NullPointerException();
1445+
}
1446+
checkByteStringIsUtf8(value);
1447+
1448+
serviceAccount_ = value;
1449+
onChanged();
1450+
return this;
1451+
}
1452+
12331453
@java.lang.Override
12341454
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
12351455
return super.setUnknownFields(unknownFields);

java-aiplatform/proto-google-cloud-aiplatform-v1/src/main/java/com/google/cloud/aiplatform/v1/UploadModelRequestOrBuilder.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,41 @@ public interface UploadModelRequestOrBuilder
149149
* </code>
150150
*/
151151
com.google.cloud.aiplatform.v1.ModelOrBuilder getModelOrBuilder();
152+
153+
/**
154+
*
155+
*
156+
* <pre>
157+
* Optional. The user-provided custom service account to use to do the model
158+
* upload. If empty, [Vertex AI Service
159+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
160+
* will be used. Users uploading the Model must have the
161+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
162+
* account must belong to the project specified in the `parent` field and have
163+
* all necessary read permissions.
164+
* </pre>
165+
*
166+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
167+
*
168+
* @return The serviceAccount.
169+
*/
170+
java.lang.String getServiceAccount();
171+
/**
172+
*
173+
*
174+
* <pre>
175+
* Optional. The user-provided custom service account to use to do the model
176+
* upload. If empty, [Vertex AI Service
177+
* Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
178+
* will be used. Users uploading the Model must have the
179+
* `iam.serviceAccounts.actAs` permission on this service account. Also, this
180+
* account must belong to the project specified in the `parent` field and have
181+
* all necessary read permissions.
182+
* </pre>
183+
*
184+
* <code>string service_account = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
185+
*
186+
* @return The bytes for serviceAccount.
187+
*/
188+
com.google.protobuf.ByteString getServiceAccountBytes();
152189
}

0 commit comments

Comments
 (0)