Skip to content

Commit 69a59b3

Browse files
author
SDKAuto
committed
CodeGen from PR 33408 in Azure/azure-rest-api-specs
Merge e50f8869aa0f09cf476e0795dabb5140831cbefa into 4b03f0beabaf5a2d42fedb8cbb37bce41cc09344
1 parent b837344 commit 69a59b3

17 files changed

+937
-423
lines changed

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchAsyncClient.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.azure.compute.batch.models.BatchApplication;
1212
import com.azure.compute.batch.models.BatchCertificate;
1313
import com.azure.compute.batch.models.BatchClientParallelOptions;
14+
import com.azure.compute.batch.models.BatchCreateTaskCollectionResult;
1415
import com.azure.compute.batch.models.BatchJob;
1516
import com.azure.compute.batch.models.BatchJobCreateContent;
1617
import com.azure.compute.batch.models.BatchJobDisableContent;
@@ -45,7 +46,6 @@
4546
import com.azure.compute.batch.models.BatchSubtask;
4647
import com.azure.compute.batch.models.BatchSupportedImage;
4748
import com.azure.compute.batch.models.BatchTask;
48-
import com.azure.compute.batch.models.BatchTaskAddCollectionResult;
4949
import com.azure.compute.batch.models.BatchTaskCountsResult;
5050
import com.azure.compute.batch.models.BatchTaskCreateContent;
5151
import com.azure.compute.batch.models.BatchTaskGroup;
@@ -90,7 +90,6 @@
9090
import com.azure.compute.batch.models.GetBatchTaskFileOptions;
9191
import com.azure.compute.batch.models.GetBatchTaskFilePropertiesOptions;
9292
import com.azure.compute.batch.models.GetBatchTaskOptions;
93-
import com.azure.compute.batch.models.GetCertificateResponse;
9493
import com.azure.compute.batch.models.ListBatchApplicationsOptions;
9594
import com.azure.compute.batch.models.ListBatchCertificatesOptions;
9695
import com.azure.compute.batch.models.ListBatchJobPreparationAndReleaseTaskStatusOptions;
@@ -5790,6 +5789,9 @@ public Mono<Response<Void>> deleteCertificateWithResponse(String thumbprintAlgor
57905789
* }
57915790
* ]
57925791
* }
5792+
* data: String (Required)
5793+
* certificateFormat: String(pfx/cer) (Optional)
5794+
* password: String (Optional)
57935795
* }
57945796
* }
57955797
* </pre>
@@ -8991,8 +8993,8 @@ public PagedFlux<BinaryData> listTasks(String jobId, RequestOptions requestOptio
89918993
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
89928994
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
89938995
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
8994-
* @return the result of adding a collection of Tasks to a Job along with {@link Response} on successful completion
8995-
* of {@link Mono}.
8996+
* @return the result of creating a collection of Tasks to a Job along with {@link Response} on successful
8997+
* completion of {@link Mono}.
89968998
*/
89978999
@Generated
89989000
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -13699,7 +13701,7 @@ public Mono<Void> deleteCertificate(String thumbprintAlgorithm, String thumbprin
1369913701
*/
1370013702
@Generated
1370113703
@ServiceMethod(returns = ReturnType.SINGLE)
13702-
public Mono<GetCertificateResponse> getCertificate(String thumbprintAlgorithm, String thumbprint,
13704+
public Mono<BatchCertificate> getCertificate(String thumbprintAlgorithm, String thumbprint,
1370313705
GetBatchCertificateOptions options) {
1370413706
// Generated convenience method for getCertificateWithResponse
1370513707
RequestOptions requestOptions = new RequestOptions();
@@ -13716,7 +13718,7 @@ public Mono<GetCertificateResponse> getCertificate(String thumbprintAlgorithm, S
1371613718
false);
1371713719
}
1371813720
return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono)
13719-
.map(protocolMethodData -> protocolMethodData.toObject(GetCertificateResponse.class));
13721+
.map(protocolMethodData -> protocolMethodData.toObject(BatchCertificate.class));
1372013722
}
1372113723

1372213724
/**
@@ -13734,11 +13736,11 @@ public Mono<GetCertificateResponse> getCertificate(String thumbprintAlgorithm, S
1373413736
*/
1373513737
@Generated
1373613738
@ServiceMethod(returns = ReturnType.SINGLE)
13737-
public Mono<GetCertificateResponse> getCertificate(String thumbprintAlgorithm, String thumbprint) {
13739+
public Mono<BatchCertificate> getCertificate(String thumbprintAlgorithm, String thumbprint) {
1373813740
// Generated convenience method for getCertificateWithResponse
1373913741
RequestOptions requestOptions = new RequestOptions();
1374013742
return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).flatMap(FluxUtil::toMono)
13741-
.map(protocolMethodData -> protocolMethodData.toObject(GetCertificateResponse.class));
13743+
.map(protocolMethodData -> protocolMethodData.toObject(BatchCertificate.class));
1374213744
}
1374313745

1374413746
/**
@@ -14646,11 +14648,11 @@ public PagedFlux<BatchTask> listTasks(String jobId) {
1464614648
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
1464714649
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
1464814650
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
14649-
* @return the result of adding a collection of Tasks to a Job on successful completion of {@link Mono}.
14651+
* @return the result of creating a collection of Tasks to a Job on successful completion of {@link Mono}.
1465014652
*/
1465114653
@Generated
1465214654
@ServiceMethod(returns = ReturnType.SINGLE)
14653-
public Mono<BatchTaskAddCollectionResult> createTaskCollection(String jobId, BatchTaskGroup taskCollection,
14655+
public Mono<BatchCreateTaskCollectionResult> createTaskCollection(String jobId, BatchTaskGroup taskCollection,
1465414656
CreateBatchTaskCollectionOptions options) {
1465514657
// Generated convenience method for createTaskCollectionWithResponse
1465614658
RequestOptions requestOptions = new RequestOptions();
@@ -14660,7 +14662,7 @@ public Mono<BatchTaskAddCollectionResult> createTaskCollection(String jobId, Bat
1466014662
}
1466114663
return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions)
1466214664
.flatMap(FluxUtil::toMono)
14663-
.map(protocolMethodData -> protocolMethodData.toObject(BatchTaskAddCollectionResult.class));
14665+
.map(protocolMethodData -> protocolMethodData.toObject(BatchCreateTaskCollectionResult.class));
1466414666
}
1466514667

1466614668
/**
@@ -14689,16 +14691,16 @@ public Mono<BatchTaskAddCollectionResult> createTaskCollection(String jobId, Bat
1468914691
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
1469014692
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
1469114693
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
14692-
* @return the result of adding a collection of Tasks to a Job on successful completion of {@link Mono}.
14694+
* @return the result of creating a collection of Tasks to a Job on successful completion of {@link Mono}.
1469314695
*/
1469414696
@Generated
1469514697
@ServiceMethod(returns = ReturnType.SINGLE)
14696-
public Mono<BatchTaskAddCollectionResult> createTaskCollection(String jobId, BatchTaskGroup taskCollection) {
14698+
public Mono<BatchCreateTaskCollectionResult> createTaskCollection(String jobId, BatchTaskGroup taskCollection) {
1469714699
// Generated convenience method for createTaskCollectionWithResponse
1469814700
RequestOptions requestOptions = new RequestOptions();
1469914701
return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions)
1470014702
.flatMap(FluxUtil::toMono)
14701-
.map(protocolMethodData -> protocolMethodData.toObject(BatchTaskAddCollectionResult.class));
14703+
.map(protocolMethodData -> protocolMethodData.toObject(BatchCreateTaskCollectionResult.class));
1470214704
}
1470314705

1470414706
/**

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/BatchClient.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.azure.compute.batch.models.BatchApplication;
1212
import com.azure.compute.batch.models.BatchCertificate;
1313
import com.azure.compute.batch.models.BatchClientParallelOptions;
14+
import com.azure.compute.batch.models.BatchCreateTaskCollectionResult;
1415
import com.azure.compute.batch.models.BatchJob;
1516
import com.azure.compute.batch.models.BatchJobCreateContent;
1617
import com.azure.compute.batch.models.BatchJobDisableContent;
@@ -45,7 +46,6 @@
4546
import com.azure.compute.batch.models.BatchSubtask;
4647
import com.azure.compute.batch.models.BatchSupportedImage;
4748
import com.azure.compute.batch.models.BatchTask;
48-
import com.azure.compute.batch.models.BatchTaskAddCollectionResult;
4949
import com.azure.compute.batch.models.BatchTaskCountsResult;
5050
import com.azure.compute.batch.models.BatchTaskCreateContent;
5151
import com.azure.compute.batch.models.BatchTaskGroup;
@@ -90,7 +90,6 @@
9090
import com.azure.compute.batch.models.GetBatchTaskFileOptions;
9191
import com.azure.compute.batch.models.GetBatchTaskFilePropertiesOptions;
9292
import com.azure.compute.batch.models.GetBatchTaskOptions;
93-
import com.azure.compute.batch.models.GetCertificateResponse;
9493
import com.azure.compute.batch.models.ListBatchApplicationsOptions;
9594
import com.azure.compute.batch.models.ListBatchCertificatesOptions;
9695
import com.azure.compute.batch.models.ListBatchJobPreparationAndReleaseTaskStatusOptions;
@@ -5780,6 +5779,9 @@ public Response<Void> deleteCertificateWithResponse(String thumbprintAlgorithm,
57805779
* }
57815780
* ]
57825781
* }
5782+
* data: String (Required)
5783+
* certificateFormat: String(pfx/cer) (Optional)
5784+
* password: String (Optional)
57835785
* }
57845786
* }
57855787
* </pre>
@@ -8979,7 +8981,7 @@ public PagedIterable<BinaryData> listTasks(String jobId, RequestOptions requestO
89798981
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
89808982
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
89818983
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
8982-
* @return the result of adding a collection of Tasks to a Job along with {@link Response}.
8984+
* @return the result of creating a collection of Tasks to a Job along with {@link Response}.
89838985
*/
89848986
@Generated
89858987
@ServiceMethod(returns = ReturnType.SINGLE)
@@ -13418,7 +13420,7 @@ public void deleteCertificate(String thumbprintAlgorithm, String thumbprint) {
1341813420
*/
1341913421
@Generated
1342013422
@ServiceMethod(returns = ReturnType.SINGLE)
13421-
public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String thumbprint,
13423+
public BatchCertificate getCertificate(String thumbprintAlgorithm, String thumbprint,
1342213424
GetBatchCertificateOptions options) {
1342313425
// Generated convenience method for getCertificateWithResponse
1342413426
RequestOptions requestOptions = new RequestOptions();
@@ -13435,7 +13437,7 @@ public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String
1343513437
false);
1343613438
}
1343713439
return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue()
13438-
.toObject(GetCertificateResponse.class);
13440+
.toObject(BatchCertificate.class);
1343913441
}
1344013442

