Skip to content

Commit c989d40

Browse files
authored
[Automation] Generate SDK based on TypeSpec 0.25.0 (Azure#42938)
1 parent 4c42252 commit c989d40

File tree

21 files changed

+72
-45
lines changed

21 files changed

+72
-45
lines changed

eng/emitter-package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/emitter-package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-tools/typespec-java": "0.24.0"
4+
"@azure-tools/typespec-java": "0.25.0"
55
},
66
"devDependencies": {
77
"@azure-tools/typespec-autorest": "0.48.0",
88
"@azure-tools/typespec-azure-core": "0.48.0",
99
"@azure-tools/typespec-azure-resource-manager": "0.48.0",
1010
"@azure-tools/typespec-azure-rulesets": "0.48.0",
11-
"@azure-tools/typespec-client-generator-core": "0.48.0",
11+
"@azure-tools/typespec-client-generator-core": "0.48.1",
1212
"@typespec/compiler": "0.62.0",
1313
"@typespec/http": "0.62.0",
1414
"@typespec/openapi": "0.62.0",

sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/CompleteRequest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,16 +521,19 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
521521
jsonWriter.writeArrayField("stop", this.stop, (writer, element) -> writer.writeString(element));
522522
jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element));
523523
if (this.toolChoice != null) {
524-
jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class));
524+
jsonWriter.writeFieldName("tool_choice");
525+
this.toolChoice.writeTo(jsonWriter);
525526
}
526527
jsonWriter.writeNumberField("seed", this.seed);
527528
jsonWriter.writeStringField("model", this.model);
528529
if (additionalProperties != null) {
529530
for (Map.Entry<String, BinaryData> additionalProperty : additionalProperties.entrySet()) {
530-
jsonWriter.writeUntypedField(additionalProperty.getKey(),
531-
additionalProperty.getValue() == null
532-
? null
533-
: additionalProperty.getValue().toObject(Object.class));
531+
jsonWriter.writeFieldName(additionalProperty.getKey());
532+
if (additionalProperty.getValue() == null) {
533+
jsonWriter.writeNull();
534+
} else {
535+
additionalProperty.getValue().writeTo(jsonWriter);
536+
}
534537
}
535538
}
536539
return jsonWriter.writeEndObject();

sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/EmbedRequest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
217217
jsonWriter.writeStringField("model", this.model);
218218
if (additionalProperties != null) {
219219
for (Map.Entry<String, BinaryData> additionalProperty : additionalProperties.entrySet()) {
220-
jsonWriter.writeUntypedField(additionalProperty.getKey(),
221-
additionalProperty.getValue() == null
222-
? null
223-
: additionalProperty.getValue().toObject(Object.class));
220+
jsonWriter.writeFieldName(additionalProperty.getKey());
221+
if (additionalProperty.getValue() == null) {
222+
jsonWriter.writeNull();
223+
} else {
224+
additionalProperty.getValue().writeTo(jsonWriter);
225+
}
224226
}
225227
}
226228
return jsonWriter.writeEndObject();

sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/implementation/models/ImageEmbedRequest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
222222
jsonWriter.writeStringField("model", this.model);
223223
if (additionalProperties != null) {
224224
for (Map.Entry<String, BinaryData> additionalProperty : additionalProperties.entrySet()) {
225-
jsonWriter.writeUntypedField(additionalProperty.getKey(),
226-
additionalProperty.getValue() == null
227-
? null
228-
: additionalProperty.getValue().toObject(Object.class));
225+
jsonWriter.writeFieldName(additionalProperty.getKey());
226+
if (additionalProperty.getValue() == null) {
227+
jsonWriter.writeNull();
228+
} else {
229+
additionalProperty.getValue().writeTo(jsonWriter);
230+
}
229231
}
230232
}
231233
return jsonWriter.writeEndObject();

sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/ChatRequestUserMessage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public BinaryData getContent() {
7979
@Override
8080
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
8181
jsonWriter.writeStartObject();
82-
jsonWriter.writeUntypedField("content", this.content.toObject(Object.class));
82+
jsonWriter.writeFieldName("content");
83+
this.content.writeTo(jsonWriter);
8384
jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString());
8485
return jsonWriter.writeEndObject();
8586
}

