Skip to content

Commit 5310401

Browse files
committed
Fix CELLSCLOUD-10202(Document request parameter of Convert API)
1 parent afeec20 commit 5310401

File tree

6 files changed

+54
-21
lines changed

6 files changed

+54
-21
lines changed

Aspose.Cells.Cloud.SDK.Test/Api/CellsWorkbookApiTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,14 @@ public void CellsWorkbookPostWorkbooksTextSearchTest()
461461
public void CellsWorkbookPutConvertWorkBookTest()
462462
{
463463
// TODO uncomment below to test the method and replace null with proper value
464-
string format = "xlsx";
464+
string workbook = BOOK1;
465+
string format = "pdf";
465466
string password = null;
466467
string outPath = null;
467468
UpdateDataFile(TEMPFOLDER, BOOK1);
468-
var response = instance.CellsWorkbookPutConvertWorkbook(format, password, outPath);
469+
var response = instance.CellsWorkbookPutConvertWorkbook(GetTestDataByteArray(workbook),format, password, outPath);
469470
Assert.IsInstanceOf<System.IO.Stream>(response, "response is System.IO.Stream");
470-
471+
//WriteResponseStream(workbook + "." + format, response);
471472
}
472473

473474
/// <summary>

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

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,12 @@ public interface ICellsWorkbookApi : IApiAccessor
668668
///
669669
/// </remarks>
670670
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
671+
/// <param name="workbook"></param>
671672
/// <param name="format">The format to convert. (optional)</param>
672673
/// <param name="password">The workbook password. (optional)</param>
673674
/// <param name="outPath">Path to save result (optional)</param>
674675
/// <returns>System.IO.Stream</returns>
675-
System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, string password = null, string outPath = null);
676+
System.IO.Stream CellsWorkbookPutConvertWorkbook (byte[] workbook, string format = null, string password = null, string outPath = null);
676677

677678
/// <summary>
678679
/// Convert workbook from request content to some format.
@@ -681,11 +682,12 @@ public interface ICellsWorkbookApi : IApiAccessor
681682
///
682683
/// </remarks>
683684
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
685+
/// <param name="workbook"></param>
684686
/// <param name="format">The format to convert. (optional)</param>
685687
/// <param name="password">The workbook password. (optional)</param>
686688
/// <param name="outPath">Path to save result (optional)</param>
687689
/// <returns>ApiResponse of System.IO.Stream</returns>
688-
ApiResponse<System.IO.Stream> CellsWorkbookPutConvertWorkbookWithHttpInfo (string format = null, string password = null, string outPath = null);
690+
ApiResponse<System.IO.Stream> CellsWorkbookPutConvertWorkbookWithHttpInfo (byte[] workbook, string format = null, string password = null, string outPath = null);
689691
/// <summary>
690692
/// Protect document from changes.
691693
/// </summary>
@@ -1388,11 +1390,12 @@ public interface ICellsWorkbookApi : IApiAccessor
13881390
///
13891391
/// </remarks>
13901392
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
1393+
/// <param name="workbook"></param>
13911394
/// <param name="format">The format to convert. (optional)</param>
13921395
/// <param name="password">The workbook password. (optional)</param>
13931396
/// <param name="outPath">Path to save result (optional)</param>
13941397
/// <returns>Task of System.IO.Stream</returns>
1395-
System.Threading.Tasks.Task<System.IO.Stream> CellsWorkbookPutConvertWorkbookAsync (string format = null, string password = null, string outPath = null);
1398+
System.Threading.Tasks.Task<System.IO.Stream> CellsWorkbookPutConvertWorkbookAsync (byte[] workbook, string format = null, string password = null, string outPath = null);
13961399

13971400
/// <summary>
13981401
/// Convert workbook from request content to some format.
@@ -1401,11 +1404,12 @@ public interface ICellsWorkbookApi : IApiAccessor
14011404
///
14021405
/// </remarks>
14031406
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
1407+
/// <param name="workbook"></param>
14041408
/// <param name="format">The format to convert. (optional)</param>
14051409
/// <param name="password">The workbook password. (optional)</param>
14061410
/// <param name="outPath">Path to save result (optional)</param>
14071411
/// <returns>Task of ApiResponse (System.IO.Stream)</returns>
1408-
System.Threading.Tasks.Task<ApiResponse<System.IO.Stream>> CellsWorkbookPutConvertWorkbookAsyncWithHttpInfo (string format = null, string password = null, string outPath = null);
1412+
System.Threading.Tasks.Task<ApiResponse<System.IO.Stream>> CellsWorkbookPutConvertWorkbookAsyncWithHttpInfo (byte[] workbook, string format = null, string password = null, string outPath = null);
14091413
/// <summary>
14101414
/// Protect document from changes.
14111415
/// </summary>
@@ -5346,26 +5350,31 @@ public async System.Threading.Tasks.Task<ApiResponse<TextItemsResponse>> CellsWo
53465350
/// Convert workbook from request content to some format.
53475351
/// </summary>
53485352
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
5353+
/// <param name="workbook"></param>
53495354
/// <param name="format">The format to convert. (optional)</param>
53505355
/// <param name="password">The workbook password. (optional)</param>
53515356
/// <param name="outPath">Path to save result (optional)</param>
53525357
/// <returns>System.IO.Stream</returns>
5353-
public System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, string password = null, string outPath = null)
5358+
public System.IO.Stream CellsWorkbookPutConvertWorkbook (byte[] workbook, string format = null, string password = null, string outPath = null)
53545359
{
5355-
ApiResponse<System.IO.Stream> localVarResponse = CellsWorkbookPutConvertWorkbookWithHttpInfo(format, password, outPath);
5360+
ApiResponse<System.IO.Stream> localVarResponse = CellsWorkbookPutConvertWorkbookWithHttpInfo(workbook, format, password, outPath);
53565361
return localVarResponse.Data;
53575362
}
53585363