1344113443
/**
@@ -13453,11 +13455,11 @@ public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String
1345313455
*/
1345413456
@Generated
1345513457
@ServiceMethod(returns = ReturnType.SINGLE)
13456-
public GetCertificateResponse getCertificate(String thumbprintAlgorithm, String thumbprint) {
13458+
public BatchCertificate getCertificate(String thumbprintAlgorithm, String thumbprint) {
1345713459
// Generated convenience method for getCertificateWithResponse
1345813460
RequestOptions requestOptions = new RequestOptions();
1345913461
return getCertificateWithResponse(thumbprintAlgorithm, thumbprint, requestOptions).getValue()
13460-
.toObject(GetCertificateResponse.class);
13462+
.toObject(BatchCertificate.class);
1346113463
}
1346213464

1346313465
/**
@@ -14296,11 +14298,11 @@ public PagedIterable<BatchTask> listTasks(String jobId) {
1429614298
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
1429714299
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
1429814300
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
14299-
* @return the result of adding a collection of Tasks to a Job.
14301+
* @return the result of creating a collection of Tasks to a Job.
1430014302
*/
1430114303
@Generated
1430214304
@ServiceMethod(returns = ReturnType.SINGLE)
14303-
public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection,
14305+
public BatchCreateTaskCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection,
1430414306
CreateBatchTaskCollectionOptions options) {
1430514307
// Generated convenience method for createTaskCollectionWithResponse
1430614308
RequestOptions requestOptions = new RequestOptions();
@@ -14309,7 +14311,7 @@ public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTask
1430914311
requestOptions.addQueryParam("timeOut", String.valueOf(timeOutInSeconds), false);
1431014312
}
1431114313
return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions).getValue()
14312-
.toObject(BatchTaskAddCollectionResult.class);
14314+
.toObject(BatchCreateTaskCollectionResult.class);
1431314315
}
1431414316

