From 9977d8bb82eed86b6af6a538834bcd73c9e2eb53 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 18 Oct 2024 06:23:06 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Instill.IInstillClient.g.cs | 5 + ...ll.IObjectClient.GetObjectDownloadURL.g.cs | 23 +++ ...till.IObjectClient.GetObjectUploadURL.g.cs | 25 +++ .../Generated/Instill.IObjectClient.g.cs | 19 ++ .../Generated/Instill.InstillClient.g.cs | 8 + ...l.Models.GetObjectDownloadURLResponse.g.cs | 93 ++++++++++ ....Models.GetObjectDownloadURLResponse2.g.cs | 76 ++++++++ ...ill.Models.GetObjectUploadURLResponse.g.cs | 93 ++++++++++ ...ll.Models.GetObjectUploadURLResponse2.g.cs | 76 ++++++++ .../Generated/Instill.Models.Object.g.cs | 141 ++++++++++++++ ...ill.ObjectClient.GetObjectDownloadURL.g.cs | 132 +++++++++++++ ...still.ObjectClient.GetObjectUploadURL.g.cs | 139 ++++++++++++++ .../Generated/Instill.ObjectClient.g.cs | 67 +++++++ .../Generated/JsonSerializerContextTypes.g.cs | 70 ++++--- src/libs/Instill/openapi.yaml | 173 ++++++++++++++++++ 15 files changed, 1111 insertions(+), 29 deletions(-) create mode 100644 src/libs/Instill/Generated/Instill.IObjectClient.GetObjectDownloadURL.g.cs create mode 100644 src/libs/Instill/Generated/Instill.IObjectClient.GetObjectUploadURL.g.cs create mode 100644 src/libs/Instill/Generated/Instill.IObjectClient.g.cs create mode 100644 src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse.g.cs create mode 100644 src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse2.g.cs create mode 100644 src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse.g.cs create mode 100644 src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse2.g.cs create mode 100644 src/libs/Instill/Generated/Instill.Models.Object.g.cs create mode 100644 src/libs/Instill/Generated/Instill.ObjectClient.GetObjectDownloadURL.g.cs create mode 100644 src/libs/Instill/Generated/Instill.ObjectClient.GetObjectUploadURL.g.cs create mode 100644 src/libs/Instill/Generated/Instill.ObjectClient.g.cs diff --git a/src/libs/Instill/Generated/Instill.IInstillClient.g.cs b/src/libs/Instill/Generated/Instill.IInstillClient.g.cs index 0460cb8..20b880c 100644 --- a/src/libs/Instill/Generated/Instill.IInstillClient.g.cs +++ b/src/libs/Instill/Generated/Instill.IInstillClient.g.cs @@ -61,5 +61,10 @@ public partial interface IInstillClient : global::System.IDisposable /// public CatalogClient Catalog { get; } + /// + /// + /// + public ObjectClient Object { get; } + } } \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.IObjectClient.GetObjectDownloadURL.g.cs b/src/libs/Instill/Generated/Instill.IObjectClient.GetObjectDownloadURL.g.cs new file mode 100644 index 0000000..31e2fc5 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.IObjectClient.GetObjectDownloadURL.g.cs @@ -0,0 +1,23 @@ +#nullable enable + +namespace Instill +{ + public partial interface IObjectClient + { + /// + /// Get Object Download URL + /// + /// + /// + /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetObjectDownloadURLAsync( + string namespaceId, + string? objectUid = default, + string? objectName = default, + int? expirationTime = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.IObjectClient.GetObjectUploadURL.g.cs b/src/libs/Instill/Generated/Instill.IObjectClient.GetObjectUploadURL.g.cs new file mode 100644 index 0000000..7d4d718 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.IObjectClient.GetObjectUploadURL.g.cs @@ -0,0 +1,25 @@ +#nullable enable + +namespace Instill +{ + public partial interface IObjectClient + { + /// + /// Get Object Upload URL + /// + /// + /// + /// + /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetObjectUploadURLAsync( + string namespaceId, + string objectName, + int? expirationTime = default, + global::System.DateTime? lastModifiedTime = default, + int? objectExpireDays = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.IObjectClient.g.cs b/src/libs/Instill/Generated/Instill.IObjectClient.g.cs new file mode 100644 index 0000000..19e0472 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.IObjectClient.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Instill +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface IObjectClient : global::System.IDisposable + { + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.InstillClient.g.cs b/src/libs/Instill/Generated/Instill.InstillClient.g.cs index 6885dce..fe28929 100644 --- a/src/libs/Instill/Generated/Instill.InstillClient.g.cs +++ b/src/libs/Instill/Generated/Instill.InstillClient.g.cs @@ -96,6 +96,14 @@ public sealed partial class InstillClient : global::Instill.IInstillClient, glob JsonSerializerContext = JsonSerializerContext, }; + /// + /// + /// + public ObjectClient Object => new ObjectClient(_httpClient, authorizations: _authorizations) + { + JsonSerializerContext = JsonSerializerContext, + }; + /// /// Creates a new instance of the InstillClient. /// If no httpClient is provided, a new one will be created. diff --git a/src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse.g.cs b/src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse.g.cs new file mode 100644 index 0000000..84c5958 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace Instill +{ + /// + /// + /// + public sealed partial class GetObjectDownloadURLResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("downloadUrl")] + public string? DownloadUrl { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("urlExpireAt")] + public global::System.DateTime? UrlExpireAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public global::Instill.Object? Object { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Instill.GetObjectDownloadURLResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Instill.GetObjectDownloadURLResponse), + jsonSerializerContext) as global::Instill.GetObjectDownloadURLResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#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::Instill.GetObjectDownloadURLResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse2.g.cs b/src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse2.g.cs new file mode 100644 index 0000000..23e4cae --- /dev/null +++ b/src/libs/Instill/Generated/Instill.Models.GetObjectDownloadURLResponse2.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace Instill +{ + /// + /// + /// + public sealed partial class GetObjectDownloadURLResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Instill.GetObjectDownloadURLResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Instill.GetObjectDownloadURLResponse2), + jsonSerializerContext) as global::Instill.GetObjectDownloadURLResponse2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#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::Instill.GetObjectDownloadURLResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse.g.cs b/src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse.g.cs new file mode 100644 index 0000000..92e0dd7 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse.g.cs @@ -0,0 +1,93 @@ + +#nullable enable + +namespace Instill +{ + /// + /// + /// + public sealed partial class GetObjectUploadURLResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("uploadUrl")] + public string? UploadUrl { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("urlExpireAt")] + public global::System.DateTime? UrlExpireAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("object")] + public global::Instill.Object? Object { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Instill.GetObjectUploadURLResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Instill.GetObjectUploadURLResponse), + jsonSerializerContext) as global::Instill.GetObjectUploadURLResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#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::Instill.GetObjectUploadURLResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse2.g.cs b/src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse2.g.cs new file mode 100644 index 0000000..5112600 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.Models.GetObjectUploadURLResponse2.g.cs @@ -0,0 +1,76 @@ + +#nullable enable + +namespace Instill +{ + /// + /// + /// + public sealed partial class GetObjectUploadURLResponse2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Instill.GetObjectUploadURLResponse2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Instill.GetObjectUploadURLResponse2), + jsonSerializerContext) as global::Instill.GetObjectUploadURLResponse2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#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::Instill.GetObjectUploadURLResponse2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.Models.Object.g.cs b/src/libs/Instill/Generated/Instill.Models.Object.g.cs new file mode 100644 index 0000000..f2d5ace --- /dev/null +++ b/src/libs/Instill/Generated/Instill.Models.Object.g.cs @@ -0,0 +1,141 @@ + +#nullable enable + +namespace Instill +{ + /// + /// + /// + public sealed partial class Object + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("uid")] + public string? Uid { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("size")] + public string? Size { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("contentType")] + public string? ContentType { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("namespaceUid")] + public string? NamespaceUid { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("creator")] + public string? Creator { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("isUploaded")] + public bool? IsUploaded { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("path")] + public string? Path { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("objectExpireDays")] + public int? ObjectExpireDays { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdTime")] + public global::System.DateTime? CreatedTime { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedTime")] + public global::System.DateTime? UpdatedTime { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#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); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Instill.Object? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Instill.Object), + jsonSerializerContext) as global::Instill.Object; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#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::Instill.Object? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.ObjectClient.GetObjectDownloadURL.g.cs b/src/libs/Instill/Generated/Instill.ObjectClient.GetObjectDownloadURL.g.cs new file mode 100644 index 0000000..52d3908 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.ObjectClient.GetObjectDownloadURL.g.cs @@ -0,0 +1,132 @@ + +#nullable enable + +namespace Instill +{ + public partial class ObjectClient + { + partial void PrepareGetObjectDownloadURLArguments( + global::System.Net.Http.HttpClient httpClient, + ref string namespaceId, + ref string? objectUid, + ref string? objectName, + ref int? expirationTime); + partial void PrepareGetObjectDownloadURLRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string namespaceId, + string? objectUid, + string? objectName, + int? expirationTime); + partial void ProcessGetObjectDownloadURLResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetObjectDownloadURLResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Object Download URL + /// + /// + /// + /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetObjectDownloadURLAsync( + string namespaceId, + string? objectUid = default, + string? objectName = default, + int? expirationTime = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: _httpClient); + PrepareGetObjectDownloadURLArguments( + httpClient: _httpClient, + namespaceId: ref namespaceId, + objectUid: ref objectUid, + objectName: ref objectName, + expirationTime: ref expirationTime); + + var __pathBuilder = new PathBuilder( + path: $"/v1alpha/namespaces/{namespaceId}/object-download-url", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("objectUid", objectUid) + .AddOptionalParameter("objectName", objectName) + .AddOptionalParameter("expirationTime", expirationTime?.ToString()) + ; + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + + 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); + } + } + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareGetObjectDownloadURLRequest( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + namespaceId: namespaceId, + objectUid: objectUid, + objectName: objectName, + expirationTime: expirationTime); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessGetObjectDownloadURLResponse( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessGetObjectDownloadURLResponseContent( + 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::Instill.GetObjectDownloadURLResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.ObjectClient.GetObjectUploadURL.g.cs b/src/libs/Instill/Generated/Instill.ObjectClient.GetObjectUploadURL.g.cs new file mode 100644 index 0000000..f599e94 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.ObjectClient.GetObjectUploadURL.g.cs @@ -0,0 +1,139 @@ + +#nullable enable + +namespace Instill +{ + public partial class ObjectClient + { + partial void PrepareGetObjectUploadURLArguments( + global::System.Net.Http.HttpClient httpClient, + ref string namespaceId, + ref string objectName, + ref int? expirationTime, + ref global::System.DateTime? lastModifiedTime, + ref int? objectExpireDays); + partial void PrepareGetObjectUploadURLRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string namespaceId, + string objectName, + int? expirationTime, + global::System.DateTime? lastModifiedTime, + int? objectExpireDays); + partial void ProcessGetObjectUploadURLResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetObjectUploadURLResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get Object Upload URL + /// + /// + /// + /// + /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetObjectUploadURLAsync( + string namespaceId, + string objectName, + int? expirationTime = default, + global::System.DateTime? lastModifiedTime = default, + int? objectExpireDays = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: _httpClient); + PrepareGetObjectUploadURLArguments( + httpClient: _httpClient, + namespaceId: ref namespaceId, + objectName: ref objectName, + expirationTime: ref expirationTime, + lastModifiedTime: ref lastModifiedTime, + objectExpireDays: ref objectExpireDays); + + var __pathBuilder = new PathBuilder( + path: $"/v1alpha/namespaces/{namespaceId}/object-upload-url", + baseUri: _httpClient.BaseAddress); + __pathBuilder + .AddRequiredParameter("objectName", objectName) + .AddOptionalParameter("expirationTime", expirationTime?.ToString()) + .AddOptionalParameter("lastModifiedTime", lastModifiedTime?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("objectExpireDays", objectExpireDays?.ToString()) + ; + var __path = __pathBuilder.ToString(); + using var httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); + + 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); + } + } + + PrepareRequest( + client: _httpClient, + request: httpRequest); + PrepareGetObjectUploadURLRequest( + httpClient: _httpClient, + httpRequestMessage: httpRequest, + namespaceId: namespaceId, + objectName: objectName, + expirationTime: expirationTime, + lastModifiedTime: lastModifiedTime, + objectExpireDays: objectExpireDays); + + using var response = await _httpClient.SendAsync( + request: httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: _httpClient, + response: response); + ProcessGetObjectUploadURLResponse( + httpClient: _httpClient, + httpResponseMessage: response); + + var __content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + + ProcessResponseContent( + client: _httpClient, + response: response, + content: ref __content); + ProcessGetObjectUploadURLResponseContent( + 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::Instill.GetObjectUploadURLResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/Instill.ObjectClient.g.cs b/src/libs/Instill/Generated/Instill.ObjectClient.g.cs new file mode 100644 index 0000000..9223a44 --- /dev/null +++ b/src/libs/Instill/Generated/Instill.ObjectClient.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Instill +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class ObjectClient : global::Instill.IObjectClient, global::System.IDisposable + { + /// + /// + /// + public const string BaseUrl = "https://api.instill.tech"; + + private readonly global::System.Net.Http.HttpClient _httpClient; + private global::System.Collections.Generic.List _authorizations; + + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Instill.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the ObjectClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// + /// + /// + public ObjectClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null) + { + _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(BaseUrl); + _authorizations = authorizations ?? new global::System.Collections.Generic.List(); + + Initialized(_httpClient); + } + + /// + public void Dispose() + { + _httpClient.Dispose(); + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/Instill/Generated/JsonSerializerContextTypes.g.cs b/src/libs/Instill/Generated/JsonSerializerContextTypes.g.cs index 5716d8f..e1ef82a 100644 --- a/src/libs/Instill/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/Instill/Generated/JsonSerializerContextTypes.g.cs @@ -462,118 +462,130 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Instill.GetRepositoryTagResponse? Type111 { get; set; } + public global::Instill.GetObjectDownloadURLResponse? Type111 { get; set; } /// /// /// - public global::Instill.GetSourceFileResponse? Type112 { get; set; } + public global::Instill.Object? Type112 { get; set; } /// /// /// - public global::Instill.SourceFile? Type113 { get; set; } + public global::Instill.GetObjectUploadURLResponse? Type113 { get; set; } /// /// /// - public global::Instill.ListCatalogFilesFilter? Type114 { get; set; } + public global::Instill.GetRepositoryTagResponse? Type114 { get; set; } /// /// /// - public global::Instill.ListCatalogFilesResponse? Type115 { get; set; } + public global::Instill.GetSourceFileResponse? Type115 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type116 { get; set; } + public global::Instill.SourceFile? Type116 { get; set; } /// /// /// - public global::Instill.ListCatalogRunsResponse? Type117 { get; set; } + public global::Instill.ListCatalogFilesFilter? Type117 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type118 { get; set; } + public global::Instill.ListCatalogFilesResponse? Type118 { get; set; } /// /// /// - public global::Instill.ListCatalogsResponse? Type119 { get; set; } + public global::System.Collections.Generic.IList? Type119 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type120 { get; set; } + public global::Instill.ListCatalogRunsResponse? Type120 { get; set; } /// /// /// - public global::Instill.ListChunksResponse? Type121 { get; set; } + public global::System.Collections.Generic.IList? Type121 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type122 { get; set; } + public global::Instill.ListCatalogsResponse? Type122 { get; set; } /// /// /// - public global::Instill.ListRepositoryTagsResponse? Type123 { get; set; } + public global::System.Collections.Generic.IList? Type123 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type124 { get; set; } + public global::Instill.ListChunksResponse? Type124 { get; set; } /// /// /// - public global::Instill.ProcessCatalogFilesRequest? Type125 { get; set; } + public global::System.Collections.Generic.IList? Type125 { get; set; } /// /// /// - public global::Instill.ProcessCatalogFilesResponse? Type126 { get; set; } + public global::Instill.ListRepositoryTagsResponse? Type126 { get; set; } /// /// /// - public global::Instill.QuestionAnsweringResponse? Type127 { get; set; } + public global::System.Collections.Generic.IList? Type127 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type128 { get; set; } + public global::Instill.ProcessCatalogFilesRequest? Type128 { get; set; } /// /// /// - public global::Instill.SimilarityChunk? Type129 { get; set; } + public global::Instill.ProcessCatalogFilesResponse? Type129 { get; set; } /// /// /// - public global::Instill.SimilarityChunksSearchResponse? Type130 { get; set; } + public global::Instill.QuestionAnsweringResponse? Type130 { get; set; } /// /// /// - public global::Instill.UpdateCatalogResponse? Type131 { get; set; } + public global::System.Collections.Generic.IList? Type131 { get; set; } /// /// /// - public global::Instill.UpdateChunkResponse? Type132 { get; set; } + public global::Instill.SimilarityChunk? Type132 { get; set; } /// /// /// - public global::Instill.UploadCatalogFileResponse? Type133 { get; set; } + public global::Instill.SimilarityChunksSearchResponse? Type133 { get; set; } /// /// /// - public global::Instill.ListUsersView? Type134 { get; set; } + public global::Instill.UpdateCatalogResponse? Type134 { get; set; } /// /// /// - public global::Instill.GetUserView? Type135 { get; set; } + public global::Instill.UpdateChunkResponse? Type135 { get; set; } /// /// /// - public global::Instill.ListOrganizationsView? Type136 { get; set; } + public global::Instill.UploadCatalogFileResponse? Type136 { get; set; } /// /// /// - public global::Instill.GetOrganizationView? Type137 { get; set; } + public global::Instill.ListUsersView? Type137 { get; set; } /// /// /// - public global::Instill.GetUserMembershipView? Type138 { get; set; } + public global::Instill.GetUserView? Type138 { get; set; } /// /// /// - public global::Instill.GetOrganizationMembershipView? Type139 { get; set; } + public global::Instill.ListOrganizationsView? Type139 { get; set; } + /// + /// + /// + public global::Instill.GetOrganizationView? Type140 { get; set; } + /// + /// + /// + public global::Instill.GetUserMembershipView? Type141 { get; set; } + /// + /// + /// + public global::Instill.GetOrganizationMembershipView? Type142 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Instill/openapi.yaml b/src/libs/Instill/openapi.yaml index 6295eec..dc0041f 100644 --- a/src/libs/Instill/openapi.yaml +++ b/src/libs/Instill/openapi.yaml @@ -1700,6 +1700,108 @@ paths: application/json: schema: $ref: '#/components/schemas/rpcStatus' + '/v1alpha/namespaces/{namespaceId}/object-upload-url': + get: + tags: + - Object + summary: Get Object Upload URL + operationId: GetObjectUploadURL + parameters: + - name: namespaceId + in: path + description: id of the namespace + required: true + schema: + type: string + - name: objectName + in: query + description: "name of the object with length limit to 1024 characters.\nthis is the unique identifier of the object in the namespace" + required: true + schema: + type: string + - name: expirationTime + in: query + description: "expiration time in minutes for the URL with a default value of 1440 minutes (1 day).\nminimum is 60 minutes (1 hour) and maximum is 20160 minutes (14 days)" + schema: + type: integer + format: int32 + - name: lastModifiedTime + in: query + description: last modified time this value is provided by the client when the object url is created + schema: + type: string + format: date-time + - name: objectExpireDays + in: query + description: "object live time in days\nminimum is 1 day. if not set, the object will not be deleted automatically" + schema: + type: integer + format: int32 + responses: + '200': + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectUploadURLResponse' + '401': + description: Returned when the client credentials are not valid. + content: + application/json: + schema: { } + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/rpcStatus' + '/v1alpha/namespaces/{namespaceId}/object-download-url': + get: + tags: + - Object + summary: Get Object Download URL + operationId: GetObjectDownloadURL + parameters: + - name: namespaceId + in: path + description: id of the namespace + required: true + schema: + type: string + - name: objectUid + in: query + description: "uid of the object\nif provided, object name is not required\nuid has priority over name" + schema: + type: string + - name: objectName + in: query + description: "object name\nif provided, object uid is not required" + schema: + type: string + - name: expirationTime + in: query + description: "expiration time in minutes for url with default value to 1440 minutes (1 day).\nminimum is 60 minutes (1 hour) and maximum is 20160 minutes (14 days)" + schema: + type: integer + format: int32 + responses: + '200': + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/GetObjectDownloadURLResponse' + '401': + description: Returned when the client credentials are not valid. + content: + application/json: + schema: { } + default: + description: An unexpected error response. + content: + application/json: + schema: + $ref: '#/components/schemas/rpcStatus' components: schemas: ApiTokenState: @@ -3149,6 +3251,36 @@ components: retrievable: title: chunk retrievable type: boolean + GetObjectDownloadURLResponse: + title: GetObjectDownloadURLResponse + type: object + properties: + downloadUrl: + title: download url + type: string + urlExpireAt: + title: expire at in UTC (UTC+0) + type: string + format: date-time + object: + title: object + allOf: + - $ref: '#/components/schemas/Object' + GetObjectUploadURLResponse: + title: GetObjectUploadURLResponse + type: object + properties: + uploadUrl: + title: upload url + type: string + urlExpireAt: + title: expire at in UTC (UTC+0) + type: string + format: date-time + object: + title: object + allOf: + - $ref: '#/components/schemas/Object' GetRepositoryTagResponse: type: object properties: @@ -3264,6 +3396,47 @@ components: description: The requested page offset. format: int32 description: ListRepositoryTagsResponse contains a list of container image tags. + Object: + title: Object + type: object + properties: + uid: + title: uid + type: string + name: + title: name of the object + type: string + size: + title: size in bytes + type: string + format: int64 + contentType: + title: "content type\nthis is from content-type header of http request" + type: string + namespaceUid: + title: namespace uid + type: string + creator: + title: creator + type: string + isUploaded: + title: if file is uploaded + type: boolean + path: + title: object path(optional) + type: string + objectExpireDays: + title: "object live time in days\nminimum is 1 day. if not set, the object will not be deleted automatically" + type: integer + format: int32 + createdTime: + title: created time + type: string + format: date-time + updatedTime: + title: updated time + type: string + format: date-time ProcessCatalogFilesRequest: title: Process Catalog File Request required: