Skip to content

Commit f8791fc

Browse files
committed
2 parents 2091318 + 6085bbb commit f8791fc

File tree

254 files changed

+516
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+516
-267
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
- Fetch the required shape from worksheet.
2121
- Leverage the power of named ranges.
2222

23-
## Enhancements in Version 20.11
23+
## Feature & Enhancements in Version 21.1
2424

25-
- Support Aspose.Cells Cloud for Docker.
25+
- Support to convert worksheet on task API
26+
- Support to add and delete cell or range in worksheet.
2627

2728
## Read & Write Spreadsheet Formats
2829

@@ -57,7 +58,7 @@ First, create an account at [Aspose for Cloud](https://dashboard.aspose.cloud/#/
5758

5859
```golang
5960
func GetDocumentCircleAnnotations() (CircleAnnotationsResponse, *http.Response, error) {
60-
cellsAPI := NewCellsApiService("clientId", "clientSecret", "https://api.aspose.cloud","v3.0")
61+
cellsAPI := NewCellsApiService("AppSid", "AppKey", "https://api.aspose.cloud","v3.0")
6162
name := "Book1.xlsx"
6263

6364
args := new(UploadFileOpts)

api_cells.go

Lines changed: 178 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights
@@ -31,15 +31,15 @@ import (
3131
"os"
3232
)
3333
func Version() {
34-
fmt.Println("---Version: 20.11.0---")
34+
fmt.Println("---Version: 21.1.0---")
3535
}
3636

3737
/* Create Instance of CellsApiService
38-
@param clientId string Client Id
39-
@param clientSecret string Client Secret
38+
@param appSid string Application SID
39+
@param appKey string Application Key
4040
@param basePath string Base service path. Set "" for default
4141
@return *CellsApiService */
42-
func NewCellsApiService(clientId string, clientSecret string, opts ...string) *CellsApiService {
42+
func NewCellsApiService(appSid string, appKey string, opts ...string) *CellsApiService {
4343
var basePath = ""
4444
var version = ""
4545
for i, v := range opts {
@@ -50,7 +50,7 @@ func Version() {
5050
version = v
5151
}
5252
}
53-
config := NewConfiguration(clientId, clientSecret, basePath, version)
53+
config := NewConfiguration(appSid, appKey, basePath, version)
5454
client := NewAPIClient(config)
5555
return client.CellsApi
5656
}
@@ -13379,6 +13379,91 @@ func (a *CellsApiService) CellsPutInsertWorksheetRows( localVarOptionals *Cel
1337913379
return localVarReturnValue, localVarHttpResponse, err
1338013380
}
1338113381

13382+
/*
13383+
CellsApiService Delete range in the worksheet
13384+
* @param name workbook name
13385+
* @param sheetName worksheet name
13386+
* @param range_ range
13387+
* @param shift Represent the shift options when deleting a range of cells. (Left,Up)
13388+
* @param optional nil or *CellsRangesDeleteWorksheetCellsRangeOpts - Optional Parameters:
13389+
* @param "Folder" (optional.String) - Workbook folder.
13390+
* @param "StorageName" (optional.String) - storage name.
13391+
13392+
@return CellsCloudResponse
13393+
*/
13394+
13395+
13396+
type CellsRangesDeleteWorksheetCellsRangeOpts struct {
13397+
Name string
13398+
SheetName string
13399+
Range_ string
13400+
Shift string
13401+
Folder string
13402+
StorageName string
13403+
}
13404+
13405+
13406+
func (a *CellsApiService) CellsRangesDeleteWorksheetCellsRange( localVarOptionals *CellsRangesDeleteWorksheetCellsRangeOpts) (CellsCloudResponse, *http.Response, error) {
13407+
var (
13408+
localVarHttpMethod = strings.ToUpper("Delete")
13409+
localVarPostBody interface{}
13410+
localVarFileName string
13411+
localVarFileBytes []byte
13412+
localVarReturnValue CellsCloudResponse
13413+
)
13414+
13415+
// create path and map variables
13416+
localVarPath := a.client.cfg.BasePath + "/" + a.client.cfg.Version + "/cells/{name}/worksheets/{sheetName}/ranges"
13417+
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", localVarOptionals.Name), -1)
13418+
localVarPath = strings.Replace(localVarPath, "{"+"sheetName"+"}", fmt.Sprintf("%v", localVarOptionals.SheetName), -1)
13419+
13420+
localVarHeaderParams := make(map[string]string)
13421+
localVarQueryParams := url.Values{}
13422+
localVarFormParams := url.Values{}
13423+
13424+
localVarQueryParams.Add("range", parameterToString(localVarOptionals.Range_, ""))
13425+
localVarQueryParams.Add("shift", parameterToString(localVarOptionals.Shift, ""))
13426+
if localVarOptionals != nil {
13427+
localVarQueryParams.Add("folder", parameterToString(localVarOptionals.Folder, ""))
13428+
}
13429+
if localVarOptionals != nil {
13430+
localVarQueryParams.Add("storageName", parameterToString(localVarOptionals.StorageName, ""))
13431+
}
13432+
// to determine the Content-Type header
13433+
localVarHttpContentTypes := []string{"application/json"}
13434+
13435+
// set Content-Type header
13436+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
13437+
if localVarHttpContentType != "" {
13438+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
13439+
}
13440+
13441+
// to determine the Accept header
13442+
localVarHttpHeaderAccepts := []string{"application/json"}
13443+
13444+
// set Accept header
13445+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
13446+
if localVarHttpHeaderAccept != "" {
13447+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
13448+
}
13449+
r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
13450+
if err != nil {
13451+
return localVarReturnValue, nil, err
13452+
}
13453+
13454+
localVarHttpResponse, err := a.client.callAPI(r)
13455+
if err != nil || localVarHttpResponse == nil {
13456+
return localVarReturnValue, localVarHttpResponse, err
13457+
}
13458+
defer localVarHttpResponse.Body.Close()
13459+
if localVarHttpResponse.StatusCode >= 300 {
13460+
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
13461+
return localVarReturnValue, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
13462+
}
13463+
13464+
return localVarReturnValue, localVarHttpResponse, err
13465+
}
13466+
1338213467
/*
1338313468
CellsApiService Get cells list in a range by range name or row column indexes
1338413469
* @param name workbook name
@@ -14282,6 +14367,91 @@ func (a *CellsApiService) CellsRangesPostWorksheetCellsRanges( localVarOption
1428214367
return localVarReturnValue, localVarHttpResponse, err
1428314368
}
1428414369

14370+
/*
14371+
CellsApiService Insert range in the worksheet
14372+
* @param name workbook name
14373+
* @param sheetName worksheet name
14374+
* @param range_ range
14375+
* @param shift Represent the shift options when deleting a range of cells. (Right,Down)
14376+
* @param optional nil or *CellsRangesPutWorksheetCellsRangeOpts - Optional Parameters:
14377+
* @param "Folder" (optional.String) - Workbook folder.
14378+
* @param "StorageName" (optional.String) - storage name.
14379+
14380+
@return CellsCloudResponse
14381+
*/
14382+
14383+
14384+
type CellsRangesPutWorksheetCellsRangeOpts struct {
14385+
Name string
14386+
SheetName string
14387+
Range_ string
14388+
Shift string
14389+
Folder string
14390+
StorageName string
14391+
}
14392+
14393+
14394+
func (a *CellsApiService) CellsRangesPutWorksheetCellsRange( localVarOptionals *CellsRangesPutWorksheetCellsRangeOpts) (CellsCloudResponse, *http.Response, error) {
14395+
var (
14396+
localVarHttpMethod = strings.ToUpper("Put")
14397+
localVarPostBody interface{}
14398+
localVarFileName string
14399+
localVarFileBytes []byte
14400+
localVarReturnValue CellsCloudResponse
14401+
)
14402+
14403+
// create path and map variables
14404+
localVarPath := a.client.cfg.BasePath + "/" + a.client.cfg.Version + "/cells/{name}/worksheets/{sheetName}/ranges"
14405+
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", localVarOptionals.Name), -1)
14406+
localVarPath = strings.Replace(localVarPath, "{"+"sheetName"+"}", fmt.Sprintf("%v", localVarOptionals.SheetName), -1)
14407+
14408+
localVarHeaderParams := make(map[string]string)
14409+
localVarQueryParams := url.Values{}
14410+
localVarFormParams := url.Values{}
14411+
14412+
localVarQueryParams.Add("range", parameterToString(localVarOptionals.Range_, ""))
14413+
localVarQueryParams.Add("shift", parameterToString(localVarOptionals.Shift, ""))
14414+
if localVarOptionals != nil {
14415+
localVarQueryParams.Add("folder", parameterToString(localVarOptionals.Folder, ""))
14416+
}
14417+
if localVarOptionals != nil {
14418+
localVarQueryParams.Add("storageName", parameterToString(localVarOptionals.StorageName, ""))
14419+
}
14420+
// to determine the Content-Type header
14421+
localVarHttpContentTypes := []string{"application/json"}
14422+
14423+
// set Content-Type header
14424+
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
14425+
if localVarHttpContentType != "" {
14426+
localVarHeaderParams["Content-Type"] = localVarHttpContentType
14427+
}
14428+
14429+
// to determine the Accept header
14430+
localVarHttpHeaderAccepts := []string{"application/json"}
14431+
14432+
// set Accept header
14433+
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
14434+
if localVarHttpHeaderAccept != "" {
14435+
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
14436+
}
14437+
r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
14438+
if err != nil {
14439+
return localVarReturnValue, nil, err
14440+
}
14441+
14442+
localVarHttpResponse, err := a.client.callAPI(r)
14443+
if err != nil || localVarHttpResponse == nil {
14444+
return localVarReturnValue, localVarHttpResponse, err
14445+
}
14446+
defer localVarHttpResponse.Body.Close()
14447+
if localVarHttpResponse.StatusCode >= 300 {
14448+
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
14449+
return localVarReturnValue, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
14450+
}
14451+
14452+
return localVarReturnValue, localVarHttpResponse, err
14453+
}
14454+
1428514455
/*
1428614456
CellsApiService Convert document and save result to storage.
1428714457
* @param name The document name.
@@ -22077,8 +22247,8 @@ func (a *CellsApiService) MoveFolder( localVarOptionals *MoveFolderOpts) (*ht
2207722247
/*
2207822248
CellsApiService Get Access token
2207922249
* @param grantType Grant Type
22080-
* @param clientId Client Id
22081-
* @param clientSecret Client Secret
22250+
* @param clientId App SID
22251+
* @param clientSecret App Key
2208222252

2208322253
@return AccessTokenResponse
2208422254
*/

api_cells_test.go

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights
@@ -4175,6 +4175,53 @@ func TestCellsRangesPostWorksheetCellsRanges(t *testing.T) {
41754175
}
41764176
}
41774177

4178+
func TestCellsRangesDeleteWorksheetCellsRange(t *testing.T) {
4179+
name := GetBook1()
4180+
if err := GetBaseTest().UploadFile(name); err != nil {
4181+
t.Error(err)
4182+
}
4183+
4184+
args := new(CellsRangesDeleteWorksheetCellsRangeOpts)
4185+
args.Name = GetBook1()
4186+
args.SheetName = GetSheet1()
4187+
args.Range_ = "A1:B4"
4188+
args.Shift = "Up"
4189+
args.Folder = GetBaseTest().remoteFolder
4190+
4191+
response, httpResponse, err := GetBaseTest().CellsAPI.CellsRangesDeleteWorksheetCellsRange(args)
4192+
if err != nil {
4193+
t.Error(err)
4194+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
4195+
t.Fail()
4196+
} else {
4197+
fmt.Printf("%d\tTestCellsRangesDeleteWorksheetCellsRange - %d\n", GetBaseTest().GetTestNumber(), response.Code)
4198+
}
4199+
}
4200+
4201+
4202+
func TestCellsRangesPutWorksheetCellsRange(t *testing.T) {
4203+
name := GetBook1()
4204+
if err := GetBaseTest().UploadFile(name); err != nil {
4205+
t.Error(err)
4206+
}
4207+
4208+
args := new(CellsRangesPutWorksheetCellsRangeOpts)
4209+
args.Name = GetBook1()
4210+
args.SheetName = GetSheet1()
4211+
args.Range_ = "A1:B4"
4212+
args.Shift = "Down"
4213+
args.Folder = GetBaseTest().remoteFolder
4214+
4215+
response, httpResponse, err := GetBaseTest().CellsAPI.CellsRangesPutWorksheetCellsRange(args)
4216+
if err != nil {
4217+
t.Error(err)
4218+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
4219+
t.Fail()
4220+
} else {
4221+
fmt.Printf("%d\tTestCellsRangesPutWorksheetCellsRange - %d\n", GetBaseTest().GetTestNumber(), response.Code)
4222+
}
4223+
}
4224+
41784225
func TestCellsSaveAsPostDocumentSaveAs(t *testing.T) {
41794226
name := GetBook1()
41804227
if err := GetBaseTest().UploadFile(name); err != nil {

base_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright (c) 2020 Aspose.Cells Cloud
3+
* Copyright (c) 2021 Aspose.Cells Cloud
44
* Permission is hereby granted, free of charge, to any person obtaining a copy
55
* of this software and associated documentation files (the "Software"), to deal
66
* in the Software without restriction, including without limitation the rights

client.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var (
4747
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
4848
)
4949

50-
// APIClient manages communication with the Aspose.Cells Cloud SDK APIs. API v20.10
50+
// APIClient manages communication with the Aspose.Cells Cloud SDK APIs. API v21.1
5151
// In most cases there should be only one, shared, APIClient.
5252
type APIClient struct {
5353
cfg *Configuration
@@ -407,9 +407,6 @@ func strlen(s string) (int) {
407407

408408
// addAuth add Authorization header to request
409409
func (a *APIClient) addAuth(request *http.Request) (err error) {
410-
if(a.cfg.ClientSecret=="" && a.cfg.ClientId==""){
411-
return nil
412-
}
413410
if (a.cfg.AccessToken == "") {
414411
if err := a.RequestOauthToken(); err != nil {
415412
return err

configuration.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights
@@ -72,8 +72,8 @@ type Configuration struct {
7272
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
7373
UserAgent string `json:"userAgent,omitempty"`
7474
HTTPClient *http.Client
75-
ClientSecret string
76-
ClientId string
75+
ClientSecret string
76+
ClientId string
7777
AccessToken string
7878
GetAccessTokenTime time.Time
7979
}

model_above_average.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights

model_access_token_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights

model_area.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights

model_auto_filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020 Aspose.Cells Cloud
2+
* Copyright (c) 2021 Aspose.Cells Cloud
33
* Permission is hereby granted, free of charge, to any person obtaining a copy
44
* of this software and associated documentation files (the "Software"), to deal
55
* in the Software without restriction, including without limitation the rights

0 commit comments

Comments
 (0)