Skip to content

Commit 27227ac

Browse files
authored
Update TypeSpec hash and regenerate SDK (Azure#44252)
1 parent 0cde273 commit 27227ac

30 files changed

+245
-423
lines changed

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

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

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

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

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

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

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobManagerTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public final class BatchJobManagerTask implements JsonSerializable<BatchJobManag
6060
* features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or
6161
* "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path
6262
* (relative to the Task working directory), or use the Batch provided environment variable
63-
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
63+
* (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).
6464
*/
6565
@Generated
6666
private final String commandLine;
@@ -229,7 +229,7 @@ public BatchJobManagerTask setDisplayName(String displayName) {
229229
* to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c
230230
* MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use
231231
* a relative path (relative to the Task working directory), or use the Batch provided environment variable
232-
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
232+
* (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).
233233
*
234234
* @return the commandLine value.
235235
*/

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobNetworkConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public final class BatchJobNetworkConfiguration implements JsonSerializable<Batc
3232
* must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine
3333
* configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is
3434
* also required to be open for outbound connections for communications to Azure Storage. For more details see:
35-
* https://docs.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
35+
* https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
3636
*/
3737
@Generated
3838
private final String subnetId;
@@ -52,7 +52,7 @@ public final class BatchJobNetworkConfiguration implements JsonSerializable<Batc
5252
* enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine
5353
* configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is
5454
* also required to be open for outbound connections for communications to Azure Storage. For more details see:
55-
* https://docs.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
55+
* https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
5656
*
5757
* @return the subnetId value.
5858
*/

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobPreparationTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public final class BatchJobPreparationTask implements JsonSerializable<BatchJobP
6060
* features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or
6161
* "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path
6262
* (relative to the Task working directory), or use the Batch provided environment variable
63-
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
63+
* (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).
6464
*/
6565
@Generated
6666
private final String commandLine;
@@ -176,7 +176,7 @@ public BatchJobPreparationTask setId(String id) {
176176
* to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c
177177
* MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use
178178
* a relative path (relative to the Task working directory), or use the Batch provided environment variable
179-
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
179+
* (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).
180180
*
181181
* @return the commandLine value.
182182
*/

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobReleaseTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class BatchJobReleaseTask implements JsonSerializable<BatchJobRelea
5252
* features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or
5353
* "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use a relative path
5454
* (relative to the Task working directory), or use the Batch provided environment variable
55-
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
55+
* (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).
5656
*/
5757
@Generated
5858
private final String commandLine;
@@ -155,7 +155,7 @@ public BatchJobReleaseTask setId(String id) {
155155
* to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c
156156
* MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths, it should use
157157
* a relative path (relative to the Task working directory), or use the Batch provided environment variable
158-
* (https://docs.microsoft.com/azure/batch/batch-compute-node-environment-variables).
158+
* (https://learn.microsoft.com/azure/batch/batch-compute-node-environment-variables).
159159
*
160160
* @return the commandLine value.
161161
*/

sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/models/BatchJobScheduleStatistics.java

Lines changed: 17 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.time.Duration;
1515
import java.time.OffsetDateTime;
1616
import java.time.format.DateTimeFormatter;
17+
import java.util.Objects;
1718

1819
/**
1920
* Resource usage statistics for a Job Schedule.
@@ -326,13 +327,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
326327
jsonWriter.writeStringField("userCPUTime", CoreUtils.durationToStringWithDays(this.userCpuTime));
327328
jsonWriter.writeStringField("kernelCPUTime", CoreUtils.durationToStringWithDays(this.kernelCpuTime));
328329
jsonWriter.writeStringField("wallClockTime", CoreUtils.durationToStringWithDays(this.wallClockTime));
329-
jsonWriter.writeLongField("readIOps", this.readIOps);
330-
jsonWriter.writeLongField("writeIOps", this.writeIOps);
330+
jsonWriter.writeStringField("readIOps", Objects.toString(this.readIOps, null));
331+
jsonWriter.writeStringField("writeIOps", Objects.toString(this.writeIOps, null));
331332
jsonWriter.writeDoubleField("readIOGiB", this.readIOGiB);
332333
jsonWriter.writeDoubleField("writeIOGiB", this.writeIOGiB);
333-
jsonWriter.writeLongField("numSucceededTasks", this.numSucceededTasks);
334-
jsonWriter.writeLongField("numFailedTasks", this.numFailedTasks);
335-
jsonWriter.writeLongField("numTaskRetries", this.numTaskRetries);
334+
jsonWriter.writeStringField("numSucceededTasks", Objects.toString(this.numSucceededTasks, null));
335+
jsonWriter.writeStringField("numFailedTasks", Objects.toString(this.numFailedTasks, null));
336+
jsonWriter.writeStringField("numTaskRetries", Objects.toString(this.numTaskRetries, null));
336337
jsonWriter.writeStringField("waitTime", CoreUtils.durationToStringWithDays(this.waitTime));
337338
return jsonWriter.writeEndObject();
338339
}
@@ -346,22 +347,22 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
346347
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
347348
* @throws IOException If an error occurs while reading the BatchJobScheduleStatistics.
348349
*/
350+
@Generated
349351
public static BatchJobScheduleStatistics fromJson(JsonReader jsonReader) throws IOException {
350-
// TODO: Re-add @Generated tag here and re-generate SDK once the 2024-05-01 Batch Service API is released
351352
return jsonReader.readObject(reader -> {
352353
String url = null;
353354
OffsetDateTime startTime = null;
354355
OffsetDateTime lastUpdateTime = null;
355356
Duration userCpuTime = null;
356357
Duration kernelCpuTime = null;
357358
Duration wallClockTime = null;
358-
long readIOps = 0L;
359-
long writeIOps = 0L;
359+
long readIOps = Long.parseLong("0");
360+
long writeIOps = Long.parseLong("0");
360361
double readIOGiB = 0.0;
361362
double writeIOGiB = 0.0;
362-
long numSucceededTasks = 0L;
363-
long numFailedTasks = 0L;
364-
long numTaskRetries = 0L;
363+
long numSucceededTasks = Long.parseLong("0");
364+
long numFailedTasks = Long.parseLong("0");
365+
long numTaskRetries = Long.parseLong("0");
365366
Duration waitTime = null;
366367
while (reader.nextToken() != JsonToken.END_OBJECT) {
367368
String fieldName = reader.getFieldName();
@@ -381,78 +382,19 @@ public static BatchJobScheduleStatistics fromJson(JsonReader jsonReader) throws
381382
} else if ("wallClockTime".equals(fieldName)) {
382383
wallClockTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
383384
} else if ("readIOps".equals(fieldName)) {
384-
if (reader.currentToken() == JsonToken.STRING) {
385-
String readIOpsStr = reader.getString();
386-
try {
387-
readIOps = Long.parseLong(readIOpsStr);
388-
} catch (NumberFormatException e) {
389-
throw new IOException("Expected numeric readIOps, but found: " + readIOpsStr, e);
390-
}
391-
} else if (reader.currentToken() == JsonToken.NUMBER) {
392-
readIOps = reader.getLong();
393-
} else {
394-
throw new IOException("Expected readIOps to be a number or string, but found other type");
395-
}
385+
readIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString()));
396386
} else if ("writeIOps".equals(fieldName)) {
397-
if (reader.currentToken() == JsonToken.STRING) {
398-
String writeIOpsStr = reader.getString();
399-
try {
400-
writeIOps = Long.parseLong(writeIOpsStr);
401-
} catch (NumberFormatException e) {
402-
throw new IOException("Expected numeric writeIOps, but found: " + writeIOpsStr, e);
403-
}
404-
} else if (reader.currentToken() == JsonToken.NUMBER) {
405-
writeIOps = reader.getLong();
406-
} else {
407-
throw new IOException("Expected writeIOps to be a number or string, but found other type");
408-
}
387+
writeIOps = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString()));
409388
} else if ("readIOGiB".equals(fieldName)) {
410389
readIOGiB = reader.getDouble();
411390
} else if ("writeIOGiB".equals(fieldName)) {
412391
writeIOGiB = reader.getDouble();
413392
} else if ("numSucceededTasks".equals(fieldName)) {
414-
if (reader.currentToken() == JsonToken.STRING) {
415-
String numSucceededTasksStr = reader.getString();
416-
try {
417-
numSucceededTasks = Long.parseLong(numSucceededTasksStr);
418-
} catch (NumberFormatException e) {
419-
throw new IOException(
420-
"Expected numeric numSucceededTasks, but found: " + numSucceededTasksStr, e);
421-
}
422-
} else if (reader.currentToken() == JsonToken.NUMBER) {
423-
numSucceededTasks = reader.getLong();
424-
} else {
425-
throw new IOException(
426-
"Expected numSucceededTasks to be a number or string, but found other type");
427-
}
393+
numSucceededTasks = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString()));
428394
} else if ("numFailedTasks".equals(fieldName)) {
429-
if (reader.currentToken() == JsonToken.STRING) {
430-
String numFailedTasksStr = reader.getString();
431-
try {
432-
numFailedTasks = Long.parseLong(numFailedTasksStr);
433-
} catch (NumberFormatException e) {
434-
throw new IOException("Expected numeric numFailedTasks, but found: " + numFailedTasksStr,
435-
e);
436-
}
437-
} else if (reader.currentToken() == JsonToken.NUMBER) {
438-
numFailedTasks = reader.getLong();
439-
} else {
440-
throw new IOException("Expected numFailedTasks to be a number or string, but found other type");
441-
}
395+
numFailedTasks = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString()));
442396
} else if ("numTaskRetries".equals(fieldName)) {
443-
if (reader.currentToken() == JsonToken.STRING) {
444-
String numTaskRetriesStr = reader.getString();
445-
try {
446-
numTaskRetries = Long.parseLong(numTaskRetriesStr);
447-
} catch (NumberFormatException e) {
448-
throw new IOException("Expected numeric numTaskRetries, but found: " + numTaskRetriesStr,
449-
e);
450-
}
451-
} else if (reader.currentToken() == JsonToken.NUMBER) {
452-
numTaskRetries = reader.getLong();
453-
} else {
454-
throw new IOException("Expected numTaskRetries to be a number or string, but found other type");
455-
}
397+
numTaskRetries = reader.getNullable(nonNullReader -> Long.parseLong(nonNullReader.getString()));
456398
} else if ("waitTime".equals(fieldName)) {
457399
waitTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
458400
} else {

0 commit comments

Comments
 (0)