Skip to content

Commit c3e8e0f

Browse files
author
github-actions[bot]
committed
feat: Updated OpenAPI spec
1 parent 7c0b77e commit c3e8e0f

16 files changed

+1478
-126
lines changed
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
2+
#nullable enable
3+
4+
namespace Ultravox
5+
{
6+
public partial class AgentsClient
7+
{
8+
partial void PrepareAgentsRevisionsCreateArguments(
9+
global::System.Net.Http.HttpClient httpClient,
10+
ref global::System.Guid agentId,
11+
global::Ultravox.AgentRevision request);
12+
partial void PrepareAgentsRevisionsCreateRequest(
13+
global::System.Net.Http.HttpClient httpClient,
14+
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
15+
global::System.Guid agentId,
16+
global::Ultravox.AgentRevision request);
17+
partial void ProcessAgentsRevisionsCreateResponse(
18+
global::System.Net.Http.HttpClient httpClient,
19+
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
20+
21+
partial void ProcessAgentsRevisionsCreateResponseContent(
22+
global::System.Net.Http.HttpClient httpClient,
23+
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
24+
ref string content);
25+
26+
/// <summary>
27+
///
28+
/// </summary>
29+
/// <param name="agentId"></param>
30+
/// <param name="request"></param>
31+
/// <param name="cancellationToken">The token to cancel the operation with</param>
32+
/// <exception cref="global::Ultravox.ApiException"></exception>
33+
public async global::System.Threading.Tasks.Task<global::Ultravox.AgentRevision> AgentsRevisionsCreateAsync(
34+
global::System.Guid agentId,
35+
global::Ultravox.AgentRevision request,
36+
global::System.Threading.CancellationToken cancellationToken = default)
37+
{
38+
request = request ?? throw new global::System.ArgumentNullException(nameof(request));
39+
40+
PrepareArguments(
41+
client: HttpClient);
42+
PrepareAgentsRevisionsCreateArguments(
43+
httpClient: HttpClient,
44+
agentId: ref agentId,
45+
request: request);
46+
47+
var __pathBuilder = new global::Ultravox.PathBuilder(
48+
path: $"/api/agents/{agentId}/revisions",
49+
baseUri: HttpClient.BaseAddress);
50+
var __path = __pathBuilder.ToString();
51+
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
52+
method: global::System.Net.Http.HttpMethod.Post,
53+
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
54+
#if NET6_0_OR_GREATER
55+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
56+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
57+
#endif
58+
59+
foreach (var __authorization in Authorizations)
60+
{
61+
if (__authorization.Type == "Http" ||
62+
__authorization.Type == "OAuth2")
63+
{
64+
__httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
65+
scheme: __authorization.Name,
66+
parameter: __authorization.Value);
67+
}
68+
else if (__authorization.Type == "ApiKey" &&
69+
__authorization.Location == "Header")
70+
{
71+
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
72+
}
73+
}
74+
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
75+
var __httpRequestContent = new global::System.Net.Http.StringContent(
76+
content: __httpRequestContentBody,
77+
encoding: global::System.Text.Encoding.UTF8,
78+
mediaType: "application/json");
79+
__httpRequest.Content = __httpRequestContent;
80+
81+
PrepareRequest(
82+
client: HttpClient,
83+
request: __httpRequest);
84+
PrepareAgentsRevisionsCreateRequest(
85+
httpClient: HttpClient,
86+
httpRequestMessage: __httpRequest,
87+
agentId: agentId,
88+
request: request);
89+
90+
using var __response = await HttpClient.SendAsync(
91+
request: __httpRequest,
92+
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
93+
cancellationToken: cancellationToken).ConfigureAwait(false);
94+
95+
ProcessResponse(
96+
client: HttpClient,
97+
response: __response);
98+
ProcessAgentsRevisionsCreateResponse(
99+
httpClient: HttpClient,
100+
httpResponseMessage: __response);
101+
102+
if (ReadResponseAsString)
103+
{
104+
var __content = await __response.Content.ReadAsStringAsync(
105+
#if NET5_0_OR_GREATER
106+
cancellationToken
107+
#endif
108+
).ConfigureAwait(false);
109+
110+
ProcessResponseContent(
111+
client: HttpClient,
112+
response: __response,
113+
content: ref __content);
114+
ProcessAgentsRevisionsCreateResponseContent(
115+
httpClient: HttpClient,
116+
httpResponseMessage: __response,
117+
content: ref __content);
118+
119+
try
120+
{
121+
__response.EnsureSuccessStatusCode();
122+
123+
return
124+
global::Ultravox.AgentRevision.FromJson(__content, JsonSerializerContext) ??
125+
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
126+
}
127+
catch (global::System.Exception __ex)
128+
{
129+
throw new global::Ultravox.ApiException(
130+
message: __content ?? __response.ReasonPhrase ?? string.Empty,
131+
innerException: __ex,
132+
statusCode: __response.StatusCode)
133+
{
134+
ResponseBody = __content,
135+
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
136+
__response.Headers,
137+
h => h.Key,
138+
h => h.Value),
139+
};
140+
}
141+
}
142+
else
143+
{
144+
try
145+
{
146+
__response.EnsureSuccessStatusCode();
147+
148+
using var __content = await __response.Content.ReadAsStreamAsync(
149+
#if NET5_0_OR_GREATER
150+
cancellationToken
151+
#endif
152+
).ConfigureAwait(false);
153+
154+
return
155+
await global::Ultravox.AgentRevision.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
156+
throw new global::System.InvalidOperationException("Response deserialization failed.");
157+
}
158+
catch (global::System.Exception __ex)
159+
{
160+
throw new global::Ultravox.ApiException(
161+
message: __response.ReasonPhrase ?? string.Empty,
162+
innerException: __ex,
163+
statusCode: __response.StatusCode)
164+
{
165+
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
166+
__response.Headers,
167+
h => h.Key,
168+
h => h.Value),
169+
};
170+
}
171+
}
172+
}
173+
174+
/// <summary>
175+
///
176+
/// </summary>
177+
/// <param name="agentId"></param>
178+
/// <param name="callTemplate">
179+
/// A CallTemplate that can be used to create Ultravox calls with shared properties.
180+
/// </param>
181+
/// <param name="cancellationToken">The token to cancel the operation with</param>
182+
/// <exception cref="global::System.InvalidOperationException"></exception>
183+
public async global::System.Threading.Tasks.Task<global::Ultravox.AgentRevision> AgentsRevisionsCreateAsync(
184+
global::System.Guid agentId,
185+
global::Ultravox.UltravoxV1CallTemplate callTemplate,
186+
global::System.Threading.CancellationToken cancellationToken = default)
187+
{
188+
var __request = new global::Ultravox.AgentRevision
189+
{
190+
CallTemplate = callTemplate,
191+
};
192+
193+
return await AgentsRevisionsCreateAsync(
194+
agentId: agentId,
195+
request: __request,
196+
cancellationToken: cancellationToken).ConfigureAwait(false);
197+
}
198+
}
199+
}
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
2+
#nullable enable
3+
4+
namespace Ultravox
5+
{
6+
public partial class AgentsClient
7+
{
8+
partial void PrepareAgentsRevisionsListArguments(
9+
global::System.Net.Http.HttpClient httpClient,
10+
ref global::System.Guid agentId,
11+
ref string? cursor,
12+
ref int? pageSize);
13+
partial void PrepareAgentsRevisionsListRequest(
14+
global::System.Net.Http.HttpClient httpClient,
15+
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
16+
global::System.Guid agentId,
17+
string? cursor,
18+
int? pageSize);
19+
partial void ProcessAgentsRevisionsListResponse(
20+
global::System.Net.Http.HttpClient httpClient,
21+
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
22+
23+
partial void ProcessAgentsRevisionsListResponseContent(
24+
global::System.Net.Http.HttpClient httpClient,
25+
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
26+
ref string content);
27+
28+
/// <summary>
29+
///
30+
/// </summary>
31+
/// <param name="agentId"></param>
32+
/// <param name="cursor"></param>
33+
/// <param name="pageSize"></param>
34+
/// <param name="cancellationToken">The token to cancel the operation with</param>
35+
/// <exception cref="global::Ultravox.ApiException"></exception>
36+
public async global::System.Threading.Tasks.Task<global::Ultravox.PaginatedAgentRevisionList> AgentsRevisionsListAsync(
37+
global::System.Guid agentId,
38+
string? cursor = default,
39+
int? pageSize = default,
40+
global::System.Threading.CancellationToken cancellationToken = default)
41+
{
42+
PrepareArguments(
43+
client: HttpClient);
44+
PrepareAgentsRevisionsListArguments(
45+
httpClient: HttpClient,
46+
agentId: ref agentId,
47+
cursor: ref cursor,
48+
pageSize: ref pageSize);
49+
50+
var __pathBuilder = new global::Ultravox.PathBuilder(
51+
path: $"/api/agents/{agentId}/revisions",
52+
baseUri: HttpClient.BaseAddress);
53+
__pathBuilder
54+
.AddOptionalParameter("cursor", cursor)
55+
.AddOptionalParameter("pageSize", pageSize?.ToString())
56+
;
57+
var __path = __pathBuilder.ToString();
58+
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
59+
method: global::System.Net.Http.HttpMethod.Get,
60+
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
61+
#if NET6_0_OR_GREATER
62+
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
63+
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
64+
#endif
65+
66+
foreach (var __authorization in Authorizations)
67+
{
68+
if (__authorization.Type == "Http" ||
69+
__authorization.Type == "OAuth2")
70+
{
71+
__httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
72+
scheme: __authorization.Name,
73+
parameter: __authorization.Value);
74+
}
75+
else if (__authorization.Type == "ApiKey" &&
76+
__authorization.Location == "Header")
77+
{
78+
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
79+
}
80+
}
81+
82+
PrepareRequest(
83+
client: HttpClient,
84+
request: __httpRequest);
85+
PrepareAgentsRevisionsListRequest(
86+
httpClient: HttpClient,
87+
httpRequestMessage: __httpRequest,
88+
agentId: agentId,
89+
cursor: cursor,
90+
pageSize: pageSize);
91+
92+
using var __response = await HttpClient.SendAsync(
93+
request: __httpRequest,
94+
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
95+
cancellationToken: cancellationToken).ConfigureAwait(false);
96+
97+
ProcessResponse(
98+
client: HttpClient,
99+
response: __response);
100+
ProcessAgentsRevisionsListResponse(
101+
httpClient: HttpClient,
102+
httpResponseMessage: __response);
103+
104+
if (ReadResponseAsString)
105+
{
106+
var __content = await __response.Content.ReadAsStringAsync(
107+
#if NET5_0_OR_GREATER
108+
cancellationToken
109+
#endif
110+
).ConfigureAwait(false);
111+
112+
ProcessResponseContent(
113+
client: HttpClient,
114+
response: __response,
115+
content: ref __content);
116+
ProcessAgentsRevisionsListResponseContent(
117+
httpClient: HttpClient,
118+
httpResponseMessage: __response,
119+
content: ref __content);
120+
121+
try
122+
{
123+
__response.EnsureSuccessStatusCode();
124+
125+
return
126+
global::Ultravox.PaginatedAgentRevisionList.FromJson(__content, JsonSerializerContext) ??
127+
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
128+
}
129+
catch (global::System.Exception __ex)
130+
{
131+
throw new global::Ultravox.ApiException(
132+
message: __content ?? __response.ReasonPhrase ?? string.Empty,
133+
innerException: __ex,
134+
statusCode: __response.StatusCode)
135+
{
136+
ResponseBody = __content,
137+
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
138+
__response.Headers,
139+
h => h.Key,
140+
h => h.Value),
141+
};
142+
}
143+
}
144+
else
145+
{
146+
try
147+
{
148+
__response.EnsureSuccessStatusCode();
149+
150+
using var __content = await __response.Content.ReadAsStreamAsync(
151+
#if NET5_0_OR_GREATER
152+
cancellationToken
153+
#endif
154+
).ConfigureAwait(false);
155+
156+
return
157+
await global::Ultravox.PaginatedAgentRevisionList.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
158+
throw new global::System.InvalidOperationException("Response deserialization failed.");
159+
}
160+
catch (global::System.Exception __ex)
161+
{
162+
throw new global::Ultravox.ApiException(
163+
message: __response.ReasonPhrase ?? string.Empty,
164+
innerException: __ex,
165+
statusCode: __response.StatusCode)
166+
{
167+
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
168+
__response.Headers,
169+
h => h.Key,
170+
h => h.Value),
171+
};
172+
}
173+
}
174+
}
175+
}
176+
}

0 commit comments

Comments
 (0)