Skip to content

Commit

Permalink
[Automation] Generate SDK based on TypeSpec 0.16.1 (Azure#40378)
Browse files Browse the repository at this point in the history
* [Automation] Generate SDK based on TypeSpec 0.16.1

* add @azure-tools/typespec-azure-rulesets
  • Loading branch information
azure-sdk authored May 29, 2024
1 parent dc27c31 commit d950c6d
Show file tree
Hide file tree
Showing 143 changed files with 565 additions and 704 deletions.
170 changes: 47 additions & 123 deletions eng/emitter-package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion eng/emitter-package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"main": "dist/src/index.js",
"dependencies": {
"@azure-tools/typespec-java": "0.16.0"
"@azure-tools/typespec-java": "0.16.1"
},
"devDependencies": {
"@azure-tools/typespec-azure-core": "0.42.0",
"@azure-tools/typespec-azure-resource-manager": "0.42.1",
"@azure-tools/typespec-client-generator-core": "0.42.3",
"@azure-tools/typespec-azure-rulesets": "0.42.1",
"@typespec/compiler": "0.56.0",
"@typespec/http": "0.56.0",
"@typespec/openapi": "0.56.0",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -114,7 +115,8 @@ public static AutoScaleRun fromJson(JsonReader jsonReader) throws IOException {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("timestamp".equals(fieldName)) {
timestamp = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
timestamp = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("results".equals(fieldName)) {
results = reader.getString();
} else if ("error".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -649,19 +650,21 @@ public static BatchJob fromJson(JsonReader jsonReader) throws IOException {
} else if ("eTag".equals(fieldName)) {
eTag = reader.getString();
} else if ("lastModified".equals(fieldName)) {
lastModified = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
lastModified = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("creationTime".equals(fieldName)) {
creationTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
creationTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("state".equals(fieldName)) {
state = BatchJobState.fromString(reader.getString());
} else if ("stateTransitionTime".equals(fieldName)) {
stateTransitionTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
stateTransitionTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("previousState".equals(fieldName)) {
previousState = BatchJobState.fromString(reader.getString());
} else if ("previousStateTransitionTime".equals(fieldName)) {
previousStateTransitionTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
previousStateTransitionTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("priority".equals(fieldName)) {
priority = reader.getNullable(JsonReader::getInt);
} else if ("allowTaskPreemption".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -172,9 +173,11 @@ public static BatchJobExecutionInfo fromJson(JsonReader jsonReader) throws IOExc
String fieldName = reader.getFieldName();
reader.nextToken();
if ("startTime".equals(fieldName)) {
startTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("endTime".equals(fieldName)) {
endTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("poolId".equals(fieldName)) {
poolId = reader.getString();
} else if ("schedulingError".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -300,13 +301,15 @@ public static BatchJobPreparationTaskExecutionInfo fromJson(JsonReader jsonReade
String fieldName = reader.getFieldName();
reader.nextToken();
if ("startTime".equals(fieldName)) {
startTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("state".equals(fieldName)) {
state = BatchJobPreparationTaskState.fromString(reader.getString());
} else if ("retryCount".equals(fieldName)) {
retryCount = reader.getInt();
} else if ("endTime".equals(fieldName)) {
endTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("taskRootDirectory".equals(fieldName)) {
taskRootDirectory = reader.getString();
} else if ("taskRootDirectoryUrl".equals(fieldName)) {
Expand All @@ -318,8 +321,8 @@ public static BatchJobPreparationTaskExecutionInfo fromJson(JsonReader jsonReade
} else if ("failureInfo".equals(fieldName)) {
failureInfo = BatchTaskFailureInfo.fromJson(reader);
} else if ("lastRetryTime".equals(fieldName)) {
lastRetryTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
lastRetryTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("result".equals(fieldName)) {
result = BatchTaskExecutionResult.fromString(reader.getString());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -242,11 +243,13 @@ public static BatchJobReleaseTaskExecutionInfo fromJson(JsonReader jsonReader) t
String fieldName = reader.getFieldName();
reader.nextToken();
if ("startTime".equals(fieldName)) {
startTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("state".equals(fieldName)) {
state = BatchJobReleaseTaskState.fromString(reader.getString());
} else if ("endTime".equals(fieldName)) {
endTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("taskRootDirectory".equals(fieldName)) {
taskRootDirectory = reader.getString();
} else if ("taskRootDirectoryUrl".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -370,19 +371,21 @@ public static BatchJobSchedule fromJson(JsonReader jsonReader) throws IOExceptio
} else if ("eTag".equals(fieldName)) {
eTag = reader.getString();
} else if ("lastModified".equals(fieldName)) {
lastModified = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
lastModified = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("creationTime".equals(fieldName)) {
creationTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
creationTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("state".equals(fieldName)) {
state = BatchJobScheduleState.fromString(reader.getString());
} else if ("stateTransitionTime".equals(fieldName)) {
stateTransitionTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
stateTransitionTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("previousState".equals(fieldName)) {
previousState = BatchJobScheduleState.fromString(reader.getString());
} else if ("previousStateTransitionTime".equals(fieldName)) {
previousStateTransitionTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
previousStateTransitionTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("schedule".equals(fieldName)) {
schedule = BatchJobScheduleConfiguration.fromJson(reader);
} else if ("executionInfo".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ public static BatchJobScheduleConfiguration fromJson(JsonReader jsonReader) thro
String fieldName = reader.getFieldName();
reader.nextToken();
if ("doNotRunUntil".equals(fieldName)) {
deserializedBatchJobScheduleConfiguration.doNotRunUntil
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchJobScheduleConfiguration.doNotRunUntil = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("doNotRunAfter".equals(fieldName)) {
deserializedBatchJobScheduleConfiguration.doNotRunAfter
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchJobScheduleConfiguration.doNotRunAfter = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("startWindow".equals(fieldName)) {
deserializedBatchJobScheduleConfiguration.startWindow
= reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -114,13 +115,13 @@ public static BatchJobScheduleExecutionInfo fromJson(JsonReader jsonReader) thro
String fieldName = reader.getFieldName();
reader.nextToken();
if ("nextRunTime".equals(fieldName)) {
deserializedBatchJobScheduleExecutionInfo.nextRunTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchJobScheduleExecutionInfo.nextRunTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("recentJob".equals(fieldName)) {
deserializedBatchJobScheduleExecutionInfo.recentJob = RecentBatchJob.fromJson(reader);
} else if ("endTime".equals(fieldName)) {
deserializedBatchJobScheduleExecutionInfo.endTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchJobScheduleExecutionInfo.endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else {
reader.skipChildren();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,11 @@ public static BatchJobScheduleStatistics fromJson(JsonReader jsonReader) throws
if ("url".equals(fieldName)) {
url = reader.getString();
} else if ("startTime".equals(fieldName)) {
startTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastUpdateTime".equals(fieldName)) {
lastUpdateTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
lastUpdateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("userCPUTime".equals(fieldName)) {
userCpuTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
} else if ("kernelCPUTime".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,11 @@ public static BatchJobStatistics fromJson(JsonReader jsonReader) throws IOExcept
if ("url".equals(fieldName)) {
url = reader.getString();
} else if ("startTime".equals(fieldName)) {
startTime = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastUpdateTime".equals(fieldName)) {
lastUpdateTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
lastUpdateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("userCPUTime".equals(fieldName)) {
userCpuTime = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString()));
} else if ("kernelCPUTime".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -483,14 +484,14 @@ public static BatchNode fromJson(JsonReader jsonReader) throws IOException {
} else if ("schedulingState".equals(fieldName)) {
deserializedBatchNode.schedulingState = SchedulingState.fromString(reader.getString());
} else if ("stateTransitionTime".equals(fieldName)) {
deserializedBatchNode.stateTransitionTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchNode.stateTransitionTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastBootTime".equals(fieldName)) {
deserializedBatchNode.lastBootTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchNode.lastBootTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("allocationTime".equals(fieldName)) {
deserializedBatchNode.allocationTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedBatchNode.allocationTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("ipAddress".equals(fieldName)) {
deserializedBatchNode.ipAddress = reader.getString();
} else if ("affinityId".equals(fieldName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -103,8 +104,8 @@ public static BatchNodeAgentInfo fromJson(JsonReader jsonReader) throws IOExcept
if ("version".equals(fieldName)) {
version = reader.getString();
} else if ("lastUpdateTime".equals(fieldName)) {
lastUpdateTime
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
lastUpdateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else {
reader.skipChildren();
}
Expand Down
Loading

0 comments on commit d950c6d

Please sign in to comment.