53595364
/// <summary>
53605365
/// Convert workbook from request content to some format.
53615366
/// </summary>
53625367
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
5368+
/// <param name="workbook"></param>
53635369
/// <param name="format">The format to convert. (optional)</param>
53645370
/// <param name="password">The workbook password. (optional)</param>
53655371
/// <param name="outPath">Path to save result (optional)</param>
53665372
/// <returns>ApiResponse of System.IO.Stream</returns>
5367-
public ApiResponse< System.IO.Stream > CellsWorkbookPutConvertWorkbookWithHttpInfo (string format = null, string password = null, string outPath = null)
5373+
public ApiResponse< System.IO.Stream > CellsWorkbookPutConvertWorkbookWithHttpInfo (byte[] workbook, string format = null, string password = null, string outPath = null)
53685374
{
5375+
// verify the required parameter 'workbook' is set
5376+
if (workbook == null)
5377+
throw new ApiException(400, "Missing required parameter 'workbook' when calling CellsWorkbookApi->CellsWorkbookPutConvertWorkbook");
53695378

53705379
var localVarPath = "/cells/convert";
53715380
var localVarPathParams = new Dictionary<String, String>();
@@ -5392,6 +5401,14 @@ public System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, s
53925401
if (format != null) localVarQueryParams.Add("format", Configuration.ApiClient.ParameterToString(format)); // query parameter
53935402
if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter
53945403
if (outPath != null) localVarQueryParams.Add("outPath", Configuration.ApiClient.ParameterToString(outPath)); // query parameter
5404+
if (workbook != null && workbook.GetType() != typeof(byte[]))
5405+
{
5406+
localVarPostBody = Configuration.ApiClient.Serialize(workbook); // http body (model) parameter
5407+
}
5408+
else
5409+
{
5410+
localVarPostBody = workbook; // byte array
5411+
}
53955412

53965413

53975414
// make the HTTP request
@@ -5416,13 +5433,14 @@ public System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, s
54165433
/// Convert workbook from request content to some format.
54175434
/// </summary>
54185435
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
5436+
/// <param name="workbook"></param>
54195437
/// <param name="format">The format to convert. (optional)</param>
54205438
/// <param name="password">The workbook password. (optional)</param>
54215439
/// <param name="outPath">Path to save result (optional)</param>
54225440
/// <returns>Task of System.IO.Stream</returns>
5423-
public async System.Threading.Tasks.Task<System.IO.Stream> CellsWorkbookPutConvertWorkbookAsync (string format = null, string password = null, string outPath = null)
5441+
public async System.Threading.Tasks.Task<System.IO.Stream> CellsWorkbookPutConvertWorkbookAsync (byte[] workbook, string format = null, string password = null, string outPath = null)
54245442
{
5425-
ApiResponse<System.IO.Stream> localVarResponse = await CellsWorkbookPutConvertWorkbookAsyncWithHttpInfo(format, password, outPath);
5443+
ApiResponse<System.IO.Stream> localVarResponse = await CellsWorkbookPutConvertWorkbookAsyncWithHttpInfo(workbook, format, password, outPath);
54265444
return localVarResponse.Data;
54275445

54285446
}
@@ -5431,12 +5449,16 @@ public System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, s
54315449
/// Convert workbook from request content to some format.
54325450
/// </summary>
54335451
/// <exception cref="Aspose.Cells.Cloud.SDK.Client.ApiException">Thrown when fails to make API call</exception>
5452+
/// <param name="workbook"></param>
54345453
/// <param name="format">The format to convert. (optional)</param>
54355454
/// <param name="password">The workbook password. (optional)</param>
54365455
/// <param name="outPath">Path to save result (optional)</param>
54375456
/// <returns>Task of ApiResponse (System.IO.Stream)</returns>
5438-
public async System.Threading.Tasks.Task<ApiResponse<System.IO.Stream>> CellsWorkbookPutConvertWorkbookAsyncWithHttpInfo (string format = null, string password = null, string outPath = null)
5457+
public async System.Threading.Tasks.Task<ApiResponse<System.IO.Stream>> CellsWorkbookPutConvertWorkbookAsyncWithHttpInfo (byte[] workbook, string format = null, string password = null, string outPath = null)
54395458
{
5459+
// verify the required parameter 'workbook' is set
5460+
if (workbook == null)
5461+
throw new ApiException(400, "Missing required parameter 'workbook' when calling CellsWorkbookApi->CellsWorkbookPutConvertWorkbook");
54405462

54415463
var localVarPath = "/cells/convert";
54425464
var localVarPathParams = new Dictionary<String, String>();
@@ -5463,6 +5485,14 @@ public System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, s
54635485
if (format != null) localVarQueryParams.Add("format", Configuration.ApiClient.ParameterToString(format)); // query parameter
54645486
if (password != null) localVarQueryParams.Add("password", Configuration.ApiClient.ParameterToString(password)); // query parameter
54655487
if (outPath != null) localVarQueryParams.Add("outPath", Configuration.ApiClient.ParameterToString(outPath)); // query parameter
5488+
if (workbook != null && workbook.GetType() != typeof(byte[]))
5489+
{
5490+
localVarPostBody = Configuration.ApiClient.Serialize(workbook); // http body (model) parameter
5491+
}
5492+
else
5493+
{
5494+
localVarPostBody = workbook; // byte array
5495+
}
54665496

54675497

54685498
// make the HTTP request

Aspose.Cells.Cloud.SDK/Client/Configuration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public Configuration(ApiClient apiClient = null,
4646
string tempFolderPath = null,
4747
string dateTimeFormat = null,
4848
int timeout = 100000,
49-
string userAgent = "Swagger-Codegen/19.2/csharp"
49+
string userAgent = "Swagger-Codegen/19.2.1/csharp"
5050
)
5151
{
5252
setApiClientUsingDefault(apiClient);
@@ -81,7 +81,7 @@ public Configuration(ApiClient apiClient)
8181
/// Version of the package.
8282
/// </summary>
8383
/// <value>Version of the package.</value>
84-
public const string Version = "19.2";
84+
public const string Version = "19.2.1";
8585

8686
/// <summary>
8787
/// Gets or sets the default Configuration.
@@ -326,7 +326,7 @@ public static String ToDebugReport()
326326
.GetReferencedAssemblies()
327327
.Where(x => x.Name == "System.Core").First().Version.ToString() + "\n";
328328
report += " Version of the API: 1.0\n";
329-
report += " SDK Package Version: 19.2\n";
329+
report += " SDK Package Version: 19.2.1\n";
330330

331331
return report;
332332
}

Aspose.Cells.Cloud.SDK/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
// You can specify all the values or you can default the Build and Revision Numbers
2929
// by using the '*' as shown below:
3030
// [assembly: AssemblyVersion("1.0.*")]
31-
[assembly: AssemblyVersion("19.2")]
32-
[assembly: AssemblyFileVersion("19.2")]
31+
[assembly: AssemblyVersion("19.2.1")]
32+
[assembly: AssemblyFileVersion("19.2.1")]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ No description provided (generated by Swagger Codegen https://github.com/swagger
55
This C# SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
66

77
- API version: 1.0
8-
- SDK version: 19.2
8+
- SDK version: 19.2.1
99
- Build package: io.swagger.codegen.languages.CSharpClientCodegen
1010

1111
<a name="frameworks-supported"></a>

docs/CellsWorkbookApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ No authorization required
15441544

15451545
<a name="cellsworkbookputconvertworkbook"></a>
15461546
# **CellsWorkbookPutConvertWorkbook**
1547-
> System.IO.Stream CellsWorkbookPutConvertWorkbook (string format = null, string password = null, string outPath = null)
1547+
> System.IO.Stream CellsWorkbookPutConvertWorkbook (byte[] workbook, string format = null, string password = null, string outPath = null)
15481548
15491549
Convert workbook from request content to some format.
15501550

@@ -1563,14 +1563,15 @@ namespace Example
15631563
public void main()
15641564
{
15651565
var apiInstance = new CellsWorkbookApi();
1566+
var workbook = BINARY_DATA_HERE; // byte[] |
15661567
var format = format_example; // string | The format to convert. (optional)
15671568
var password = password_example; // string | The workbook password. (optional)
15681569
var outPath = outPath_example; // string | Path to save result (optional)
15691570
15701571
try
15711572
{
15721573
// Convert workbook from request content to some format.
1573-
System.IO.Stream result = apiInstance.CellsWorkbookPutConvertWorkbook(format, password, outPath);
1574+
System.IO.Stream result = apiInstance.CellsWorkbookPutConvertWorkbook(workbook, format, password, outPath);
15741575
Debug.WriteLine(result);
15751576
}
15761577
catch (Exception e)
@@ -1586,6 +1587,7 @@ namespace Example
15861587

15871588
Name | Type | Description | Notes
15881589
------------- | ------------- | ------------- | -------------
1590+
**workbook** | **byte[]**| |
15891591
**format** | **string**| The format to convert. | [optional]
15901592
**password** | **string**| The workbook password. | [optional]
15911593
**outPath** | **string**| Path to save result | [optional]

0 commit comments

Comments
 (0)