Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libs/Runway/Generated/Runway.Exceptions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
/// <param name="statusCode">The HTTP status code of the response.</param>
public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException)
public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException)
{
StatusCode = statusCode;
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
/// <param name="statusCode">The HTTP status code of the response.</param>
public ApiException(string message, global::System.Exception innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode)
public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,26 @@ partial void ProcessCancelOrDeleteTaskResponse(
if ((int)__response.StatusCode == 404)
{
string? __content_404 = null;
if (ReadResponseAsString)
global::System.Exception? __exception_404 = null;
try
{
__content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
if (ReadResponseAsString)
{
__content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
}
else
{
var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
}
}
else
catch (global::System.Exception __ex)
{
var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__exception_404 = __ex;
}

throw new global::Runway.ApiException(
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
statusCode: __response.StatusCode)
{
ResponseBody = __content_404,
Expand All @@ -130,8 +139,9 @@ partial void ProcessCancelOrDeleteTaskResponse(
try
{
__response.EnsureSuccessStatusCode();

}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Runway.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -145,15 +155,21 @@ partial void ProcessCancelOrDeleteTaskResponse(
h => h.Value),
};
}

}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Runway.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -166,13 +182,6 @@ partial void ProcessCancelOrDeleteTaskResponse(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,26 @@ partial void ProcessCreateVideoFromImageResponseContent(
if ((int)__response.StatusCode == 429)
{
string? __content_429 = null;
if (ReadResponseAsString)
global::System.Exception? __exception_429 = null;
try
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
if (ReadResponseAsString)
{
__content_429 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
}
else
{
var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
}
}
else
catch (global::System.Exception __ex)
{
var __contentStream_429 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__exception_429 = __ex;
}

throw new global::Runway.ApiException(
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
statusCode: __response.StatusCode)
{
ResponseBody = __content_429,
Expand Down Expand Up @@ -147,8 +156,12 @@ partial void ProcessCreateVideoFromImageResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Runway.CreateVideoFromImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Runway.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -162,18 +175,24 @@ partial void ProcessCreateVideoFromImageResponseContent(
h => h.Value),
};
}

return
global::Runway.CreateVideoFromImageResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Runway.CreateVideoFromImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Runway.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -186,16 +205,6 @@ partial void ProcessCreateVideoFromImageResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Runway.CreateVideoFromImageResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

Expand Down
49 changes: 29 additions & 20 deletions src/libs/Runway/Generated/Runway.RunwayClient.GetTaskDetail.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,26 @@ partial void ProcessGetTaskDetailResponseContent(
if ((int)__response.StatusCode == 404)
{
string? __content_404 = null;
if (ReadResponseAsString)
global::System.Exception? __exception_404 = null;
try
{
__content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
if (ReadResponseAsString)
{
__content_404 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
}
else
{
var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
}
}
else
catch (global::System.Exception __ex)
{
var __contentStream_404 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__exception_404 = __ex;
}

throw new global::Runway.ApiException(
message: __content_404 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_404,
statusCode: __response.StatusCode)
{
ResponseBody = __content_404,
Expand Down Expand Up @@ -139,8 +148,12 @@ partial void ProcessGetTaskDetailResponseContent(
try
{
__response.EnsureSuccessStatusCode();

return
global::Runway.GetTaskDetailResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Runway.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
Expand All @@ -154,18 +167,24 @@ partial void ProcessGetTaskDetailResponseContent(
h => h.Value),
};
}

return
global::Runway.GetTaskDetailResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
else
{
try
{
__response.EnsureSuccessStatusCode();

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Runway.GetTaskDetailResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
catch (global::System.Net.Http.HttpRequestException __ex)
catch (global::System.Exception __ex)
{
throw new global::Runway.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
Expand All @@ -178,16 +197,6 @@ partial void ProcessGetTaskDetailResponseContent(
h => h.Value),
};
}

using var __content = await __response.Content.ReadAsStreamAsync(
#if NET5_0_OR_GREATER
cancellationToken
#endif
).ConfigureAwait(false);

return
await global::Runway.GetTaskDetailResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
}
Expand Down
Loading