sdk/ai/azure-ai-inference/src/main/java/com/azure/ai/inference/models/EmbeddingItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ public int getIndex() {
8484
@Override
8585
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
8686
jsonWriter.writeStartObject();
87-
jsonWriter.writeUntypedField("embedding", this.embedding.toObject(Object.class));
87+
jsonWriter.writeFieldName("embedding");
88+
this.embedding.writeTo(jsonWriter);
8889
jsonWriter.writeIntField("index", this.index);
8990
return jsonWriter.writeEndObject();
9091
}

sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/models/channels/WhatsAppMessageTemplateItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
7676
jsonWriter.writeStringField("status", getStatus() == null ? null : getStatus().toString());
7777
jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
7878
if (this.content != null) {
79-
jsonWriter.writeUntypedField("content", this.content.toObject(Object.class));
79+
jsonWriter.writeFieldName("content");
80+
this.content.writeTo(jsonWriter);
8081
}
8182
return jsonWriter.writeEndObject();
8283
}

sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/models/InnerError.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
6767
jsonWriter.writeStartObject();
6868
jsonWriter.writeStringField("code", this.code);
6969
if (this.value != null) {
70-
jsonWriter.writeUntypedField("value", this.value.toObject(Object.class));
70+
jsonWriter.writeFieldName("value");
71+
this.value.writeTo(jsonWriter);
7172
}
7273
return jsonWriter.writeEndObject();
7374
}

sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
123123
jsonWriter.writeJsonField("verifyResult", this.verifyResult);
124124
if (additionalProperties != null) {
125125
for (Map.Entry<String, BinaryData> additionalProperty : additionalProperties.entrySet()) {
126-
jsonWriter.writeUntypedField(additionalProperty.getKey(),
127-
additionalProperty.getValue() == null
128-
? null
129-
: additionalProperty.getValue().toObject(Object.class));
126+
jsonWriter.writeFieldName(additionalProperty.getKey());
127+
if (additionalProperty.getValue() == null) {
128+
jsonWriter.writeNull();
129+
} else {
130+
additionalProperty.getValue().writeTo(jsonWriter);
131+
}
130132
}
131133
}
132134
return jsonWriter.writeEndObject();

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/Assistant.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
191191
jsonWriter.writeNumberField("top_p", this.topP);
192192
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
193193
if (this.responseFormat != null) {
194-
jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class));
194+
jsonWriter.writeFieldName("response_format");
195+
this.responseFormat.writeTo(jsonWriter);
195196
}
196197
return jsonWriter.writeEndObject();
197198
}

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/AssistantCreationOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
347347
jsonWriter.writeNumberField("temperature", this.temperature);
348348
jsonWriter.writeNumberField("top_p", this.topP);
349349
if (this.responseFormat != null) {
350-
jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class));
350+
jsonWriter.writeFieldName("response_format");
351+
this.responseFormat.writeTo(jsonWriter);
351352
}
352353
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
353354
return jsonWriter.writeEndObject();

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateAndRunThreadOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
214214
jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens);
215215
jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy);
216216
if (this.toolChoice != null) {
217-
jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class));
217+
jsonWriter.writeFieldName("tool_choice");
218+
this.toolChoice.writeTo(jsonWriter);
218219
}
219220
if (this.responseFormat != null) {
220-
jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class));
221+
jsonWriter.writeFieldName("response_format");
222+
this.responseFormat.writeTo(jsonWriter);
221223
}
222224
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
223225
return jsonWriter.writeEndObject();

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateRunOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
221221
jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens);
222222
jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy);
223223
if (this.toolChoice != null) {
224-
jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class));
224+
jsonWriter.writeFieldName("tool_choice");
225+
this.toolChoice.writeTo(jsonWriter);
225226
}
226227
if (this.responseFormat != null) {
227-
jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class));
228+
jsonWriter.writeFieldName("response_format");
229+
this.responseFormat.writeTo(jsonWriter);
228230
}
229231
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
230232
return jsonWriter.writeEndObject();

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/CreateToolResourcesOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
101101
jsonWriter.writeStartObject();
102102
jsonWriter.writeJsonField("code_interpreter", this.codeInterpreter);
103103
if (this.fileSearch != null) {
104-
jsonWriter.writeUntypedField("file_search", this.fileSearch.toObject(Object.class));
104+
jsonWriter.writeFieldName("file_search");
105+
this.fileSearch.writeTo(jsonWriter);
105106
}
106107
return jsonWriter.writeEndObject();
107108
}

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/ThreadRun.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
342342
jsonWriter.writeNumberField("max_prompt_tokens", this.maxPromptTokens);
343343
jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens);
344344
jsonWriter.writeJsonField("truncation_strategy", this.truncationStrategy);
345-
jsonWriter.writeUntypedField("tool_choice", this.toolChoice.toObject(Object.class));
346-
jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class));
345+
jsonWriter.writeFieldName("tool_choice");
346+
this.toolChoice.writeTo(jsonWriter);
347+
jsonWriter.writeFieldName("response_format");
348+
this.responseFormat.writeTo(jsonWriter);
347349
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
348350
jsonWriter.writeJsonField("required_action", this.requiredAction);
349351
jsonWriter.writeNumberField("temperature", this.temperature);

