Skip to content

Commit 0cde951

Browse files
committed
Codgen from the feedback branch
1 parent 9c3286e commit 0cde951

4 files changed

Lines changed: 207 additions & 8 deletions

File tree

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
package com.azure.ai.agents.models;
5+
6+
import com.azure.core.annotation.Fluent;
7+
import com.azure.core.annotation.Generated;
8+
import com.azure.json.JsonReader;
9+
import com.azure.json.JsonSerializable;
10+
import com.azure.json.JsonToken;
11+
import com.azure.json.JsonWriter;
12+
import java.io.IOException;
13+
import java.util.Map;
14+
15+
/**
16+
* The CreateAgentVersionInput model.
17+
*/
18+
@Fluent
19+
public final class CreateAgentVersionInput implements JsonSerializable<CreateAgentVersionInput> {
20+
21+
/*
22+
* Set of 16 key-value pairs that can be attached to an object. This can be
23+
* useful for storing additional information about the object in a structured
24+
* format, and querying for objects via API or the dashboard.
25+
*
26+
* Keys are strings with a maximum length of 64 characters. Values are strings
27+
* with a maximum length of 512 characters.
28+
*/
29+
@Generated
30+
private Map<String, String> metadata;
31+
32+
/*
33+
* A human-readable description of the agent.
34+
*/
35+
@Generated
36+
private String description;
37+
38+
/*
39+
* The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
40+
*/
41+
@Generated
42+
private final AgentDefinition definition;
43+
44+
/*
45+
* The blueprint reference for the agent.
46+
*/
47+
@Generated
48+
private AgentBlueprintReference blueprintReference;
49+
50+
/**
51+
* Creates an instance of CreateAgentVersionInput class.
52+
*
53+
* @param definition the definition value to set.
54+
*/
55+
@Generated
56+
public CreateAgentVersionInput(AgentDefinition definition) {
57+
this.definition = definition;
58+
}
59+
60+
/**
61+
* Get the metadata property: Set of 16 key-value pairs that can be attached to an object. This can be
62+
* useful for storing additional information about the object in a structured
63+
* format, and querying for objects via API or the dashboard.
64+
*
65+
* Keys are strings with a maximum length of 64 characters. Values are strings
66+
* with a maximum length of 512 characters.
67+
*
68+
* @return the metadata value.
69+
*/
70+
@Generated
71+
public Map<String, String> getMetadata() {
72+
return this.metadata;
73+
}
74+
75+
/**
76+
* Set the metadata property: Set of 16 key-value pairs that can be attached to an object. This can be
77+
* useful for storing additional information about the object in a structured
78+
* format, and querying for objects via API or the dashboard.
79+
*
80+
* Keys are strings with a maximum length of 64 characters. Values are strings
81+
* with a maximum length of 512 characters.
82+
*
83+
* @param metadata the metadata value to set.
84+
* @return the CreateAgentVersionInput object itself.
85+
*/
86+
@Generated
87+
public CreateAgentVersionInput setMetadata(Map<String, String> metadata) {
88+
this.metadata = metadata;
89+
return this;
90+
}
91+
92+
/**
93+
* Get the description property: A human-readable description of the agent.
94+
*
95+
* @return the description value.
96+
*/
97+
@Generated
98+
public String getDescription() {
99+
return this.description;
100+
}
101+
102+
/**
103+
* Set the description property: A human-readable description of the agent.
104+
*
105+
* @param description the description value to set.
106+
* @return the CreateAgentVersionInput object itself.
107+
*/
108+
@Generated
109+
public CreateAgentVersionInput setDescription(String description) {
110+
this.description = description;
111+
return this;
112+
}
113+
114+
/**
115+
* Get the definition property: The agent definition. This can be a workflow, hosted agent, or a simple agent
116+
* definition.
117+
*
118+
* @return the definition value.
119+
*/
120+
@Generated
121+
public AgentDefinition getDefinition() {
122+
return this.definition;
123+
}
124+
125+
/**
126+
* Get the blueprintReference property: The blueprint reference for the agent.
127+
*
128+
* @return the blueprintReference value.
129+
*/
130+
@Generated
131+
public AgentBlueprintReference getBlueprintReference() {
132+
return this.blueprintReference;
133+
}
134+
135+
/**
136+
* Set the blueprintReference property: The blueprint reference for the agent.
137+
*
138+
* @param blueprintReference the blueprintReference value to set.
139+
* @return the CreateAgentVersionInput object itself.
140+
*/
141+
@Generated
142+
public CreateAgentVersionInput setBlueprintReference(AgentBlueprintReference blueprintReference) {
143+
this.blueprintReference = blueprintReference;
144+
return this;
145+
}
146+
147+
/**
148+
* {@inheritDoc}
149+
*/
150+
@Generated
151+
@Override
152+
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
153+
jsonWriter.writeStartObject();
154+
jsonWriter.writeJsonField("definition", this.definition);
155+
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
156+
jsonWriter.writeStringField("description", this.description);
157+
jsonWriter.writeJsonField("blueprint_reference", this.blueprintReference);
158+
return jsonWriter.writeEndObject();
159+
}
160+
161+
/**
162+
* Reads an instance of CreateAgentVersionInput from the JsonReader.
163+
*
164+
* @param jsonReader The JsonReader being read.
165+
* @return An instance of CreateAgentVersionInput if the JsonReader was pointing to an instance of it, or null if it
166+
* was pointing to JSON null.
167+
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
168+
* @throws IOException If an error occurs while reading the CreateAgentVersionInput.
169+
*/
170+
@Generated
171+
public static CreateAgentVersionInput fromJson(JsonReader jsonReader) throws IOException {
172+
return jsonReader.readObject(reader -> {
173+
AgentDefinition definition = null;
174+
Map<String, String> metadata = null;
175+
String description = null;
176+
AgentBlueprintReference blueprintReference = null;
177+
while (reader.nextToken() != JsonToken.END_OBJECT) {
178+
String fieldName = reader.getFieldName();
179+
reader.nextToken();
180+
if ("definition".equals(fieldName)) {
181+
definition = AgentDefinition.fromJson(reader);
182+
} else if ("metadata".equals(fieldName)) {
183+
metadata = reader.readMap(reader1 -> reader1.getString());
184+
} else if ("description".equals(fieldName)) {
185+
description = reader.getString();
186+
} else if ("blueprint_reference".equals(fieldName)) {
187+
blueprintReference = AgentBlueprintReference.fromJson(reader);
188+
} else {
189+
reader.skipChildren();
190+
}
191+
}
192+
CreateAgentVersionInput deserializedCreateAgentVersionInput = new CreateAgentVersionInput(definition);
193+
deserializedCreateAgentVersionInput.metadata = metadata;
194+
deserializedCreateAgentVersionInput.description = description;
195+
deserializedCreateAgentVersionInput.blueprintReference = blueprintReference;
196+
return deserializedCreateAgentVersionInput;
197+
});
198+
}
199+
}

sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
* Defines values for FoundryFeaturesOptInKeys.
99
*/
1010
public enum FoundryFeaturesOptInKeys {
11-
/**
12-
* Enum value Skills=V1Preview.
13-
*/
14-
SKILLS_V1_PREVIEW("Skills=V1Preview"),
15-
1611
/**
1712
* Enum value Evaluations=V1Preview.
1813
*/
@@ -41,7 +36,12 @@ public enum FoundryFeaturesOptInKeys {
4136
/**
4237
* Enum value Toolboxes=V1Preview.
4338
*/
44-
TOOLBOXES_V1_PREVIEW("Toolboxes=V1Preview");
39+
TOOLBOXES_V1_PREVIEW("Toolboxes=V1Preview"),
40+
41+
/**
42+
* Enum value Skills=V1Preview.
43+
*/
44+
SKILLS_V1_PREVIEW("Skills=V1Preview");
4545

4646
/**
4747
* The actual serialized value for a FoundryFeaturesOptInKeys instance.

sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

sdk/ai/azure-ai-agents/tsp-location.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
directory: specification/ai-foundry/data-plane/Foundry/src/sdk-agents
2-
commit: 6e1d5ea82cba7933b0b0071ca4321cfcb9c900c8
2+
commit: cab7ada4c2fe4dca8d36308f36c693b30422edec
33
repo: Azure/azure-rest-api-specs
44
additionalDirectories:
55
- specification/ai-foundry/data-plane/Foundry/src/agents

0 commit comments

Comments
 (0)