diff --git a/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTable.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTable.g.cs new file mode 100644 index 0000000..394c59b --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTable.g.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace PromptLayer +{ + public partial interface ISmartTablesClient + { + /// + /// Delete Table
+ /// Delete a Table. This soft deletes the table and removes it from active list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteTableAsync( + global::System.Guid tableId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Table
+ /// Delete a Table. This soft deletes the table and removes it from active list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteTableAsResponseAsync( + global::System.Guid tableId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTableSheet.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTableSheet.g.cs new file mode 100644 index 0000000..3dcc5e3 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTableSheet.g.cs @@ -0,0 +1,36 @@ +#nullable enable + +namespace PromptLayer +{ + public partial interface ISmartTablesClient + { + /// + /// Delete Sheet
+ /// Delete a sheet. This soft deletes the sheet and removes it from active sheet list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteTableSheetAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Sheet
+ /// Delete a sheet. This soft deletes the sheet and removes it from active sheet list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteTableSheetAsResponseAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTableSheetColumn.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTableSheetColumn.g.cs new file mode 100644 index 0000000..31d84cc --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.ISmartTablesClient.DeleteTableSheetColumn.g.cs @@ -0,0 +1,40 @@ +#nullable enable + +namespace PromptLayer +{ + public partial interface ISmartTablesClient + { + /// + /// Delete Column
+ /// Delete a column and its cells. The operation creates a new sheet version and may mark downstream dependent cells as stale. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteTableSheetColumnAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::System.Guid columnId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Column
+ /// Delete a column and its cells. The operation creates a new sheet version and may mark downstream dependent cells as stale. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteTableSheetColumnAsResponseAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::System.Guid columnId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContext.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContext.g.cs index 129ca9a..fd06f1b 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContext.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContext.g.cs @@ -909,6 +909,12 @@ namespace PromptLayer typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + + typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + + typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + typeof(global::PromptLayer.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.OneOf>), TypeInfoPropertyName = "ListFolderEntitiesApiPublicV2FoldersEntitiesGetFilterTypeItem_a2e389e01f671d8d")] @@ -2318,6 +2324,12 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + + typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + + typeof(global::PromptLayer.JsonConverters.OneOfJsonConverter), + typeof(global::PromptLayer.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.OneOf>), TypeInfoPropertyName = "ListFolderEntitiesApiPublicV2FoldersEntitiesGetFilterTypeItem_a2e389e01f671d8d")] @@ -2480,17 +2492,20 @@ internal sealed partial class SourceGenerationContextChunk0 : global::System.Tex [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.GetTableResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.UpdateTableResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.DeleteTableResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.ListTableSheetsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.CreateTableSheetResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.GetTableSheetOperationResponse2))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.GetTableSheetResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.UpdateTableSheetResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.DeleteTableSheetResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.ListTableSheetColumnsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.CreateTableSheetColumnResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.UpdateTableSheetColumnResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.DeleteTableSheetColumnResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.ListTableSheetRowsResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::PromptLayer.ListTableSheetRowsResponseDataItem))] @@ -3124,6 +3139,9 @@ private SourceGenerationContext(global::System.Text.Json.JsonSerializerOptions o options.Converters.Add(new global::PromptLayer.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::PromptLayer.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::PromptLayer.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::PromptLayer.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::PromptLayer.JsonConverters.OneOfJsonConverter()); + options.Converters.Add(new global::PromptLayer.JsonConverters.OneOfJsonConverter()); options.Converters.Add(new global::PromptLayer.JsonConverters.UnixTimestampJsonConverter()); return options; diff --git a/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContextTypes.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContextTypes.g.cs index 363c85f..3edaf5e 100644 --- a/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContextTypes.g.cs +++ b/src/libs/PromptLayer/Generated/PromptLayer.JsonSerializerContextTypes.g.cs @@ -2624,219 +2624,231 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::PromptLayer.ListTableSheetsResponse? Type649 { get; set; } + public global::PromptLayer.DeleteTableResponse? Type649 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type650 { get; set; } + public global::PromptLayer.ListTableSheetsResponse? Type650 { get; set; } /// /// /// - public global::PromptLayer.CreateTableSheetResponse? Type651 { get; set; } + public global::System.Collections.Generic.IList? Type651 { get; set; } /// /// /// - public global::PromptLayer.GetTableSheetOperationResponse2? Type652 { get; set; } + public global::PromptLayer.CreateTableSheetResponse? Type652 { get; set; } /// /// /// - public global::PromptLayer.GetTableSheetResponse? Type653 { get; set; } + public global::PromptLayer.GetTableSheetOperationResponse2? Type653 { get; set; } /// /// /// - public global::PromptLayer.UpdateTableSheetResponse? Type654 { get; set; } + public global::PromptLayer.GetTableSheetResponse? Type654 { get; set; } /// /// /// - public global::PromptLayer.ListTableSheetColumnsResponse? Type655 { get; set; } + public global::PromptLayer.UpdateTableSheetResponse? Type655 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type656 { get; set; } + public global::PromptLayer.DeleteTableSheetResponse? Type656 { get; set; } /// /// /// - public global::PromptLayer.CreateTableSheetColumnResponse? Type657 { get; set; } + public global::PromptLayer.ListTableSheetColumnsResponse? Type657 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type658 { get; set; } + public global::System.Collections.Generic.IList? Type658 { get; set; } /// /// /// - public global::PromptLayer.UpdateTableSheetColumnResponse? Type659 { get; set; } + public global::PromptLayer.CreateTableSheetColumnResponse? Type659 { get; set; } /// /// /// - public global::PromptLayer.ListTableSheetRowsResponse? Type660 { get; set; } + public global::System.Collections.Generic.IList? Type660 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type661 { get; set; } + public global::PromptLayer.UpdateTableSheetColumnResponse? Type661 { get; set; } /// /// /// - public global::PromptLayer.ListTableSheetRowsResponseDataItem? Type662 { get; set; } + public global::PromptLayer.DeleteTableSheetColumnResponse? Type662 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type663 { get; set; } + public global::PromptLayer.ListTableSheetRowsResponse? Type663 { get; set; } /// /// /// - public global::PromptLayer.AddTableSheetRowsResponse? Type664 { get; set; } + public global::System.Collections.Generic.IList? Type664 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type665 { get; set; } + public global::PromptLayer.ListTableSheetRowsResponseDataItem? Type665 { get; set; } /// /// /// - public global::PromptLayer.AddTableSheetRowsResponseRow? Type666 { get; set; } + public global::System.Collections.Generic.Dictionary? Type666 { get; set; } /// /// /// - public global::PromptLayer.GetTableSheetCellResponse? Type667 { get; set; } + public global::PromptLayer.AddTableSheetRowsResponse? Type667 { get; set; } /// /// /// - public global::PromptLayer.UpdateTableSheetCellResponse? Type668 { get; set; } + public global::System.Collections.Generic.IList? Type668 { get; set; } /// /// /// - public global::PromptLayer.CreateTableSheetCellRecalculationsBatchResponse? Type669 { get; set; } + public global::PromptLayer.AddTableSheetRowsResponseRow? Type669 { get; set; } /// /// /// - public global::PromptLayer.CreateTableSheetCellRecalculationResponse? Type670 { get; set; } + public global::PromptLayer.GetTableSheetCellResponse? Type670 { get; set; } /// /// /// - public global::PromptLayer.CreateToolVersionResponse? Type671 { get; set; } + public global::PromptLayer.UpdateTableSheetCellResponse? Type671 { get; set; } /// /// /// - public global::PromptLayer.TestExecuteToolResponse? Type672 { get; set; } + public global::PromptLayer.CreateTableSheetCellRecalculationsBatchResponse? Type672 { get; set; } /// /// /// - public global::PromptLayer.TestExecuteToolResponseResult? Type673 { get; set; } + public global::PromptLayer.CreateTableSheetCellRecalculationResponse? Type673 { get; set; } /// /// /// - public global::PromptLayer.TestExecuteToolResponseResultStatus? Type674 { get; set; } + public global::PromptLayer.CreateToolVersionResponse? Type674 { get; set; } /// /// /// - public global::PromptLayer.CloseTraceResponse? Type675 { get; set; } + public global::PromptLayer.TestExecuteToolResponse? Type675 { get; set; } /// /// /// - public global::PromptLayer.CloseTraceResponseClosure? Type676 { get; set; } + public global::PromptLayer.TestExecuteToolResponseResult? Type676 { get; set; } /// /// /// - public global::PromptLayer.CloseTraceResponseClosureStatus? Type677 { get; set; } + public global::PromptLayer.TestExecuteToolResponseResultStatus? Type677 { get; set; } /// /// /// - public global::PromptLayer.CloseTraceResponse2? Type678 { get; set; } + public global::PromptLayer.CloseTraceResponse? Type678 { get; set; } /// /// /// - public global::PromptLayer.ListWorkspaceEnvVarsResponse? Type679 { get; set; } + public global::PromptLayer.CloseTraceResponseClosure? Type679 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type680 { get; set; } + public global::PromptLayer.CloseTraceResponseClosureStatus? Type680 { get; set; } /// /// /// - public global::PromptLayer.ListWorkspaceEnvVarsResponseWorkspaceEnvVar? Type681 { get; set; } + public global::PromptLayer.CloseTraceResponse2? Type681 { get; set; } /// /// /// - public global::PromptLayer.CreateWorkspaceEnvVarResponse? Type682 { get; set; } + public global::PromptLayer.ListWorkspaceEnvVarsResponse? Type682 { get; set; } /// /// /// - public global::PromptLayer.CreateWorkspaceEnvVarResponseWorkspaceEnvVar? Type683 { get; set; } + public global::System.Collections.Generic.IList? Type683 { get; set; } /// /// /// - public global::PromptLayer.CreateWorkspaceEnvVarResponse2? Type684 { get; set; } + public global::PromptLayer.ListWorkspaceEnvVarsResponseWorkspaceEnvVar? Type684 { get; set; } /// /// /// - public global::PromptLayer.UpdateWorkspaceEnvVarResponse? Type685 { get; set; } + public global::PromptLayer.CreateWorkspaceEnvVarResponse? Type685 { get; set; } /// /// /// - public global::PromptLayer.UpdateWorkspaceEnvVarResponseWorkspaceEnvVar? Type686 { get; set; } + public global::PromptLayer.CreateWorkspaceEnvVarResponseWorkspaceEnvVar? Type686 { get; set; } /// /// /// - public global::PromptLayer.UpdateWorkspaceEnvVarResponse2? Type687 { get; set; } + public global::PromptLayer.CreateWorkspaceEnvVarResponse2? Type687 { get; set; } /// /// /// - public global::PromptLayer.DeleteWorkspaceEnvVarResponse? Type688 { get; set; } + public global::PromptLayer.UpdateWorkspaceEnvVarResponse? Type688 { get; set; } /// /// /// - public global::PromptLayer.DeleteWorkspaceEnvVarResponse2? Type689 { get; set; } + public global::PromptLayer.UpdateWorkspaceEnvVarResponseWorkspaceEnvVar? Type689 { get; set; } /// /// /// - public global::PromptLayer.ListToolEnvVarsResponse? Type690 { get; set; } + public global::PromptLayer.UpdateWorkspaceEnvVarResponse2? Type690 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type691 { get; set; } + public global::PromptLayer.DeleteWorkspaceEnvVarResponse? Type691 { get; set; } /// /// /// - public global::PromptLayer.ListToolEnvVarsResponseToolEnvVar? Type692 { get; set; } + public global::PromptLayer.DeleteWorkspaceEnvVarResponse2? Type692 { get; set; } /// /// /// - public global::PromptLayer.ListToolEnvVarsResponse2? Type693 { get; set; } + public global::PromptLayer.ListToolEnvVarsResponse? Type693 { get; set; } /// /// /// - public global::PromptLayer.CreateToolEnvVarResponse? Type694 { get; set; } + public global::System.Collections.Generic.IList? Type694 { get; set; } /// /// /// - public global::PromptLayer.CreateToolEnvVarResponseToolEnvVar? Type695 { get; set; } + public global::PromptLayer.ListToolEnvVarsResponseToolEnvVar? Type695 { get; set; } /// /// /// - public global::PromptLayer.CreateToolEnvVarResponse2? Type696 { get; set; } + public global::PromptLayer.ListToolEnvVarsResponse2? Type696 { get; set; } /// /// /// - public global::PromptLayer.CreateToolEnvVarResponse3? Type697 { get; set; } + public global::PromptLayer.CreateToolEnvVarResponse? Type697 { get; set; } /// /// /// - public global::PromptLayer.UpdateToolEnvVarResponse? Type698 { get; set; } + public global::PromptLayer.CreateToolEnvVarResponseToolEnvVar? Type698 { get; set; } /// /// /// - public global::PromptLayer.UpdateToolEnvVarResponseToolEnvVar? Type699 { get; set; } + public global::PromptLayer.CreateToolEnvVarResponse2? Type699 { get; set; } /// /// /// - public global::PromptLayer.UpdateToolEnvVarResponse2? Type700 { get; set; } + public global::PromptLayer.CreateToolEnvVarResponse3? Type700 { get; set; } /// /// /// - public global::PromptLayer.DeleteToolEnvVarResponse? Type701 { get; set; } + public global::PromptLayer.UpdateToolEnvVarResponse? Type701 { get; set; } /// /// /// - public global::PromptLayer.DeleteToolEnvVarResponse2? Type702 { get; set; } + public global::PromptLayer.UpdateToolEnvVarResponseToolEnvVar? Type702 { get; set; } + /// + /// + /// + public global::PromptLayer.UpdateToolEnvVarResponse2? Type703 { get; set; } + /// + /// + /// + public global::PromptLayer.DeleteToolEnvVarResponse? Type704 { get; set; } + /// + /// + /// + public global::PromptLayer.DeleteToolEnvVarResponse2? Type705 { get; set; } /// /// diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableResponse.Json.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableResponse.Json.g.cs new file mode 100644 index 0000000..1aaca62 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace PromptLayer +{ + public sealed partial class DeleteTableResponse + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::PromptLayer.DeleteTableResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::PromptLayer.DeleteTableResponse), + jsonSerializerContext) as global::PromptLayer.DeleteTableResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::PromptLayer.DeleteTableResponse? FromJson( + string json) + { + return FromJson( + json, + global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// 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::PromptLayer.DeleteTableResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::PromptLayer.DeleteTableResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::PromptLayer.DeleteTableResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream 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::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableResponse.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableResponse.g.cs new file mode 100644 index 0000000..5456b32 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableResponse.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace PromptLayer +{ + /// + /// + /// + public sealed partial class DeleteTableResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + public bool? Success { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeleteTableResponse( + bool? success, + string? message) + { + this.Success = success; + this.Message = message; + } + + /// + /// Initializes a new instance of the class. + /// + public DeleteTableResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetColumnResponse.Json.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetColumnResponse.Json.g.cs new file mode 100644 index 0000000..6f0ff72 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetColumnResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace PromptLayer +{ + public sealed partial class DeleteTableSheetColumnResponse + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::PromptLayer.DeleteTableSheetColumnResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::PromptLayer.DeleteTableSheetColumnResponse), + jsonSerializerContext) as global::PromptLayer.DeleteTableSheetColumnResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::PromptLayer.DeleteTableSheetColumnResponse? FromJson( + string json) + { + return FromJson( + json, + global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// 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::PromptLayer.DeleteTableSheetColumnResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::PromptLayer.DeleteTableSheetColumnResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::PromptLayer.DeleteTableSheetColumnResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream 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::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetColumnResponse.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetColumnResponse.g.cs new file mode 100644 index 0000000..d8d9e73 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetColumnResponse.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace PromptLayer +{ + /// + /// + /// + public sealed partial class DeleteTableSheetColumnResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + public bool? Success { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Number of stale cells on the sheet after downstream dependency propagation. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("stale_count")] + public int? StaleCount { get; set; } + + /// + /// Current sheet version_count after the column is deleted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("version")] + public int? Version { 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// Number of stale cells on the sheet after downstream dependency propagation. + /// + /// + /// Current sheet version_count after the column is deleted. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeleteTableSheetColumnResponse( + bool? success, + string? message, + int? staleCount, + int? version) + { + this.Success = success; + this.Message = message; + this.StaleCount = staleCount; + this.Version = version; + } + + /// + /// Initializes a new instance of the class. + /// + public DeleteTableSheetColumnResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetResponse.Json.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetResponse.Json.g.cs new file mode 100644 index 0000000..7949557 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace PromptLayer +{ + public sealed partial class DeleteTableSheetResponse + { + /// + /// 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 generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// 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) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::PromptLayer.DeleteTableSheetResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::PromptLayer.DeleteTableSheetResponse), + jsonSerializerContext) as global::PromptLayer.DeleteTableSheetResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::PromptLayer.DeleteTableSheetResponse? FromJson( + string json) + { + return FromJson( + json, + global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// 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::PromptLayer.DeleteTableSheetResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::PromptLayer.DeleteTableSheetResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::PromptLayer.DeleteTableSheetResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::PromptLayer.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream 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::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::PromptLayer.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetResponse.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetResponse.g.cs new file mode 100644 index 0000000..a656d7f --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.Models.DeleteTableSheetResponse.g.cs @@ -0,0 +1,53 @@ + +#nullable enable + +namespace PromptLayer +{ + /// + /// + /// + public sealed partial class DeleteTableSheetResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("success")] + public bool? Success { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { 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(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeleteTableSheetResponse( + bool? success, + string? message) + { + this.Success = success; + this.Message = message; + } + + /// + /// Initializes a new instance of the class. + /// + public DeleteTableSheetResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTable.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTable.g.cs new file mode 100644 index 0000000..1619e7a --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTable.g.cs @@ -0,0 +1,611 @@ + +#nullable enable + +namespace PromptLayer +{ + public partial class SmartTablesClient + { + + + private static readonly global::PromptLayer.EndPointSecurityRequirement s_DeleteTableSecurityRequirement0 = + new global::PromptLayer.EndPointSecurityRequirement + { + Authorizations = new global::PromptLayer.EndPointAuthorizationRequirement[] + { new global::PromptLayer.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApikeyXApiKey", + Location = "Header", + Name = "X-API-KEY", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::PromptLayer.EndPointSecurityRequirement[] s_DeleteTableSecurityRequirements = + new global::PromptLayer.EndPointSecurityRequirement[] + { s_DeleteTableSecurityRequirement0, + }; + partial void PrepareDeleteTableArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid tableId); + partial void PrepareDeleteTableRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid tableId); + partial void ProcessDeleteTableResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteTableResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Table
+ /// Delete a Table. This soft deletes the table and removes it from active list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteTableAsync( + global::System.Guid tableId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteTableAsResponseAsync( + tableId: tableId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Table
+ /// Delete a Table. This soft deletes the table and removes it from active list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteTableAsResponseAsync( + global::System.Guid tableId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteTableArguments( + httpClient: HttpClient, + tableId: ref tableId); + + + var __authorizations = global::PromptLayer.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteTableSecurityRequirements, + operationName: "DeleteTableAsync"); + + using var __timeoutCancellationTokenSource = global::PromptLayer.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::PromptLayer.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::PromptLayer.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::PromptLayer.PathBuilder( + path: $"/api/public/v2/tables/{tableId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::PromptLayer.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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" || + __authorization.Type == "OpenIdConnect") + { + __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); + } + } + global::PromptLayer.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteTableRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + tableId: tableId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTable", + methodName: "DeleteTableAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::PromptLayer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTable", + methodName: "DeleteTableAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::PromptLayer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::PromptLayer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::PromptLayer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTable", + methodName: "DeleteTableAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::PromptLayer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteTableResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTable", + methodName: "DeleteTableAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTable", + methodName: "DeleteTableAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized - missing or invalid API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::PromptLayer.ErrorResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::PromptLayer.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::PromptLayer.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Workspace access denied or missing delete permission + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::PromptLayer.ErrorResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::PromptLayer.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::PromptLayer.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Table not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::PromptLayer.ErrorResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::PromptLayer.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::PromptLayer.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation error - request parameters or body are invalid. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::PromptLayer.OneOf? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::PromptLayer.OneOf.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::PromptLayer.OneOf.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::PromptLayer.ApiException?>.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Failed to delete table + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::PromptLayer.ErrorResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::PromptLayer.ErrorResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::PromptLayer.ErrorResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteTableResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::PromptLayer.DeleteTableResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PromptLayer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PromptLayer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::PromptLayer.DeleteTableResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PromptLayer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PromptLayer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTableSheet.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTableSheet.g.cs new file mode 100644 index 0000000..3958f2d --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTableSheet.g.cs @@ -0,0 +1,620 @@ + +#nullable enable + +namespace PromptLayer +{ + public partial class SmartTablesClient + { + + + private static readonly global::PromptLayer.EndPointSecurityRequirement s_DeleteTableSheetSecurityRequirement0 = + new global::PromptLayer.EndPointSecurityRequirement + { + Authorizations = new global::PromptLayer.EndPointAuthorizationRequirement[] + { new global::PromptLayer.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApikeyXApiKey", + Location = "Header", + Name = "X-API-KEY", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::PromptLayer.EndPointSecurityRequirement[] s_DeleteTableSheetSecurityRequirements = + new global::PromptLayer.EndPointSecurityRequirement[] + { s_DeleteTableSheetSecurityRequirement0, + }; + partial void PrepareDeleteTableSheetArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid tableId, + ref global::System.Guid sheetId); + partial void PrepareDeleteTableSheetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid tableId, + global::System.Guid sheetId); + partial void ProcessDeleteTableSheetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteTableSheetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Sheet
+ /// Delete a sheet. This soft deletes the sheet and removes it from active sheet list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteTableSheetAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteTableSheetAsResponseAsync( + tableId: tableId, + sheetId: sheetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Sheet
+ /// Delete a sheet. This soft deletes the sheet and removes it from active sheet list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteTableSheetAsResponseAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteTableSheetArguments( + httpClient: HttpClient, + tableId: ref tableId, + sheetId: ref sheetId); + + + var __authorizations = global::PromptLayer.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteTableSheetSecurityRequirements, + operationName: "DeleteTableSheetAsync"); + + using var __timeoutCancellationTokenSource = global::PromptLayer.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::PromptLayer.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::PromptLayer.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::PromptLayer.PathBuilder( + path: $"/api/public/v2/tables/{tableId}/sheets/{sheetId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::PromptLayer.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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" || + __authorization.Type == "OpenIdConnect") + { + __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); + } + } + global::PromptLayer.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteTableSheetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + tableId: tableId!, + sheetId: sheetId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheet", + methodName: "DeleteTableSheetAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::PromptLayer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheet", + methodName: "DeleteTableSheetAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::PromptLayer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::PromptLayer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::PromptLayer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheet", + methodName: "DeleteTableSheetAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::PromptLayer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteTableSheetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheet", + methodName: "DeleteTableSheetAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheet", + methodName: "DeleteTableSheetAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized - missing or invalid API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::PromptLayer.ErrorResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::PromptLayer.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::PromptLayer.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Workspace access denied or missing edit permission + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::PromptLayer.ErrorResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::PromptLayer.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::PromptLayer.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Table or sheet not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::PromptLayer.ErrorResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::PromptLayer.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::PromptLayer.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation error - request parameters or body are invalid. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::PromptLayer.OneOf? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::PromptLayer.OneOf.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::PromptLayer.OneOf.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::PromptLayer.ApiException?>.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Failed to delete sheet + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::PromptLayer.ErrorResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::PromptLayer.ErrorResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::PromptLayer.ErrorResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteTableSheetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::PromptLayer.DeleteTableSheetResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PromptLayer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PromptLayer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::PromptLayer.DeleteTableSheetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PromptLayer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PromptLayer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTableSheetColumn.g.cs b/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTableSheetColumn.g.cs new file mode 100644 index 0000000..98ea675 --- /dev/null +++ b/src/libs/PromptLayer/Generated/PromptLayer.SmartTablesClient.DeleteTableSheetColumn.g.cs @@ -0,0 +1,666 @@ + +#nullable enable + +namespace PromptLayer +{ + public partial class SmartTablesClient + { + + + private static readonly global::PromptLayer.EndPointSecurityRequirement s_DeleteTableSheetColumnSecurityRequirement0 = + new global::PromptLayer.EndPointSecurityRequirement + { + Authorizations = new global::PromptLayer.EndPointAuthorizationRequirement[] + { new global::PromptLayer.EndPointAuthorizationRequirement + { + Type = "ApiKey", + SchemeId = "ApikeyXApiKey", + Location = "Header", + Name = "X-API-KEY", + FriendlyName = "ApiKeyInHeader", + }, + }, + }; + private static readonly global::PromptLayer.EndPointSecurityRequirement[] s_DeleteTableSheetColumnSecurityRequirements = + new global::PromptLayer.EndPointSecurityRequirement[] + { s_DeleteTableSheetColumnSecurityRequirement0, + }; + partial void PrepareDeleteTableSheetColumnArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.Guid tableId, + ref global::System.Guid sheetId, + ref global::System.Guid columnId); + partial void PrepareDeleteTableSheetColumnRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.Guid tableId, + global::System.Guid sheetId, + global::System.Guid columnId); + partial void ProcessDeleteTableSheetColumnResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteTableSheetColumnResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete Column
+ /// Delete a column and its cells. The operation creates a new sheet version and may mark downstream dependent cells as stale. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteTableSheetColumnAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::System.Guid columnId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteTableSheetColumnAsResponseAsync( + tableId: tableId, + sheetId: sheetId, + columnId: columnId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Column
+ /// Delete a column and its cells. The operation creates a new sheet version and may mark downstream dependent cells as stale. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace. + ///
+ /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> DeleteTableSheetColumnAsResponseAsync( + global::System.Guid tableId, + global::System.Guid sheetId, + global::System.Guid columnId, + global::PromptLayer.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteTableSheetColumnArguments( + httpClient: HttpClient, + tableId: ref tableId, + sheetId: ref sheetId, + columnId: ref columnId); + + + var __authorizations = global::PromptLayer.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteTableSheetColumnSecurityRequirements, + operationName: "DeleteTableSheetColumnAsync"); + + using var __timeoutCancellationTokenSource = global::PromptLayer.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::PromptLayer.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::PromptLayer.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::PromptLayer.PathBuilder( + path: $"/api/public/v2/tables/{tableId}/sheets/{sheetId}/columns/{columnId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::PromptLayer.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + 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" || + __authorization.Type == "OpenIdConnect") + { + __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); + } + } + global::PromptLayer.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteTableSheetColumnRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + tableId: tableId!, + sheetId: sheetId!, + columnId: columnId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheetColumn", + methodName: "DeleteTableSheetColumnAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}/columns/{columnId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::PromptLayer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheetColumn", + methodName: "DeleteTableSheetColumnAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}/columns/{columnId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::PromptLayer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::PromptLayer.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::PromptLayer.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheetColumn", + methodName: "DeleteTableSheetColumnAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}/columns/{columnId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::PromptLayer.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteTableSheetColumnResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheetColumn", + methodName: "DeleteTableSheetColumnAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}/columns/{columnId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::PromptLayer.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PromptLayer.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteTableSheetColumn", + methodName: "DeleteTableSheetColumnAsync", + pathTemplate: "$\"/api/public/v2/tables/{tableId}/sheets/{sheetId}/columns/{columnId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Column cannot be deleted or stored score configuration is invalid + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::PromptLayer.ErrorResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::PromptLayer.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::PromptLayer.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized - missing or invalid API key. + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::PromptLayer.ErrorResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::PromptLayer.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::PromptLayer.ErrorResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Workspace access denied or missing edit permission + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::PromptLayer.ErrorResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::PromptLayer.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::PromptLayer.ErrorResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Table, sheet, or column not found + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::PromptLayer.ErrorResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::PromptLayer.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::PromptLayer.ErrorResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Validation error - request parameters or body are invalid. + if ((int)__response.StatusCode == 422) + { + string? __content_422 = null; + global::System.Exception? __exception_422 = null; + global::PromptLayer.OneOf? __value_422 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_422 = global::PromptLayer.OneOf.FromJson(__content_422, JsonSerializerContext); + } + else + { + __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_422 = global::PromptLayer.OneOf.FromJson(__content_422, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_422 = __ex; + } + + + throw global::PromptLayer.ApiException?>.Create( + statusCode: __response.StatusCode, + message: __content_422 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_422, + responseBody: __content_422, + responseObject: __value_422, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Failed to delete column + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::PromptLayer.ErrorResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::PromptLayer.ErrorResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::PromptLayer.ErrorResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteTableSheetColumnResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::PromptLayer.DeleteTableSheetColumnResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PromptLayer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PromptLayer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::PromptLayer.DeleteTableSheetColumnResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PromptLayer.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PromptLayer.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::PromptLayer.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/PromptLayer/openapi.json b/src/libs/PromptLayer/openapi.json index 63b29eb..1a0b2eb 100644 --- a/src/libs/PromptLayer/openapi.json +++ b/src/libs/PromptLayer/openapi.json @@ -10111,6 +10111,81 @@ } }, "description": "Update Table. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace." + }, + "delete": { + "tags": [ + "smart-tables" + ], + "summary": "Delete Table", + "description": "Delete a Table. This soft deletes the table and removes it from active list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace.", + "operationId": "delete_table", + "parameters": [ + { + "name": "table_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Table deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "message": { + "type": "string" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "description": "Workspace access denied or missing delete permission", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Table not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "$ref": "#/components/responses/ValidationError" + }, + "500": { + "description": "Failed to delete table", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } } }, "/api/public/v2/tables/{table_id}/sheets": { @@ -10621,6 +10696,90 @@ } }, "description": "Update Sheet. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace." + }, + "delete": { + "tags": [ + "smart-tables" + ], + "summary": "Delete Sheet", + "description": "Delete a sheet. This soft deletes the sheet and removes it from active sheet list responses. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace.", + "operationId": "delete_table_sheet", + "parameters": [ + { + "name": "table_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "sheet_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Sheet deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "message": { + "type": "string" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "description": "Workspace access denied or missing edit permission", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Table or sheet not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "$ref": "#/components/responses/ValidationError" + }, + "500": { + "description": "Failed to delete sheet", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } } }, "/api/public/v2/tables/{table_id}/sheets/{sheet_id}/columns": { @@ -11013,6 +11172,117 @@ } } } + }, + "delete": { + "tags": [ + "smart-tables" + ], + "summary": "Delete Column", + "description": "Delete a column and its cells. The operation creates a new sheet version and may mark downstream dependent cells as stale. Requests are scoped to the workspace associated with the API key; table, sheet, column, cell, operation, and version IDs must belong to that workspace.", + "operationId": "delete_table_sheet_column", + "parameters": [ + { + "name": "table_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "sheet_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "column_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Column deleted", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "message": { + "type": "string" + }, + "stale_count": { + "type": "integer", + "description": "Number of stale cells on the sheet after downstream dependency propagation." + }, + "version": { + "type": "integer", + "description": "Current sheet version_count after the column is deleted." + } + } + } + } + } + }, + "400": { + "description": "Column cannot be deleted or stored score configuration is invalid", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "$ref": "#/components/responses/UnauthorizedError" + }, + "403": { + "description": "Workspace access denied or missing edit permission", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Table, sheet, or column not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "422": { + "$ref": "#/components/responses/ValidationError" + }, + "500": { + "description": "Failed to delete column", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } } }, "/api/public/v2/tables/{table_id}/sheets/{sheet_id}/rows": {