generated from tryAGI/SdkTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
102 changed files
with
6,489 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
src/libs/Instill/Generated/Instill.CatalogClient.CreateCatalog.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Instill | ||
{ | ||
public partial class CatalogClient | ||
{ | ||
partial void PrepareCreateCatalogArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref string namespaceId, | ||
global::Instill.CreateCatalogBody request); | ||
partial void PrepareCreateCatalogRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
string namespaceId, | ||
global::Instill.CreateCatalogBody request); | ||
partial void ProcessCreateCatalogResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessCreateCatalogResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Create a catalog | ||
/// </summary> | ||
/// <param name="namespaceId"></param> | ||
/// <param name="request"></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<global::Instill.CreateCatalogResponse> CreateCatalogAsync( | ||
string namespaceId, | ||
global::Instill.CreateCatalogBody request, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
request = request ?? throw new global::System.ArgumentNullException(nameof(request)); | ||
|
||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareCreateCatalogArguments( | ||
httpClient: _httpClient, | ||
namespaceId: ref namespaceId, | ||
request: request); | ||
|
||
using var httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: global::System.Net.Http.HttpMethod.Post, | ||
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1alpha/namespaces/{namespaceId}/catalogs", global::System.UriKind.RelativeOrAbsolute)); | ||
var __httpRequestContentBody = global::System.Text.Json.JsonSerializer.Serialize(request, request.GetType(), 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); | ||
PrepareCreateCatalogRequest( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
namespaceId: namespaceId, | ||
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); | ||
ProcessCreateCatalogResponse( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessCreateCatalogResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::Instill.CreateCatalogResponse), JsonSerializerContext) as global::Instill.CreateCatalogResponse ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
|
||
/// <summary> | ||
/// Create a catalog | ||
/// </summary> | ||
/// <param name="namespaceId"></param> | ||
/// <param name="name"> | ||
/// The catalog name. | ||
/// </param> | ||
/// <param name="description"> | ||
/// The catalog description. | ||
/// </param> | ||
/// <param name="tags"> | ||
/// The catalog tags. | ||
/// </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<global::Instill.CreateCatalogResponse> CreateCatalogAsync( | ||
string namespaceId, | ||
string? name = default, | ||
string? description = default, | ||
global::System.Collections.Generic.IList<string>? tags = default, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
var request = new global::Instill.CreateCatalogBody | ||
{ | ||
Name = name, | ||
Description = description, | ||
Tags = tags, | ||
}; | ||
|
||
return await CreateCatalogAsync( | ||
namespaceId: namespaceId, | ||
request: request, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
src/libs/Instill/Generated/Instill.CatalogClient.DeleteCatalog.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Instill | ||
{ | ||
public partial class CatalogClient | ||
{ | ||
partial void PrepareDeleteCatalogArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref string namespaceId, | ||
ref string catalogId); | ||
partial void PrepareDeleteCatalogRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
string namespaceId, | ||
string catalogId); | ||
partial void ProcessDeleteCatalogResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessDeleteCatalogResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Delete a catalog | ||
/// </summary> | ||
/// <param name="namespaceId"></param> | ||
/// <param name="catalogId"></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<global::Instill.DeleteCatalogResponse> DeleteCatalogAsync( | ||
string namespaceId, | ||
string catalogId, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareDeleteCatalogArguments( | ||
httpClient: _httpClient, | ||
namespaceId: ref namespaceId, | ||
catalogId: ref catalogId); | ||
|
||
using var httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: global::System.Net.Http.HttpMethod.Delete, | ||
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1alpha/namespaces/{namespaceId}/catalogs/{catalogId}", global::System.UriKind.RelativeOrAbsolute)); | ||
|
||
PrepareRequest( | ||
client: _httpClient, | ||
request: httpRequest); | ||
PrepareDeleteCatalogRequest( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
namespaceId: namespaceId, | ||
catalogId: catalogId); | ||
|
||
using var response = await _httpClient.SendAsync( | ||
request: httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: _httpClient, | ||
response: response); | ||
ProcessDeleteCatalogResponse( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessDeleteCatalogResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::Instill.DeleteCatalogResponse), JsonSerializerContext) as global::Instill.DeleteCatalogResponse ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
src/libs/Instill/Generated/Instill.CatalogClient.DeleteCatalogFile.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Instill | ||
{ | ||
public partial class CatalogClient | ||
{ | ||
partial void PrepareDeleteCatalogFileArguments( | ||
global::System.Net.Http.HttpClient httpClient, | ||
ref string fileUid); | ||
partial void PrepareDeleteCatalogFileRequest( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpRequestMessage httpRequestMessage, | ||
string fileUid); | ||
partial void ProcessDeleteCatalogFileResponse( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage); | ||
|
||
partial void ProcessDeleteCatalogFileResponseContent( | ||
global::System.Net.Http.HttpClient httpClient, | ||
global::System.Net.Http.HttpResponseMessage httpResponseMessage, | ||
ref string content); | ||
|
||
/// <summary> | ||
/// Delete a file | ||
/// </summary> | ||
/// <param name="fileUid"></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<global::Instill.DeleteCatalogFileResponse> DeleteCatalogFileAsync( | ||
string fileUid, | ||
global::System.Threading.CancellationToken cancellationToken = default) | ||
{ | ||
PrepareArguments( | ||
client: _httpClient); | ||
PrepareDeleteCatalogFileArguments( | ||
httpClient: _httpClient, | ||
fileUid: ref fileUid); | ||
|
||
using var httpRequest = new global::System.Net.Http.HttpRequestMessage( | ||
method: global::System.Net.Http.HttpMethod.Delete, | ||
requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri.TrimEnd('/') + $"/v1alpha/catalogs/files?fileUid={fileUid}", global::System.UriKind.RelativeOrAbsolute)); | ||
|
||
PrepareRequest( | ||
client: _httpClient, | ||
request: httpRequest); | ||
PrepareDeleteCatalogFileRequest( | ||
httpClient: _httpClient, | ||
httpRequestMessage: httpRequest, | ||
fileUid: fileUid); | ||
|
||
using var response = await _httpClient.SendAsync( | ||
request: httpRequest, | ||
completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, | ||
cancellationToken: cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponse( | ||
client: _httpClient, | ||
response: response); | ||
ProcessDeleteCatalogFileResponse( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response); | ||
|
||
var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
ProcessResponseContent( | ||
client: _httpClient, | ||
response: response, | ||
content: ref __content); | ||
ProcessDeleteCatalogFileResponseContent( | ||
httpClient: _httpClient, | ||
httpResponseMessage: response, | ||
content: ref __content); | ||
|
||
try | ||
{ | ||
response.EnsureSuccessStatusCode(); | ||
} | ||
catch (global::System.Net.Http.HttpRequestException ex) | ||
{ | ||
throw new global::System.InvalidOperationException(__content, ex); | ||
} | ||
|
||
return | ||
global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::Instill.DeleteCatalogFileResponse), JsonSerializerContext) as global::Instill.DeleteCatalogFileResponse ?? | ||
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); | ||
} | ||
} | ||
} |
Oops, something went wrong.