Skip to content

Commit f8889ab

Browse files
chore(internal): codegen related update
1 parent 520f7a8 commit f8889ab

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

src/Swarms/Models/Agent/AgentSpec.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Diagnostics.CodeAnalysis;
43
using System.Text.Json;
@@ -18,7 +17,7 @@ public required string? AgentName
1817
get
1918
{
2019
if (!this.Properties.TryGetValue("agent_name", out JsonElement element))
21-
throw new ArgumentOutOfRangeException("agent_name", "Missing required argument");
20+
return null;
2221

2322
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
2423
}

src/Swarms/Models/Client/Rate/RateGetLimitsResponse.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Diagnostics.CodeAnalysis;
43
using System.Text.Json;
@@ -18,7 +17,7 @@ public required Limits? Limits
1817
get
1918
{
2019
if (!this.Properties.TryGetValue("limits", out JsonElement element))
21-
throw new ArgumentOutOfRangeException("limits", "Missing required argument");
20+
return null;
2221

2322
return JsonSerializer.Deserialize<Limits?>(element, ModelBase.SerializerOptions);
2423
}
@@ -33,7 +32,7 @@ public required RateLimits? RateLimits
3332
get
3433
{
3534
if (!this.Properties.TryGetValue("rate_limits", out JsonElement element))
36-
throw new ArgumentOutOfRangeException("rate_limits", "Missing required argument");
35+
return null;
3736

3837
return JsonSerializer.Deserialize<RateLimits?>(element, ModelBase.SerializerOptions);
3938
}
@@ -48,7 +47,7 @@ public required string? Tier
4847
get
4948
{
5049
if (!this.Properties.TryGetValue("tier", out JsonElement element))
51-
throw new ArgumentOutOfRangeException("tier", "Missing required argument");
50+
return null;
5251

5352
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
5453
}
@@ -63,7 +62,7 @@ public required string? Timestamp
6362
get
6463
{
6564
if (!this.Properties.TryGetValue("timestamp", out JsonElement element))
66-
throw new ArgumentOutOfRangeException("timestamp", "Missing required argument");
65+
return null;
6766

6867
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
6968
}

src/Swarms/Models/Swarms/SwarmRunResponse.cs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public required string? Description
1717
get
1818
{
1919
if (!this.Properties.TryGetValue("description", out JsonElement element))
20-
throw new ArgumentOutOfRangeException("description", "Missing required argument");
20+
return null;
2121

2222
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
2323
}
@@ -32,10 +32,7 @@ public required double? ExecutionTime
3232
get
3333
{
3434
if (!this.Properties.TryGetValue("execution_time", out JsonElement element))
35-
throw new ArgumentOutOfRangeException(
36-
"execution_time",
37-
"Missing required argument"
38-
);
35+
return null;
3936

4037
return JsonSerializer.Deserialize<double?>(element, ModelBase.SerializerOptions);
4138
}
@@ -50,7 +47,7 @@ public required string? JobID
5047
get
5148
{
5249
if (!this.Properties.TryGetValue("job_id", out JsonElement element))
53-
throw new ArgumentOutOfRangeException("job_id", "Missing required argument");
50+
return null;
5451

5552
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
5653
}
@@ -65,10 +62,7 @@ public required long? NumberOfAgents
6562
get
6663
{
6764
if (!this.Properties.TryGetValue("number_of_agents", out JsonElement element))
68-
throw new ArgumentOutOfRangeException(
69-
"number_of_agents",
70-
"Missing required argument"
71-
);
65+
return null;
7266

7367
return JsonSerializer.Deserialize<long?>(element, ModelBase.SerializerOptions);
7468
}
@@ -98,7 +92,7 @@ public required string? ServiceTier
9892
get
9993
{
10094
if (!this.Properties.TryGetValue("service_tier", out JsonElement element))
101-
throw new ArgumentOutOfRangeException("service_tier", "Missing required argument");
95+
return null;
10296

10397
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
10498
}
@@ -113,7 +107,7 @@ public required string? Status
113107
get
114108
{
115109
if (!this.Properties.TryGetValue("status", out JsonElement element))
116-
throw new ArgumentOutOfRangeException("status", "Missing required argument");
110+
return null;
117111

118112
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
119113
}
@@ -128,7 +122,7 @@ public required string? SwarmName
128122
get
129123
{
130124
if (!this.Properties.TryGetValue("swarm_name", out JsonElement element))
131-
throw new ArgumentOutOfRangeException("swarm_name", "Missing required argument");
125+
return null;
132126

133127
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
134128
}
@@ -143,7 +137,7 @@ public required string? SwarmType
143137
get
144138
{
145139
if (!this.Properties.TryGetValue("swarm_type", out JsonElement element))
146-
throw new ArgumentOutOfRangeException("swarm_type", "Missing required argument");
140+
return null;
147141

148142
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
149143
}
@@ -158,7 +152,7 @@ public required Dictionary<string, JsonElement>? Usage
158152
get
159153
{
160154
if (!this.Properties.TryGetValue("usage", out JsonElement element))
161-
throw new ArgumentOutOfRangeException("usage", "Missing required argument");
155+
return null;
162156

163157
return JsonSerializer.Deserialize<Dictionary<string, JsonElement>?>(
164158
element,

0 commit comments

Comments
 (0)