Skip to content

Commit 93953df

Browse files
authored
Bump OpenAPI spec and regenerate SDKs (#2087)
2 parents b662067 + 34ba50e commit 93953df

File tree

454 files changed

+28628
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+28628
-831
lines changed

codegen/generated_files.json

Lines changed: 423 additions & 13 deletions
Large diffs are not rendered by default.

codegen/lib-openapi.json

Lines changed: 2653 additions & 496 deletions
Large diffs are not rendered by default.

csharp/Svix/Authentication.cs

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ public class AuthenticationLogoutOptions : SvixOptionsBase
4141
}
4242
}
4343

44+
public class AuthenticationStreamPortalAccessOptions : SvixOptionsBase
45+
{
46+
public string? IdempotencyKey { get; set; }
47+
48+
public new Dictionary<string, string> HeaderParams()
49+
{
50+
return SerializeParams(
51+
new Dictionary<string, object?> { { "idempotency-key", IdempotencyKey } }
52+
);
53+
}
54+
}
55+
56+
public class AuthenticationRotateStreamPollerTokenOptions : SvixOptionsBase
57+
{
58+
public string? IdempotencyKey { get; set; }
59+
60+
public new Dictionary<string, string> HeaderParams()
61+
{
62+
return SerializeParams(
63+
new Dictionary<string, object?> { { "idempotency-key", IdempotencyKey } }
64+
);
65+
}
66+
}
67+
4468
public class Authentication(SvixClient client)
4569
{
4670
readonly SvixClient _client = client;
@@ -280,5 +304,202 @@ public bool Logout(AuthenticationLogoutOptions? options = null)
280304
throw;
281305
}
282306
}
307+
308+
/// <summary>
309+
/// Use this function to get magic links (and authentication codes) for connecting your users to the Stream Consumer Portal.
310+
/// </summary>
311+
public async Task<AppPortalAccessOut> StreamPortalAccessAsync(
312+
string streamId,
313+
StreamPortalAccessIn streamPortalAccessIn,
314+
AuthenticationStreamPortalAccessOptions? options = null,
315+
CancellationToken cancellationToken = default
316+
)
317+
{
318+
streamPortalAccessIn =
319+
streamPortalAccessIn
320+
?? throw new ArgumentNullException(nameof(streamPortalAccessIn));
321+
try
322+
{
323+
var response = await _client.SvixHttpClient.SendRequestAsync<AppPortalAccessOut>(
324+
method: HttpMethod.Post,
325+
path: "/api/v1/auth/stream-portal-access/{stream_id}",
326+
pathParams: new Dictionary<string, string> { { "stream_id", streamId } },
327+
queryParams: options?.QueryParams(),
328+
headerParams: options?.HeaderParams(),
329+
content: streamPortalAccessIn,
330+
cancellationToken: cancellationToken
331+
);
332+
return response.Data;
333+
}
334+
catch (ApiException e)
335+
{
336+
_client.Logger?.LogError(e, $"{nameof(StreamPortalAccessAsync)} failed");
337+
338+
throw;
339+
}
340+
}
341+
342+
/// <summary>
343+
/// Use this function to get magic links (and authentication codes) for connecting your users to the Stream Consumer Portal.
344+
/// </summary>
345+
public AppPortalAccessOut StreamPortalAccess(
346+
string streamId,
347+
StreamPortalAccessIn streamPortalAccessIn,
348+
AuthenticationStreamPortalAccessOptions? options = null
349+
)
350+
{
351+
streamPortalAccessIn =
352+
streamPortalAccessIn
353+
?? throw new ArgumentNullException(nameof(streamPortalAccessIn));
354+
try
355+
{
356+
var response = _client.SvixHttpClient.SendRequest<AppPortalAccessOut>(
357+
method: HttpMethod.Post,
358+
path: "/api/v1/auth/stream-portal-access/{stream_id}",
359+
pathParams: new Dictionary<string, string> { { "stream_id", streamId } },
360+
queryParams: options?.QueryParams(),
361+
headerParams: options?.HeaderParams(),
362+
content: streamPortalAccessIn
363+
);
364+
return response.Data;
365+
}
366+
catch (ApiException e)
367+
{
368+
_client.Logger?.LogError(e, $"{nameof(StreamPortalAccess)} failed");
369+
370+
throw;
371+
}
372+
}
373+
374+
/// <summary>
375+
/// Get the current auth token for the stream poller.
376+
/// </summary>
377+
public async Task<ApiTokenOut> GetStreamPollerTokenAsync(
378+
string streamId,
379+
string sinkId,
380+
CancellationToken cancellationToken = default
381+
)
382+
{
383+
try
384+
{
385+
var response = await _client.SvixHttpClient.SendRequestAsync<ApiTokenOut>(
386+
method: HttpMethod.Get,
387+
path: "/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token",
388+
pathParams: new Dictionary<string, string>
389+
{
390+
{ "stream_id", streamId },
391+
{ "sink_id", sinkId },
392+
},
393+
cancellationToken: cancellationToken
394+
);
395+
return response.Data;
396+
}
397+
catch (ApiException e)
398+
{
399+
_client.Logger?.LogError(e, $"{nameof(GetStreamPollerTokenAsync)} failed");
400+
401+
throw;
402+
}
403+
}
404+
405+
/// <summary>
406+
/// Get the current auth token for the stream poller.
407+
/// </summary>
408+
public ApiTokenOut GetStreamPollerToken(string streamId, string sinkId)
409+
{
410+
try
411+
{
412+
var response = _client.SvixHttpClient.SendRequest<ApiTokenOut>(
413+
method: HttpMethod.Get,
414+
path: "/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token",
415+
pathParams: new Dictionary<string, string>
416+
{
417+
{ "stream_id", streamId },
418+
{ "sink_id", sinkId },
419+
}
420+
);
421+
return response.Data;
422+
}
423+
catch (ApiException e)
424+
{
425+
_client.Logger?.LogError(e, $"{nameof(GetStreamPollerToken)} failed");
426+
427+
throw;
428+
}
429+
}
430+
431+
/// <summary>
432+
/// Create a new auth token for the stream poller API.
433+
/// </summary>
434+
public async Task<ApiTokenOut> RotateStreamPollerTokenAsync(
435+
string streamId,
436+
string sinkId,
437+
RotatePollerTokenIn rotatePollerTokenIn,
438+
AuthenticationRotateStreamPollerTokenOptions? options = null,
439+
CancellationToken cancellationToken = default
440+
)
441+
{
442+
rotatePollerTokenIn =
443+
rotatePollerTokenIn ?? throw new ArgumentNullException(nameof(rotatePollerTokenIn));
444+
try
445+
{
446+
var response = await _client.SvixHttpClient.SendRequestAsync<ApiTokenOut>(
447+
method: HttpMethod.Post,
448+
path: "/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate",
449+
pathParams: new Dictionary<string, string>
450+
{
451+
{ "stream_id", streamId },
452+
{ "sink_id", sinkId },
453+
},
454+
queryParams: options?.QueryParams(),
455+
headerParams: options?.HeaderParams(),
456+
content: rotatePollerTokenIn,
457+
cancellationToken: cancellationToken
458+
);
459+
return response.Data;
460+
}
461+
catch (ApiException e)
462+
{
463+
_client.Logger?.LogError(e, $"{nameof(RotateStreamPollerTokenAsync)} failed");
464+
465+
throw;
466+
}
467+
}
468+
469+
/// <summary>
470+
/// Create a new auth token for the stream poller API.
471+
/// </summary>
472+
public ApiTokenOut RotateStreamPollerToken(
473+
string streamId,
474+
string sinkId,
475+
RotatePollerTokenIn rotatePollerTokenIn,
476+
AuthenticationRotateStreamPollerTokenOptions? options = null
477+
)
478+
{
479+
rotatePollerTokenIn =
480+
rotatePollerTokenIn ?? throw new ArgumentNullException(nameof(rotatePollerTokenIn));
481+
try
482+
{
483+
var response = _client.SvixHttpClient.SendRequest<ApiTokenOut>(
484+
method: HttpMethod.Post,
485+
path: "/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate",
486+
pathParams: new Dictionary<string, string>
487+
{
488+
{ "stream_id", streamId },
489+
{ "sink_id", sinkId },
490+
},
491+
queryParams: options?.QueryParams(),
492+
headerParams: options?.HeaderParams(),
493+
content: rotatePollerTokenIn
494+
);
495+
return response.Data;
496+
}
497+
catch (ApiException e)
498+
{
499+
_client.Logger?.LogError(e, $"{nameof(RotateStreamPollerToken)} failed");
500+
501+
throw;
502+
}
503+
}
283504
}
284505
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// this file is @generated
2+
using System.Text;
3+
using Newtonsoft.Json;
4+
5+
namespace Svix.Models
6+
{
7+
public class AmazonS3PatchConfig
8+
{
9+
[JsonProperty("accessKeyId")]
10+
public string? AccessKeyId { get; set; } = null;
11+
12+
[JsonProperty("bucket")]
13+
public string? Bucket { get; set; } = null;
14+
15+
[JsonProperty("region")]
16+
public string? Region { get; set; } = null;
17+
18+
[JsonProperty("secretAccessKey")]
19+
public string? SecretAccessKey { get; set; } = null;
20+
21+
public override string ToString()
22+
{
23+
StringBuilder sb = new StringBuilder();
24+
25+
sb.Append("class AmazonS3PatchConfig {\n");
26+
sb.Append(" AccessKeyId: ").Append(AccessKeyId).Append('\n');
27+
sb.Append(" Bucket: ").Append(Bucket).Append('\n');
28+
sb.Append(" Region: ").Append(Region).Append('\n');
29+
sb.Append(" SecretAccessKey: ").Append(SecretAccessKey).Append('\n');
30+
sb.Append("}\n");
31+
return sb.ToString();
32+
}
33+
}
34+
}