1431514317
/**
@@ -14338,15 +14340,15 @@ public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTask
1433814340
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
1433914341
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
1434014342
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
14341-
* @return the result of adding a collection of Tasks to a Job.
14343+
* @return the result of creating a collection of Tasks to a Job.
1434214344
*/
1434314345
@Generated
1434414346
@ServiceMethod(returns = ReturnType.SINGLE)
14345-
public BatchTaskAddCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection) {
14347+
public BatchCreateTaskCollectionResult createTaskCollection(String jobId, BatchTaskGroup taskCollection) {
1434614348
// Generated convenience method for createTaskCollectionWithResponse
1434714349
RequestOptions requestOptions = new RequestOptions();
1434814350
return createTaskCollectionWithResponse(jobId, BinaryData.fromObject(taskCollection), requestOptions).getValue()
14349-
.toObject(BatchTaskAddCollectionResult.class);
14351+
.toObject(BatchCreateTaskCollectionResult.class);
1435014352
}
1435114353

1435214354
/**

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/BatchClientImpl.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17240,6 +17240,9 @@ public Response<Void> deleteCertificateWithResponse(String thumbprintAlgorithm,
1724017240
* }
1724117241
* ]
1724217242
* }
17243+
* data: String (Required)
17244+
* certificateFormat: String(pfx/cer) (Optional)
17245+
* password: String (Optional)
1724317246
* }
1724417247
* }
1724517248
* </pre>
@@ -17298,6 +17301,9 @@ public Mono<Response<BinaryData>> getCertificateWithResponseAsync(String thumbpr
1729817301
* }
1729917302
* ]
1730017303
* }
17304+
* data: String (Required)
17305+
* certificateFormat: String(pfx/cer) (Optional)
17306+
* password: String (Optional)
1730117307
* }
1730217308
* }
1730317309
* </pre>
@@ -25015,8 +25021,8 @@ public PagedIterable<BinaryData> listTasks(String jobId, RequestOptions requestO
2501525021
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
2501625022
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
2501725023
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
25018-
* @return the result of adding a collection of Tasks to a Job along with {@link Response} on successful completion
25019-
* of {@link Mono}.
25024+
* @return the result of creating a collection of Tasks to a Job along with {@link Response} on successful
25025+
* completion of {@link Mono}.
2502025026
*/
2502125027
@ServiceMethod(returns = ReturnType.SINGLE)
2502225028
public Mono<Response<BinaryData>> createTaskCollectionWithResponseAsync(String jobId, BinaryData taskCollection,
@@ -25231,7 +25237,7 @@ public Mono<Response<BinaryData>> createTaskCollectionWithResponseAsync(String j
2523125237
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
2523225238
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
2523325239
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
25234-
* @return the result of adding a collection of Tasks to a Job along with {@link Response}.
25240+
* @return the result of creating a collection of Tasks to a Job along with {@link Response}.
2523525241
*/
2523625242
@ServiceMethod(returns = ReturnType.SINGLE)
2523725243
public Response<BinaryData> createTaskCollectionWithResponse(String jobId, BinaryData taskCollection,
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.compute.batch.models;
6+
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.core.annotation.Immutable;
9+
import com.azure.json.JsonReader;
10+
import com.azure.json.JsonSerializable;
11+
import com.azure.json.JsonToken;
12+
import com.azure.json.JsonWriter;
13+
import java.io.IOException;
14+
import java.util.List;
15+
16+
/**
17+
* The result of creating a collection of Tasks to a Job.
18+
*/
19+
@Immutable
20+
public final class BatchCreateTaskCollectionResult implements JsonSerializable<BatchCreateTaskCollectionResult> {
21+
/*
22+
* The results of the create Task collection operation.
23+
*/
24+
@Generated
25+
private List<BatchTaskCreateResult> value;
26+
27+
/**
28+
* Creates an instance of BatchCreateTaskCollectionResult class.
29+
*/
30+
@Generated
31+
private BatchCreateTaskCollectionResult() {
32+
}
33+
34+
/**
35+
* Get the value property: The results of the create Task collection operation.
36+
*
37+
* @return the value value.
38+
*/
39+
@Generated
40+
public List<BatchTaskCreateResult> getValue() {
41+
return this.value;
42+
}
43+
44+
/**
45+
* {@inheritDoc}
46+
*/
47+
@Generated
48+
@Override
49+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
50+
jsonWriter.writeStartObject();
51+
jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
52+
return jsonWriter.writeEndObject();
53+
}
54+
55+
/**
56+
* Reads an instance of BatchCreateTaskCollectionResult from the JsonReader.
57+
*
58+
* @param jsonReader The JsonReader being read.
59+
* @return An instance of BatchCreateTaskCollectionResult if the JsonReader was pointing to an instance of it, or
60+
* null if it was pointing to JSON null.
61+
* @throws IOException If an error occurs while reading the BatchCreateTaskCollectionResult.
62+
*/
63+
@Generated
64+
public static BatchCreateTaskCollectionResult fromJson(JsonReader jsonReader) throws IOException {
65+
return jsonReader.readObject(reader -> {
66+
BatchCreateTaskCollectionResult deserializedBatchCreateTaskCollectionResult
67+
= new BatchCreateTaskCollectionResult();
68+
while (reader.nextToken() != JsonToken.END_OBJECT) {
69+
String fieldName = reader.getFieldName();
70+
reader.nextToken();
71+
72+
if ("value".equals(fieldName)) {
73+
List<BatchTaskCreateResult> value
74+
= reader.readArray(reader1 -> BatchTaskCreateResult.fromJson(reader1));
75+
deserializedBatchCreateTaskCollectionResult.value = value;
76+
} else {
77+
reader.skipChildren();
78+
}
79+
}
80+
81+
return deserializedBatchCreateTaskCollectionResult;
82+
});
83+
}
84+
}

0 commit comments

Comments
 (0)