sdk/openai/azure-ai-openai-assistants/src/main/java/com/azure/ai/openai/assistants/models/UpdateAssistantOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
217217
jsonWriter.writeNumberField("temperature", this.temperature);
218218
jsonWriter.writeNumberField("top_p", this.topP);
219219
if (this.responseFormat != null) {
220-
jsonWriter.writeUntypedField("response_format", this.responseFormat.toObject(Object.class));
220+
jsonWriter.writeFieldName("response_format");
221+
this.responseFormat.writeTo(jsonWriter);
221222
}
222223
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
223224
return jsonWriter.writeEndObject();

sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionParameters.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
341341
jsonWriter.writeStringField("app_name", this.appName);
342342
jsonWriter.writeStringField("index_name", this.indexName);
343343
jsonWriter.writeJsonField("fields_mapping", this.fieldsMapping);
344-
jsonWriter.writeUntypedField("embedding_dependency", this.embeddingDependency.toObject(Object.class));
344+
jsonWriter.writeFieldName("embedding_dependency");
345+
this.embeddingDependency.writeTo(jsonWriter);
345346
jsonWriter.writeNumberField("top_n_documents", this.topNDocuments);
346347
jsonWriter.writeBooleanField("in_scope", this.inScope);
347348
jsonWriter.writeNumberField("strictness", this.strictness);

sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/models/AutoCompleteOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
125125
jsonWriter.writeStringField("keywords", this.keywords);
126126
jsonWriter.writeNumberField("limit", this.limit);
127127
if (this.filter != null) {
128-
jsonWriter.writeUntypedField("filter", this.filter.toObject(Object.class));
128+
jsonWriter.writeFieldName("filter");
129+
this.filter.writeTo(jsonWriter);
129130
}
130131
return jsonWriter.writeEndObject();
131132
}

sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/models/QueryOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
241241
jsonWriter.writeArrayField("orderby", this.orderby,
242242
(writer, element) -> writer.writeUntyped(element == null ? null : element.toObject(Object.class)));
243243
if (this.filter != null) {
244-
jsonWriter.writeUntypedField("filter", this.filter.toObject(Object.class));
244+
jsonWriter.writeFieldName("filter");
245+
this.filter.writeTo(jsonWriter);
245246
}
246247
jsonWriter.writeArrayField("facets", this.facets, (writer, element) -> writer.writeJson(element));
247248
jsonWriter.writeJsonField("taxonomySetting", this.taxonomySetting);

sdk/purview/azure-analytics-purview-datamap/src/main/java/com/azure/analytics/purview/datamap/models/SuggestOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
131131
jsonWriter.writeStringField("keywords", this.keywords);
132132
jsonWriter.writeNumberField("limit", this.limit);
133133
if (this.filter != null) {
134-
jsonWriter.writeUntypedField("filter", this.filter.toObject(Object.class));
134+
jsonWriter.writeFieldName("filter");
135+
this.filter.writeTo(jsonWriter);
135136
}
136137
return jsonWriter.writeEndObject();
137138
}

0 commit comments

Comments
 (0)