csharp/Svix/Models/ApiTokenOut.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// this file is @generated
2+
using System.Text;
3+
using Newtonsoft.Json;
4+
5+
namespace Svix.Models
6+
{
7+
public class ApiTokenOut
8+
{
9+
[JsonProperty("createdAt", Required = Required.Always)]
10+
public required DateTime CreatedAt { get; set; }
11+
12+
[JsonProperty("expiresAt")]
13+
public DateTime? ExpiresAt { get; set; } = null;
14+
15+
[JsonProperty("id", Required = Required.Always)]
16+
public required string Id { get; set; }
17+
18+
[JsonProperty("name")]
19+
public string? Name { get; set; } = null;
20+
21+
[JsonProperty("scopes")]
22+
public List<string>? Scopes { get; set; } = null;
23+
24+
[JsonProperty("token", Required = Required.Always)]
25+
public required string Token { get; set; }
26+
27+
public override string ToString()
28+
{
29+
StringBuilder sb = new StringBuilder();
30+
31+
sb.Append("class ApiTokenOut {\n");
32+
sb.Append(" CreatedAt: ").Append(CreatedAt).Append('\n');
33+
sb.Append(" ExpiresAt: ").Append(ExpiresAt).Append('\n');
34+
sb.Append(" Id: ").Append(Id).Append('\n');
35+
sb.Append(" Name: ").Append(Name).Append('\n');
36+
sb.Append(" Scopes: ").Append(Scopes).Append('\n');
37+
sb.Append(" Token: ").Append(Token).Append('\n');
38+
sb.Append("}\n");
39+
return sb.ToString();
40+
}
41+
}
42+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// this file is @generated
2+
using System.Text;
3+
using Newtonsoft.Json;
4+
5+
namespace Svix.Models
6+
{
7+
public class AzureBlobStorageConfig
8+
{
9+
[JsonProperty("accessKey", Required = Required.Always)]
10+
public required string AccessKey { get; set; }
11+
12+
[JsonProperty("account", Required = Required.Always)]
13+
public required string Account { get; set; }
14+
15+
[JsonProperty("container", Required = Required.Always)]
16+
public required string Container { get; set; }
17+
18+
public override string ToString()
19+
{
20+
StringBuilder sb = new StringBuilder();
21+
22+
sb.Append("class AzureBlobStorageConfig {\n");
23+
sb.Append(" AccessKey: ").Append(AccessKey).Append('\n');
24+
sb.Append(" Account: ").Append(Account).Append('\n');
25+
sb.Append(" Container: ").Append(Container).Append('\n');
26+
sb.Append("}\n");
27+
return sb.ToString();
28+
}
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// this file is @generated
2+
using System.Text;
3+
using Newtonsoft.Json;
4+
5+
namespace Svix.Models
6+
{
7+
public class AzureBlobStoragePatchConfig
8+
{
9+
[JsonProperty("accessKey")]
10+
public string? AccessKey { get; set; } = null;
11+
12+
[JsonProperty("account")]
13+
public string? Account { get; set; } = null;
14+
15+
[JsonProperty("container")]
16+
public string? Container { get; set; } = null;
17+
18+
public override string ToString()
19+
{
20+
StringBuilder sb = new StringBuilder();
21+
22+
sb.Append("class AzureBlobStoragePatchConfig {\n");
23+
sb.Append(" AccessKey: ").Append(AccessKey).Append('\n');
24+
sb.Append(" Account: ").Append(Account).Append('\n');
25+
sb.Append(" Container: ").Append(Container).Append('\n');
26+
sb.Append("}\n");
27+
return sb.ToString();
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)