Skip to content

Commit

Permalink
Merge pull request #69 from tryAGI/bot/update-openapi_202411121521
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 12, 2024
2 parents abdcded + 24a5b70 commit e869d3f
Show file tree
Hide file tree
Showing 301 changed files with 14,374 additions and 8,633 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte
/// </param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
/// <exception cref="global::AI21.ApiException"></exception>
public async global::System.Threading.Tasks.Task<string> ConvertDocumentFileStudioV1ChatFilesConvertPostAsync(
global::AI21.BodyConvertDocumentFileStudioV1ChatFilesConvertPost request,
int? requestStartTime = default,
Expand Down Expand Up @@ -104,28 +104,97 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte
ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponse(
httpClient: HttpClient,
httpResponseMessage: __response);
// Validation Error
if ((int)__response.StatusCode == 422)
{
string? __content_422 = null;
global::AI21.HTTPValidationError? __value_422 = null;
if (ReadResponseAsString)
{
__content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
}
else
{
var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false);
}

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

ProcessResponseContent(
client: HttpClient,
response: __response,
content: ref __content);
ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseContent(
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);
throw new global::AI21.ApiException<global::AI21.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),
};
}

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

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

try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::AI21.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;
}
catch (global::System.Net.Http.HttpRequestException __ex)
else
{
throw new global::System.InvalidOperationException(__content, __ex);
}
try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::AI21.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),
};
}

return __content;
using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::System.Text.Json.JsonSerializer.DeserializeAsync(__responseStream, typeof(string), JsonSerializerContext).ConfigureAwait(false) as string;

return
__responseValue ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganization
/// Default Value: 1730898900272
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
/// <exception cref="global::AI21.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::AI21.ConnectorsToken> GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostAsync(
string organizationId,
int? requestStartTime = default,
Expand Down Expand Up @@ -91,30 +91,99 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganization
ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostResponse(
httpClient: HttpClient,
httpResponseMessage: __response);
// Validation Error
if ((int)__response.StatusCode == 422)
{
string? __content_422 = null;
global::AI21.HTTPValidationError? __value_422 = null;
if (ReadResponseAsString)
{
__content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
}
else
{
var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false);
}

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

ProcessResponseContent(
client: HttpClient,
response: __response,
content: ref __content);
ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPostResponseContent(
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);
throw new global::AI21.ApiException<global::AI21.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),
};
}

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

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

try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::AI21.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
global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
else
{
throw new global::System.InvalidOperationException(__content, __ex);
}
try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::AI21.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),
};
}

return
global::AI21.ConnectorsToken.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::AI21.ConnectorsToken.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);

return
__responseValue ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizat
/// Default Value: 1730898900272
/// </param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
/// <exception cref="global::AI21.ApiException"></exception>
public async global::System.Threading.Tasks.Task<global::AI21.ConnectorsStatus> GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetAsync(
string organizationId,
string dataSource,
Expand Down Expand Up @@ -97,30 +97,99 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizat
ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetResponse(
httpClient: HttpClient,
httpResponseMessage: __response);
// Validation Error
if ((int)__response.StatusCode == 422)
{
string? __content_422 = null;
global::AI21.HTTPValidationError? __value_422 = null;
if (ReadResponseAsString)
{
__content_422 = await __response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
__value_422 = global::AI21.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
}
else
{
var __contentStream_422 = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
__value_422 = await global::AI21.HTTPValidationError.FromJsonStreamAsync(__contentStream_422, JsonSerializerContext).ConfigureAwait(false);
}

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

ProcessResponseContent(
client: HttpClient,
response: __response,
content: ref __content);
ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGetResponseContent(
httpClient: HttpClient,
httpResponseMessage: __response,
content: ref __content);
throw new global::AI21.ApiException<global::AI21.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),
};
}

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

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

try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::AI21.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
global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
}
catch (global::System.Net.Http.HttpRequestException __ex)
else
{
throw new global::System.InvalidOperationException(__content, __ex);
}
try
{
__response.EnsureSuccessStatusCode();
}
catch (global::System.Net.Http.HttpRequestException __ex)
{
throw new global::AI21.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),
};
}

return
global::AI21.ConnectorsStatus.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);

var __responseValue = await global::AI21.ConnectorsStatus.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false);

return
__responseValue ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
}
}
}
}
Loading

0 comments on commit e869d3f

Please sign in to comment.