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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial interface ISimliClient
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Simli.ApiException"></exception>
global::System.Threading.Tasks.Task<string> GetCachedVideoMp4StaticMp4MachineIPFileGetAsync(
global::System.Threading.Tasks.Task<byte[]> GetCachedVideoMp4StaticMp4MachineIPFileGetAsync(
string destination,
string file,
global::Simli.AutoSDKRequestOptions? requestOptions = default,
Expand All @@ -25,7 +25,20 @@ public partial interface ISimliClient
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Simli.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Simli.AutoSDKHttpResponse<string>> GetCachedVideoMp4StaticMp4MachineIPFileGetAsResponseAsync(
global::System.Threading.Tasks.Task<global::System.IO.Stream> GetCachedVideoMp4StaticMp4MachineIPFileGetAsStreamAsync(
string destination,
string file,
global::Simli.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get MP4 of Generated Video
/// </summary>
/// <param name="destination"></param>
/// <param name="file"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Simli.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Simli.AutoSDKHttpResponse<byte[]>> GetCachedVideoMp4StaticMp4MachineIPFileGetAsResponseAsync(
string destination,
string file,
global::Simli.AutoSDKRequestOptions? requestOptions = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial interface ISimliClient
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Simli.ApiException"></exception>
global::System.Threading.Tasks.Task<string> GetCachedVideoStaticHlsMachineIPFileGetAsync(
global::System.Threading.Tasks.Task<byte[]> GetCachedVideoStaticHlsMachineIPFileGetAsync(
string destination,
string file,
global::Simli.AutoSDKRequestOptions? requestOptions = default,
Expand All @@ -27,7 +27,21 @@ public partial interface ISimliClient
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Simli.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Simli.AutoSDKHttpResponse<string>> GetCachedVideoStaticHlsMachineIPFileGetAsResponseAsync(
global::System.Threading.Tasks.Task<global::System.IO.Stream> GetCachedVideoStaticHlsMachineIPFileGetAsStreamAsync(
string destination,
string file,
global::Simli.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get HLS Segment<br/>
/// Get HLS Stream of Generated Video
/// </summary>
/// <param name="destination"></param>
/// <param name="file"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::Simli.ApiException"></exception>
global::System.Threading.Tasks.Task<global::Simli.AutoSDKHttpResponse<byte[]>> GetCachedVideoStaticHlsMachineIPFileGetAsResponseAsync(
string destination,
string file,
global::Simli.AutoSDKRequestOptions? requestOptions = default,
Expand Down
117 changes: 117 additions & 0 deletions src/libs/Simli/Generated/Simli.ResponseStream.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@

#nullable enable

namespace Simli
{
internal sealed class ResponseStream : global::System.IO.Stream
{
private readonly global::System.Net.Http.HttpResponseMessage _response;
private readonly global::System.IO.Stream _stream;
private bool _disposed;

public ResponseStream(
global::System.Net.Http.HttpResponseMessage response,
global::System.IO.Stream stream)
{
_response = response ?? throw new global::System.ArgumentNullException(nameof(response));
_stream = stream ?? throw new global::System.ArgumentNullException(nameof(stream));
}

public override bool CanRead => _stream.CanRead;
public override bool CanSeek => _stream.CanSeek;
public override bool CanWrite => _stream.CanWrite;
public override bool CanTimeout => _stream.CanTimeout;
public override long Length => _stream.Length;

public override long Position
{
get => _stream.Position;
set => _stream.Position = value;
}

public override int ReadTimeout
{
get => _stream.ReadTimeout;
set => _stream.ReadTimeout = value;
}

public override int WriteTimeout
{
get => _stream.WriteTimeout;
set => _stream.WriteTimeout = value;
}

public override void Flush() => _stream.Flush();

public override global::System.Threading.Tasks.Task FlushAsync(
global::System.Threading.CancellationToken cancellationToken) =>
_stream.FlushAsync(cancellationToken);

public override int Read(byte[] buffer, int offset, int count) =>
_stream.Read(buffer, offset, count);

public override global::System.Threading.Tasks.Task<int> ReadAsync(
byte[] buffer,
int offset,
int count,
global::System.Threading.CancellationToken cancellationToken) =>
_stream.ReadAsync(buffer, offset, count, cancellationToken);

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER
public override global::System.Threading.Tasks.ValueTask<int> ReadAsync(
global::System.Memory<byte> buffer,
global::System.Threading.CancellationToken cancellationToken = default) =>
_stream.ReadAsync(buffer, cancellationToken);
#endif

public override long Seek(long offset, global::System.IO.SeekOrigin origin) =>
_stream.Seek(offset, origin);

public override void SetLength(long value) =>
_stream.SetLength(value);

public override void Write(byte[] buffer, int offset, int count) =>
_stream.Write(buffer, offset, count);

public override global::System.Threading.Tasks.Task WriteAsync(
byte[] buffer,
int offset,
int count,
global::System.Threading.CancellationToken cancellationToken) =>
_stream.WriteAsync(buffer, offset, count, cancellationToken);

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER
public override global::System.Threading.Tasks.ValueTask WriteAsync(
global::System.ReadOnlyMemory<byte> buffer,
global::System.Threading.CancellationToken cancellationToken = default) =>
_stream.WriteAsync(buffer, cancellationToken);
#endif

protected override void Dispose(bool disposing)
{
if (!_disposed && disposing)
{
_disposed = true;
_stream.Dispose();
_response.Dispose();
}

base.Dispose(disposing);
}

#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER
public override async global::System.Threading.Tasks.ValueTask DisposeAsync()
{
if (_disposed)
{
return;
}

_disposed = true;
await _stream.DisposeAsync().ConfigureAwait(false);
_response.Dispose();
await base.DisposeAsync().ConfigureAwait(false);
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,6 @@ partial void ProcessEnqueueGSAGenerationFacesGsCreatePostResponseContent(
}

var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
if (gsVersion != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(gsVersion.ToString() ?? string.Empty),
name: "\"gsVersion\"");

}
if (faceName != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(faceName ?? string.Empty),
name: "\"face_name\"");

}
var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty<byte>());
__contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Imagename is null
Expand Down Expand Up @@ -682,22 +666,6 @@ request.Imagename is null
}

var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
if (gsVersion != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(gsVersion.ToString() ?? string.Empty),
name: "\"gsVersion\"");

}
if (faceName != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(faceName ?? string.Empty),
name: "\"face_name\"");

}
var __contentImage = new global::System.Net.Http.StreamContent(image);
__contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Imagename is null
Expand Down Expand Up @@ -1151,22 +1119,6 @@ request.Imagename is null
}

var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
if (gsVersion != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(gsVersion.ToString() ?? string.Empty),
name: "\"gsVersion\"");

}
if (faceName != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(faceName ?? string.Empty),
name: "\"face_name\"");

}
var __contentImage = new global::System.Net.Http.StreamContent(image);
__contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Imagename is null
Expand Down
Loading
Loading