Skip to content

Commit

Permalink
Merge pull request #175 from tryAGI/bot/update-openapi_202501241519
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 24, 2025
2 parents 401f3c1 + 4649628 commit 09c82b2
Show file tree
Hide file tree
Showing 9 changed files with 1,116 additions and 518 deletions.
1,038 changes: 521 additions & 517 deletions src/libs/LangSmith/Generated/JsonSerializerContextTypes.g.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@

#nullable enable

namespace LangSmith
{
public partial class AnnotationQueuesClient
{
partial void PrepareDeleteRunsFromAnnotationQueueArguments(
global::System.Net.Http.HttpClient httpClient,
ref global::System.Guid queueId,
global::LangSmith.AnnotationQueueBulkDeleteRunsRequest request);
partial void PrepareDeleteRunsFromAnnotationQueueRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
global::System.Guid queueId,
global::LangSmith.AnnotationQueueBulkDeleteRunsRequest request);
partial void ProcessDeleteRunsFromAnnotationQueueResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);

partial void ProcessDeleteRunsFromAnnotationQueueResponseContent(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage,
ref string content);

/// <summary>
/// Delete Runs From Annotation Queue
/// </summary>
/// <param name="queueId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::LangSmith.ApiException"></exception>
public async global::System.Threading.Tasks.Task<string> DeleteRunsFromAnnotationQueueAsync(
global::System.Guid queueId,
global::LangSmith.AnnotationQueueBulkDeleteRunsRequest request,
global::System.Threading.CancellationToken cancellationToken = default)
{
request = request ?? throw new global::System.ArgumentNullException(nameof(request));

PrepareArguments(
client: HttpClient);
PrepareDeleteRunsFromAnnotationQueueArguments(
httpClient: HttpClient,
queueId: ref queueId,
request: request);

var __pathBuilder = new PathBuilder(
path: $"/api/v1/annotation-queues/{queueId}/runs/delete",
baseUri: HttpClient.BaseAddress);
var __path = __pathBuilder.ToString();
using var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
method: global::System.Net.Http.HttpMethod.Post,
requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
#if NET6_0_OR_GREATER
__httpRequest.Version = global::System.Net.HttpVersion.Version11;
__httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
#endif

foreach (var __authorization in Authorizations)
{
if (__authorization.Type == "Http" ||
__authorization.Type == "OAuth2")
{
__httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
scheme: __authorization.Name,
parameter: __authorization.Value);
}
else if (__authorization.Type == "ApiKey" &&
__authorization.Location == "Header")
{
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
var __httpRequestContent = new global::System.Net.Http.StringContent(
content: __httpRequestContentBody,
encoding: global::System.Text.Encoding.UTF8,
mediaType: "application/json");
__httpRequest.Content = __httpRequestContent;

PrepareRequest(
client: HttpClient,
request: __httpRequest);
PrepareDeleteRunsFromAnnotationQueueRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
queueId: queueId,
request: request);

using var __response = await HttpClient.SendAsync(
request: __httpRequest,
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
cancellationToken: cancellationToken).ConfigureAwait(false);

ProcessResponse(
client: HttpClient,
response: __response);
ProcessDeleteRunsFromAnnotationQueueResponse(
httpClient: HttpClient,
httpResponseMessage: __response);
// Validation Error
if ((int)__response.StatusCode == 422)
{
string? __content_422 = null;
global::LangSmith.HTTPValidationError? __value_422 = null;
if (ReadResponseAsString)
{
__content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_422 = global::LangSmith.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
}
else
{
var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__value_422 = await global::LangSmith.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false);
}

throw new global::LangSmith.ApiException<global::LangSmith.HTTPValidationError>(
message: __response.ReasonPhrase ?? string.Empty,
statusCode: __response.StatusCode)
{
ResponseBody = __content_422,
ResponseObject = __value_422,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
}

if (ReadResponseAsString)
{
var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

ProcessResponseContent(
client: HttpClient,
response: __response,
content: ref __content);
ProcessDeleteRunsFromAnnotationQueueResponseContent(
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);

try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::LangSmith.ApiException(
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
statusCode: __response.StatusCode)
{
ResponseBody = __content,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
}

return __content;
}
else
{
try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::LangSmith.ApiException(
message: __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
statusCode: __response.StatusCode)
{
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
}

var __content = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);

return __content;
}
}

/// <summary>
/// Delete Runs From Annotation Queue
/// </summary>
/// <param name="queueId"></param>
/// <param name="deleteAll">
/// Default Value: false
/// </param>
/// <param name="runIds"></param>
/// <param name="excludeRunIds"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<string> DeleteRunsFromAnnotationQueueAsync(
global::System.Guid queueId,
bool? deleteAll = default,
global::System.Collections.Generic.IList<global::System.Guid>? runIds = default,
global::System.Collections.Generic.IList<global::System.Guid>? excludeRunIds = default,
global::System.Threading.CancellationToken cancellationToken = default)
{
var __request = new global::LangSmith.AnnotationQueueBulkDeleteRunsRequest
{
DeleteAll = deleteAll,
RunIds = runIds,
ExcludeRunIds = excludeRunIds,
};

return await DeleteRunsFromAnnotationQueueAsync(
queueId: queueId,
request: __request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#nullable enable

namespace LangSmith
{
public partial interface IAnnotationQueuesClient
{
/// <summary>
/// Delete Runs From Annotation Queue
/// </summary>
/// <param name="queueId"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::LangSmith.ApiException"></exception>
global::System.Threading.Tasks.Task<string> DeleteRunsFromAnnotationQueueAsync(
global::System.Guid queueId,
global::LangSmith.AnnotationQueueBulkDeleteRunsRequest request,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Delete Runs From Annotation Queue
/// </summary>
/// <param name="queueId"></param>
/// <param name="deleteAll">
/// Default Value: false
/// </param>
/// <param name="runIds"></param>
/// <param name="excludeRunIds"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<string> DeleteRunsFromAnnotationQueueAsync(
global::System.Guid queueId,
bool? deleteAll = default,
global::System.Collections.Generic.IList<global::System.Guid>? runIds = default,
global::System.Collections.Generic.IList<global::System.Guid>? excludeRunIds = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace LangSmith
{
public sealed partial class AnnotationQueueBulkDeleteRunsRequest
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::LangSmith.AnnotationQueueBulkDeleteRunsRequest? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::LangSmith.AnnotationQueueBulkDeleteRunsRequest),
jsonSerializerContext) as global::LangSmith.AnnotationQueueBulkDeleteRunsRequest;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::LangSmith.AnnotationQueueBulkDeleteRunsRequest? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::LangSmith.AnnotationQueueBulkDeleteRunsRequest>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::LangSmith.AnnotationQueueBulkDeleteRunsRequest?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::LangSmith.AnnotationQueueBulkDeleteRunsRequest),
jsonSerializerContext).ConfigureAwait(false)) as global::LangSmith.AnnotationQueueBulkDeleteRunsRequest;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::LangSmith.AnnotationQueueBulkDeleteRunsRequest?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::LangSmith.AnnotationQueueBulkDeleteRunsRequest?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Loading

0 comments on commit 09c82b2

Please sign in to comment.