Skip to content

Commit f253929

Browse files
committed
Add repair api.
1 parent da8c24f commit f253929

File tree

4 files changed

+133
-12
lines changed

4 files changed

+133
-12
lines changed

Aspose.Cells.Cloud.SDK/Api/CellsApiPartials2.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,10 +1656,20 @@ public FilesResult PostReverse(PostReverseRequest request)
16561656

16571657

16581658

1659+
/// <summary>
1660+
/// </summary>
1661+
/// <param name="request">Request. <see cref="PostRepairRequest" /></param>
1662+
public FilesResult PostRepair(PostRepairRequest request)
1663+
{
1664+
requestHandlers.ForEach(p => p.ProcessUrl(""));
1665+
var result = invoker.InvokeApiAsync<FilesResult>(request.CreateHttpRequest(BaseUri + "/" + Version, this.invoker.DefaultHeaderMap, this.requestHandlers)).Result;
1666+
return result;
1667+
}
1668+
16591669
/// <summary>
16601670
/// </summary>
16611671
/// <param name="request">Request. <see cref="PostRotateRequest" /></param>
1662-
public FilesResult PostRotate(PostRotateRequest request)
1672+
public FilesResult PostRotate(PostRotateRequest request)
16631673
{
16641674
requestHandlers.ForEach(p => p.ProcessUrl(""));
16651675
var result = invoker.InvokeApiAsync< FilesResult >(request.CreateHttpRequest(BaseUri +"/" +Version, this.invoker.DefaultHeaderMap, this.requestHandlers)).Result;

Aspose.Cells.Cloud.SDK/Aspose.Cells.Cloud.SDK.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
<Company>Aspose</Company>
1212
<AssemblyTitle>Aspose.Cells Cloud SDK for .NET</AssemblyTitle>
1313
<Description>A powerful and fast Aspose.Cells cloud SDK library written in C# for manipulating and converting Excel(XLS, XLSX,XLSB), ODS, CSV,JSON and HTML files.</Description>
14-
<PackageReleaseNotes>https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/releases/tag/23.6</PackageReleaseNotes>
14+
<PackageReleaseNotes>https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/releases/tag/23.7</PackageReleaseNotes>
1515
<PackageTags>Cloud REST API Excel XLS XLSX XLSB CSV to PDF JPG PNG HTML ODS Numbers XLSM OOXML Spreadsheet Markdown XPS DOCX PPTX MHTML JSON SVG TIFF</PackageTags>
1616
<RepositoryURL>https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/</RepositoryURL>
1717
<RepositoryType>GitHub</RepositoryType>
1818
<Copyright>MIT</Copyright>
1919
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings>
20-
<AssemblyVersion>23.6</AssemblyVersion>
21-
<FileVersion>23.6</FileVersion>
22-
<Version>23.6</Version>
20+
<AssemblyVersion>23.7</AssemblyVersion>
21+
<FileVersion>23.7</FileVersion>
22+
<Version>23.7</Version>
2323
<PackageReadmeFile>README.md</PackageReadmeFile>
2424
</PropertyGroup>
2525

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// --------------------------------------------------------------------------------------------------------------------
2+
// <copyright company="Aspose" file="PostRepairRequest.cs">
3+
// Copyright (c) 2023 Aspose.Cells Cloud
4+
// </copyright>
5+
// <summary>
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files (the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions:
12+
//
13+
// The above copyright notice and this permission notice shall be included in all
14+
// copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
// SOFTWARE.
23+
// </summary>
24+
// --------------------------------------------------------------------------------------------------------------------
25+
26+
namespace Aspose.Cells.Cloud.SDK.Request
27+
{
28+
using Aspose.Cells.Cloud.SDK.Model;
29+
using Newtonsoft.Json;
30+
using System.Collections.Generic;
31+
using System.Net;
32+
using System.Text.RegularExpressions;
33+
34+
/// <summary>
35+
/// Request model for <see cref="Aspose.Cells.Cloud.SDK.Api.CellsApi.PostRepair" /> operation.
36+
/// </summary>
37+
public class PostRepairRequest : IRequestModel
38+
{
39+
/// <summary>
40+
/// Initializes a new instance of the <see cref="PostRepairRequest"/> class.
41+
/// </summary>
42+
public PostRepairRequest()
43+
{
44+
45+
}
46+
47+
/// <summary>
48+
/// Initializes a new instance of the <see cref="PostRepairRequest"/> class.
49+
/// </summary>
50+
/// <param name="file">File to upload</param>
51+
/// <param name="format"></param>
52+
public PostRepairRequest(IDictionary<string, System.IO.Stream> file, string format = null)
53+
{
54+
this.File = file;
55+
this.format = format;
56+
}
57+
58+
/// <summary>
59+
/// File to upload
60+
/// </summary>
61+
public IDictionary<string, System.IO.Stream> File { get; set; }
62+
63+
/// <summary>
64+
/// Gets or sets format.
65+
/// </summary>
66+
public string format { get; set; }
67+
68+
69+
/// <summary>
70+
/// Gets or sets extendQueryParameterMap.
71+
/// </summary>
72+
public IDictionary<string, string> extendQueryParameterMap ;
73+
74+
/// <summary>
75+
/// Creates the http request based on this request.
76+
/// </summary>
77+
/// <param name="baseUri">Api base uri.</param>
78+
/// <returns>The http request instance.</returns>
79+
public HttpWebRequest CreateHttpRequest(string baseUri,IDictionary<string, string> defaultHeaderMap, List<Invoker.IRequestHandler> requestHandlers)
80+
{
81+
var localVarHeaderParams = new Dictionary<string, string>();
82+
var localVarFileParams = new Dictionary<string, object>();
83+
string localVarPostBody ="";
84+
string localVarHttpContentType = "application/json";
85+
// verify the required parameter 'file' is set
86+
if ( this.File == null)
87+
{
88+
throw new ApiException(400, "Missing required parameter 'file' when calling PostRepair");
89+
}
90+
91+
var path = baseUri + "/cells/repair";
92+
path = Regex
93+
.Replace(path, "\\*", string.Empty)
94+
.Replace("&amp;", "&")
95+
.Replace("/?", "?");
96+
97+
if (!string.IsNullOrEmpty(this.format)) path = UrlHelper.AddQueryParameterToUrl(path, "format", this.format);
98+
if (this.extendQueryParameterMap != null)
99+
{
100+
foreach (KeyValuePair<string, string> kvp in extendQueryParameterMap)
101+
{
102+
UrlHelper.AddQueryParameterToUrl(path, kvp.Key, kvp.Value);
103+
}
104+
}
105+
106+
if( File !=null ){
107+
foreach (KeyValuePair<string, System.IO.Stream> keyValueFileParam in File )
108+
{
109+
localVarFileParams.Add(keyValueFileParam.Key, UrlHelper.ToFileInfo(keyValueFileParam.Value, keyValueFileParam.Key));
110+
}
111+
}
112+
return UrlHelper.PrepareRequest(path, "POST", localVarFileParams, localVarHeaderParams, localVarPostBody, localVarHttpContentType, defaultHeaderMap, requestHandlers);
113+
}
114+
}
115+
}

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Nuget](https://img.shields.io/nuget/v/Aspose.Cells-Cloud) ![Nuget](https://img.shields.io/nuget/dt/Aspose.Cells-Cloud) ![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-dotnet)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-dotnet/23.6)
1+
![Nuget](https://img.shields.io/nuget/v/Aspose.Cells-Cloud) ![Nuget](https://img.shields.io/nuget/dt/Aspose.Cells-Cloud) ![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-dotnet)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-dotnet/23.7)
22

33
# .NET SDK for Spreadsheet Processing in the Cloud
44

@@ -21,13 +21,9 @@ The Cloud SDK enhances your C#, ASP.NET, & other .NET-based cloud apps to [proce
2121
- [Leverage the power of Pivot Tables](https://docs.aspose.cloud/cells/working-with-pivot-tables/) & Ranges.
2222

2323

24-
## Feature & Enhancements in Version 23.6
24+
## Feature & Enhancements in Version 23.7
2525

26-
- Support to batch lock multi-files.
27-
- Support to batch unlock multi-files.
28-
- Support to protect lock multi-files.
29-
- Support to split lock multi-files.
30-
- Fix put document property api.
26+
- Support to repair API.
3127

3228
## Read & Write Spreadsheet Formats
3329

0 commit comments

Comments
 (0)